diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1995-07-28 13:59:46 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1995-07-28 13:59:46 +0000 |
commit | 1e081aeae300d0f48b5649d437dc3d6a1c3b0334 (patch) | |
tree | 5db645ab3bfc28629ae7ca77e7bbe70fc50fec39 | |
parent | a96d86b6da4076256fd67ce795ea80ba9894b034 (diff) |
MAJ tags pour que Infix_tag soit impair.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@171 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | asmcomp/cmmgen.ml | 8 | ||||
-rw-r--r-- | byterun/Makefile | 2 | ||||
-rw-r--r-- | byterun/mlvalues.h | 22 |
3 files changed, 17 insertions, 15 deletions
diff --git a/asmcomp/cmmgen.ml b/asmcomp/cmmgen.ml index 995214341..d53941ad7 100644 --- a/asmcomp/cmmgen.ml +++ b/asmcomp/cmmgen.ml @@ -18,8 +18,8 @@ let bind name arg fn = (* Block headers. Meaning of the tag field: 0 - 248: regular blocks - 249: closures - 250: infix closure + 249: infix closure + 250: closures 251: abstract 252: string 253: float @@ -29,8 +29,8 @@ let bind name arg fn = let float_tag = Cconst_int 253 let block_header tag sz = (sz lsl 10) + tag -let closure_header sz = block_header 249 sz -let infix_header ofs = block_header 250 ofs +let closure_header sz = block_header 250 sz +let infix_header ofs = block_header 249 ofs let float_header = block_header 253 (size_float / size_addr) let floatarray_header len = block_header 254 (len * size_float / size_addr) let string_header len = block_header 252 ((len + size_addr) / size_addr) diff --git a/byterun/Makefile b/byterun/Makefile index b452117c5..0f939e5d1 100644 --- a/byterun/Makefile +++ b/byterun/Makefile @@ -16,7 +16,7 @@ PRIMS=array.c compare.c crc.c extern.c floats.c gc_ctrl.c hash.c \ intern.c interp.c ints.c io.c meta.c obj.c parsing.c \ signals.c str.c sys.c terminfo.c -all: camlrun camlrund +all: camlrun camlrun: $(OBJS) prims.o $(BYTECC) $(BYTECCCOMPOPTS) $(CCLINKOPTS) $(LOWADDRESSES) -o camlrun prims.o $(OBJS) $(CCLIBS) diff --git a/byterun/mlvalues.h b/byterun/mlvalues.h index 2f32ea70c..d4828548b 100644 --- a/byterun/mlvalues.h +++ b/byterun/mlvalues.h @@ -132,7 +132,7 @@ bits 63 10 9 8 7 0 #endif /* The lowest tag for blocks containing no value. */ -#define No_scan_tag (Num_tags - 6) +#define No_scan_tag 251 /* 1- If tag < No_scan_tag : a tuple of fields. */ @@ -145,13 +145,15 @@ bits 63 10 9 8 7 0 typedef int32 opcode_t; typedef opcode_t * code_t; -#define Closure_tag (No_scan_tag - 1) +/* Special case of tuples of fields: closures */ + +#define Closure_tag 250 #define Code_val(val) (((code_t *) (val)) [0]) /* Also an l-value. */ -/* 2- If tag == No_scan_tag : an infix header inside a closure */ -/* Since No_scan_tag is odd, the infix header will be scanned as an integer */ +/* If tag == Infix_tag : an infix header inside a closure */ +/* Infix_tag must be odd so that the infix header is scanned as an integer */ -#define Infix_tag No_scan_tag +#define Infix_tag 249 #define Infix_offset_hd(hd) (Bosize_hd(hd)) #define Infix_offset_val(v) Infix_offset_hd(Hd_val(v)) @@ -167,14 +169,14 @@ typedef opcode_t * code_t; /* Abstract things. Their contents is not traced by the GC; therefore they must not contain any [value]. */ -#define Abstract_tag (No_scan_tag + 1) +#define Abstract_tag 251 /* Strings. */ -#define String_tag (No_scan_tag + 2) +#define String_tag 252 #define String_val(x) ((char *) Bp_val(x)) /* Floating-point numbers. */ -#define Double_tag (No_scan_tag + 3) +#define Double_tag 253 #define Double_wosize ((sizeof(double) / sizeof(value))) #ifndef ALIGN_DOUBLE #define Double_val(v) (* (double *)(v)) @@ -185,7 +187,7 @@ void Store_double_val P((value,double)); #endif /* Arrays of floating-point numbers. */ -#define Double_array_tag (No_scan_tag + 4) +#define Double_array_tag 254 #define Double_field(v,i) Double_val((value)((double *)(v) + (i))) #define Store_double_field(v,i,d) \ Store_double_val((value)((double *)(v) + (i)),d) @@ -193,7 +195,7 @@ void Store_double_val P((value,double)); /* Finalized things. Just like abstract things, but the GC will call the [Final_fun] before deallocation. */ -#define Final_tag (No_scan_tag + 5) +#define Final_tag 255 typedef void (*final_fun) P((value)); #define Final_fun(val) (((final_fun *) (val)) [0]) /* Also an l-value. */ |