Skip to content

Commit

Permalink
move byte tag to 250
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 24, 2022
1 parent 83762af commit f9a14a5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
Binary file modified boot/ocamlc
Binary file not shown.
Binary file modified boot/ocamllex
Binary file not shown.
13 changes: 7 additions & 6 deletions runtime/caml/mlvalues.h
Expand Up @@ -195,7 +195,7 @@ bits 63 (64-P) (63-P) 10 9 8 7 0
#endif

/* The lowest tag for blocks containing no value. */
#define No_scan_tag 251
#define No_scan_tag 249


/* 1- If tag < No_scan_tag : a tuple of fields. */
Expand All @@ -217,20 +217,20 @@ typedef opcode_t * code_t;

/* Forward_tag: forwarding pointer that the GC may silently shortcut.
See stdlib/lazy.ml. */
#define Forward_tag 250
#define Forward_tag 248
#define Forward_val(v) Field(v, 0)

/* 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 */
/* Infix_tag must be 1 modulo 2 and infix headers can only occur in blocks
with tag Closure_tag (see compact.c). */

#define Infix_tag 249
#define Infix_tag 247
#define Infix_offset_hd(hd) (Bosize_hd(hd))
#define Infix_offset_val(v) Infix_offset_hd(Hd_val(v))

/* Another special case: objects */
#define Object_tag 248
#define Object_tag 246
#define Class_val(val) Field((val), 0)
#define Oid_val(val) Long_val(Field((val), 1))
CAMLextern value caml_get_public_method (value obj, value tag);
Expand All @@ -241,7 +241,7 @@ CAMLextern value caml_get_public_method (value obj, value tag);
same method name. */

/* Special case of tuples of fields: closures */
#define Closure_tag 247
#define Closure_tag 245
#define Code_val(val) (((code_t *) (val)) [0]) /* Also an l-value. */
#define Closinfo_val(val) Field((val), 1) /* Arity and start env */
/* In the closure info field, the top 8 bits are the arity (signed).
Expand All @@ -263,7 +263,7 @@ CAMLextern value caml_get_public_method (value obj, value tag);

/* This tag is used (with Forward_tag) to implement lazy values.
See major_gc.c and stdlib/lazy.ml. */
#define Lazy_tag 246
#define Lazy_tag 244

/* Another special case: variants */
CAMLextern value caml_hash_variant(char const * tag);
Expand All @@ -285,6 +285,7 @@ CAMLextern value caml_hash_variant(char const * tag);
#define Data_abstract_val(v) ((void*) Op_val(v))

/* Strings. */
#define Byte_tag 250
#define String_tag 252
#ifdef CAML_SAFE_STRING
#define String_val(x) ((const char *) Bp_val(x))
Expand Down
15 changes: 8 additions & 7 deletions stdlib/obj.ml
Expand Up @@ -47,17 +47,18 @@ external add_offset : t -> Int32.t -> t = "caml_obj_add_offset"
external with_tag : int -> t -> t = "caml_obj_with_tag"

let first_non_constant_constructor_tag = 0
let last_non_constant_constructor_tag = 245
let last_non_constant_constructor_tag = 243

let lazy_tag = 246
let closure_tag = 247
let object_tag = 248
let infix_tag = 249
let forward_tag = 250
let lazy_tag = 244
let closure_tag = 245
let object_tag = 246
let infix_tag = 247
let forward_tag = 248

let no_scan_tag = 251
let no_scan_tag = 249

let abstract_tag = 251
let byte_tag = 250
let string_tag = 252
let double_tag = 253
let double_array_tag = 254
Expand Down
4 changes: 2 additions & 2 deletions utils/config.mlp
Expand Up @@ -113,11 +113,11 @@ and linear_magic_number = "Caml1999L031"

let interface_suffix = ref ".mli"

let max_tag = 245
let max_tag = 243
(* This is normally the same as in obj.ml, but we have to define it
separately because it can differ when we're in the middle of a
bootstrapping phase. *)
let lazy_tag = 246
let lazy_tag = 244

let max_young_wosize = 256
let stack_threshold = 256 (* see runtime/caml/config.h *)
Expand Down

0 comments on commit f9a14a5

Please sign in to comment.