summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Shinwell <mshinwell@janestreet.com>2015-10-28 10:56:49 +0000
committerMark Shinwell <mshinwell@janestreet.com>2015-10-28 10:56:49 +0000
commit17e1078ccefc5cf0e2522dc0cda09966ab000810 (patch)
treebbf962315758176cebb8629e3073e6f030599bdd
parent4bd9adbdc7dc345282971b02c2ec4632c7ec9fe2 (diff)
downloadocaml-17e1078ccefc5cf0e2522dc0cda09966ab000810.tar.gz
transl_exception_constructor now uses Immutable
-rwxr-xr-xboot/ocamlcbin1826168 -> 1828690 bytes
-rwxr-xr-xboot/ocamldepbin574006 -> 573791 bytes
-rwxr-xr-xboot/ocamllexbin259310 -> 259367 bytes
-rw-r--r--bytecomp/translmod.ml11
-rw-r--r--byterun/obj.c6
5 files changed, 11 insertions, 6 deletions
diff --git a/boot/ocamlc b/boot/ocamlc
index 33d3b3a828..ba32993f0b 100755
--- a/boot/ocamlc
+++ b/boot/ocamlc
Binary files differ
diff --git a/boot/ocamldep b/boot/ocamldep
index 844584aaf9..4a47869bcc 100755
--- a/boot/ocamldep
+++ b/boot/ocamldep
Binary files differ
diff --git a/boot/ocamllex b/boot/ocamllex
index bae5a2a708..911786114f 100755
--- a/boot/ocamllex
+++ b/boot/ocamllex
Binary files differ
diff --git a/bytecomp/translmod.ml b/bytecomp/translmod.ml
index 7d0887464e..de0392b399 100644
--- a/bytecomp/translmod.ml
+++ b/bytecomp/translmod.ml
@@ -45,8 +45,8 @@ let field_path path field =
(* Compile type extensions *)
-let prim_set_oo_id =
- Pccall (Primitive.simple ~name:"caml_set_oo_id" ~arity:1 ~alloc:false)
+let prim_fresh_oo_id =
+ Pccall (Primitive.simple ~name:"caml_fresh_oo_id" ~arity:1 ~alloc:false)
let transl_extension_constructor env path ext =
let name =
@@ -56,10 +56,9 @@ let transl_extension_constructor env path ext =
in
match ext.ext_kind with
Text_decl(args, ret) ->
- Lprim(prim_set_oo_id,
- [Lprim(Pmakeblock(Obj.object_tag, Mutable),
- [Lconst(Const_base(Const_string (name,None)));
- Lconst(Const_base(Const_int 0))])])
+ Lprim (Pmakeblock (Obj.object_tag, Immutable),
+ [Lconst (Const_base (Const_string (name, None)));
+ Lprim (prim_fresh_oo_id, [Lconst (Const_base (Const_int 0))])])
| Text_rebind(path, lid) ->
transl_path ~loc:ext.ext_loc env path
diff --git a/byterun/obj.c b/byterun/obj.c
index 27b50d9a3d..ab5b599705 100644
--- a/byterun/obj.c
+++ b/byterun/obj.c
@@ -245,6 +245,12 @@ CAMLprim value caml_set_oo_id (value obj) {
return obj;
}
+CAMLprim value caml_fresh_oo_id (value v) {
+ v = oo_last_id;
+ oo_last_id += 2;
+ return v;
+}
+
CAMLprim value caml_int_as_pointer (value n) {
return n - 1;
}