summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2001-04-02 12:13:58 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2001-04-02 12:13:58 +0000
commit5bdf5bc1d93df4a67bd0068e2f0300cb763e3fe4 (patch)
treecb8881dea70bdad2f2c0a4f963732db1891b3672
parentc16439d28666234ad1067732d3db9491efc7dc5e (diff)
downloadocaml-5bdf5bc1d93df4a67bd0068e2f0300cb763e3fe4.tar.gz
Suppression re-partage des constantes structurees, ne sert pas a grand chose et introduit trop de differences semantiques par-rapport au compilateur bytecode
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3483 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--asmcomp/cmmgen.ml22
1 files changed, 8 insertions, 14 deletions
diff --git a/asmcomp/cmmgen.ml b/asmcomp/cmmgen.ml
index d5b68e5840..af2c3994c3 100644
--- a/asmcomp/cmmgen.ml
+++ b/asmcomp/cmmgen.ml
@@ -362,8 +362,7 @@ let new_const_symbol () =
incr const_label;
Compilenv.current_unit_name () ^ "_" ^ string_of_int !const_label
-let structured_constants =
- (Hashtbl.create 19 : (structured_constant, string) Hashtbl.t)
+let structured_constants = ref ([] : (string * structured_constant) list)
let transl_constant = function
Const_base(Const_int n) ->
@@ -377,14 +376,9 @@ let transl_constant = function
(Nativeint.shift_left (Nativeint.of_int n) 1)
Nativeint.one)
| cst ->
- let lbl =
- try
- Hashtbl.find structured_constants cst
- with Not_found ->
- let lbl = new_const_symbol() in
- Hashtbl.add structured_constants cst lbl;
- lbl
- in Cconst_symbol lbl
+ let lbl = new_const_symbol() in
+ structured_constants := (lbl, cst) :: !structured_constants;
+ Cconst_symbol lbl
(* Translate constant closures *)
@@ -1565,10 +1559,10 @@ let emit_constant_closure symb fundecls cont =
let emit_all_constants cont =
let c = ref cont in
- Hashtbl.iter
- (fun cst lbl -> c := Cdata(emit_constant lbl cst []) :: !c)
- structured_constants;
- Hashtbl.clear structured_constants;
+ List.iter
+ (fun (lbl, cst) -> c := Cdata(emit_constant lbl cst []) :: !c)
+ !structured_constants;
+ structured_constants := [];
List.iter
(fun (symb, bi, n) ->
c := Cdata(emit_boxedint_constant symb bi n) :: !c)