vm: faster immediate_p()

db4
Slava Pestov 2009-11-02 20:21:21 -06:00
parent 857d0ba1fd
commit 2c0531b015
2 changed files with 6 additions and 5 deletions

View File

@ -16,11 +16,11 @@ BIN: 1111 tag-mask set
H{ H{
{ fixnum 0 } { fixnum 0 }
{ bignum 1 } { POSTPONE: f 1 }
{ array 2 } { array 2 }
{ float 3 } { float 3 }
{ quotation 4 } { quotation 4 }
{ POSTPONE: f 5 } { bignum 5 }
{ alien 6 } { alien 6 }
{ tuple 7 } { tuple 7 }
{ wrapper 8 } { wrapper 8 }

View File

@ -35,11 +35,11 @@ static const cell data_alignment = 16;
/*** Tags ***/ /*** Tags ***/
#define FIXNUM_TYPE 0 #define FIXNUM_TYPE 0
#define BIGNUM_TYPE 1 #define F_TYPE 1
#define ARRAY_TYPE 2 #define ARRAY_TYPE 2
#define FLOAT_TYPE 3 #define FLOAT_TYPE 3
#define QUOTATION_TYPE 4 #define QUOTATION_TYPE 4
#define F_TYPE 5 #define BIGNUM_TYPE 5
#define ALIEN_TYPE 6 #define ALIEN_TYPE 6
#define TUPLE_TYPE 7 #define TUPLE_TYPE 7
#define WRAPPER_TYPE 8 #define WRAPPER_TYPE 8
@ -76,7 +76,8 @@ static const cell false_object = F_TYPE;
inline static bool immediate_p(cell obj) inline static bool immediate_p(cell obj)
{ {
return (obj == false_object || TAG(obj) == FIXNUM_TYPE); /* We assume that fixnums have tag 0 and false_object has tag 1 */
return TAG(obj) <= F_TYPE;
} }
inline static fixnum untag_fixnum(cell tagged) inline static fixnum untag_fixnum(cell tagged)