| Attached Files | symbol-displacement.patch [^] (25,349 bytes) 2007-10-10 03:47 [Show Content] [Hide Content]Index: asmcomp/cmm.ml
===================================================================
RCS file: /caml/ocaml/asmcomp/cmm.ml,v
retrieving revision 1.21
diff -u -r1.21 cmm.ml
--- asmcomp/cmm.ml 29 Jan 2007 12:10:50 -0000 1.21
+++ asmcomp/cmm.ml 10 Oct 2007 01:12:59 -0000
@@ -120,8 +120,8 @@
| Cint of nativeint
| Csingle of string
| Cdouble of string
- | Csymbol_address of string
- | Clabel_address of int
+ | Csymbol_address of string * int
+ | Clabel_address of int * int
| Cstring of string
| Cskip of int
| Calign of int
Index: asmcomp/cmm.mli
===================================================================
RCS file: /caml/ocaml/asmcomp/cmm.mli,v
retrieving revision 1.21
diff -u -r1.21 cmm.mli
--- asmcomp/cmm.mli 29 Jan 2007 12:10:50 -0000 1.21
+++ asmcomp/cmm.mli 10 Oct 2007 01:12:59 -0000
@@ -106,8 +106,8 @@
| Cint of nativeint
| Csingle of string
| Cdouble of string
- | Csymbol_address of string
- | Clabel_address of int
+ | Csymbol_address of string * int
+ | Clabel_address of int * int
| Cstring of string
| Cskip of int
| Calign of int
Index: asmcomp/cmmgen.ml
===================================================================
RCS file: /caml/ocaml/asmcomp/cmmgen.ml,v
retrieving revision 1.109
diff -u -r1.109 cmmgen.ml
--- asmcomp/cmmgen.ml 22 Feb 2007 12:13:00 -0000 1.109
+++ asmcomp/cmmgen.ml 10 Oct 2007 01:12:59 -0000
@@ -167,7 +167,8 @@
Cifthenelse(c2,
Cop(op, [c1; c2]),
Cop(Craise dbg,
- [Cconst_symbol "caml_bucket_Division_by_zero"])))
+ [Cop(Cadda, [Cconst_symbol "caml_bucket_Division_by_zero";
+ Cconst_int size_addr])])))
(* Bool *)
@@ -433,7 +434,7 @@
| cst ->
let lbl = new_const_symbol() in
structured_constants := (lbl, cst) :: !structured_constants;
- Cconst_symbol lbl
+ Cop(Cadda, [Cconst_symbol lbl; Cconst_int size_addr])
(* Translate constant closures *)
@@ -785,7 +786,7 @@
(fun (label, arity, params, body) ->
Queue.add (label, params, body) functions)
fundecls;
- Cconst_symbol lbl
+ Cop(Cadda, [Cconst_symbol lbl; Cconst_int size_addr])
| Uclosure(fundecls, clos_vars) ->
let block_size =
fundecls_size fundecls + List.length clos_vars in
@@ -859,7 +860,7 @@
| Uprim(prim, args, dbg) ->
begin match (simplif_primitive prim, args) with
(Pgetglobal id, []) ->
- Cconst_symbol (Ident.name id)
+ Cop(Cadda, [Cconst_symbol (Ident.name id); Cconst_int(size_addr)])
| (Pmakeblock(tag, mut), []) ->
transl_constant(Const_block(tag, []))
| (Pmakeblock(tag, mut), args) ->
@@ -1539,28 +1540,28 @@
let rec emit_constant symb cst cont =
match cst with
Const_base(Const_float s) ->
- Cint(float_header) :: Cdefine_symbol symb :: Cdouble s :: cont
+ Cdefine_symbol symb :: Cint(float_header) :: Cdouble s :: cont
| Const_base(Const_string s) | Const_immstring s ->
- Cint(string_header (String.length s)) ::
Cdefine_symbol symb ::
+ Cint(string_header (String.length s)) ::
emit_string_constant s cont
| Const_base(Const_int32 n) ->
- Cint(boxedint_header) :: Cdefine_symbol symb ::
+ Cdefine_symbol symb :: Cint(boxedint_header) ::
emit_boxed_int32_constant n cont
| Const_base(Const_int64 n) ->
- Cint(boxedint_header) :: Cdefine_symbol symb ::
+ Cdefine_symbol symb :: Cint(boxedint_header) ::
emit_boxed_int64_constant n cont
| Const_base(Const_nativeint n) ->
- Cint(boxedint_header) :: Cdefine_symbol symb ::
+ Cdefine_symbol symb :: Cint(boxedint_header) ::
emit_boxed_nativeint_constant n cont
| Const_block(tag, fields) ->
let (emit_fields, cont1) = emit_constant_fields fields cont in
- Cint(block_header tag (List.length fields)) ::
Cdefine_symbol symb ::
+ Cint(block_header tag (List.length fields)) ::
emit_fields @ cont1
| Const_float_array(fields) ->
- Cint(floatarray_header (List.length fields)) ::
Cdefine_symbol symb ::
+ Cint(floatarray_header (List.length fields)) ::
Misc.map_end (fun f -> Cdouble f) fields cont
| _ -> fatal_error "gencmm.emit_constant"
@@ -1581,37 +1582,37 @@
(Cint(Nativeint.of_int(((Char.code c) lsl 1) + 1)), cont)
| Const_base(Const_float s) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(float_header) :: Cdefine_label lbl :: Cdouble s :: cont)
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(float_header) :: Cdouble s :: cont)
| Const_base(Const_string s) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(string_header (String.length s)) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(string_header (String.length s)) ::
emit_string_constant s cont)
| Const_immstring s ->
begin try
- (Clabel_address (Hashtbl.find immstrings s), cont)
+ (Clabel_address((Hashtbl.find immstrings s), size_addr), cont)
with Not_found ->
let lbl = new_const_label() in
Hashtbl.add immstrings s lbl;
- (Clabel_address lbl,
- Cint(string_header (String.length s)) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(string_header (String.length s)) ::
emit_string_constant s cont)
end
| Const_base(Const_int32 n) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(boxedint_header) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(boxedint_header) ::
emit_boxed_int32_constant n cont)
| Const_base(Const_int64 n) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(boxedint_header) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(boxedint_header) ::
emit_boxed_int64_constant n cont)
| Const_base(Const_nativeint n) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(boxedint_header) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(boxedint_header) ::
emit_boxed_nativeint_constant n cont)
| Const_pointer n ->
(Cint(Nativeint.add (Nativeint.shift_left (Nativeint.of_int n) 1) 1n),
@@ -1619,13 +1620,13 @@
| Const_block(tag, fields) ->
let lbl = new_const_label() in
let (emit_fields, cont1) = emit_constant_fields fields cont in
- (Clabel_address lbl,
- Cint(block_header tag (List.length fields)) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(block_header tag (List.length fields)) ::
emit_fields @ cont1)
| Const_float_array(fields) ->
let lbl = new_const_label() in
- (Clabel_address lbl,
- Cint(floatarray_header (List.length fields)) :: Cdefine_label lbl ::
+ (Clabel_address(lbl, size_addr),
+ Cdefine_label lbl :: Cint(floatarray_header (List.length fields)) ::
Misc.map_end (fun f -> Cdouble f) fields cont)
and emit_string_constant s cont =
@@ -1635,23 +1636,23 @@
and emit_boxed_int32_constant n cont =
let n = Nativeint.of_int32 n in
if size_int = 8 then
- Csymbol_address("caml_int32_ops") :: Cint32 n :: Cint32 0n :: cont
+ Csymbol_address("caml_int32_ops", 0) :: Cint32 n :: Cint32 0n :: cont
else
- Csymbol_address("caml_int32_ops") :: Cint n :: cont
+ Csymbol_address("caml_int32_ops", 0) :: Cint n :: cont
and emit_boxed_nativeint_constant n cont =
- Csymbol_address("caml_nativeint_ops") :: Cint n :: cont
+ Csymbol_address("caml_nativeint_ops", 0) :: Cint n :: cont
and emit_boxed_int64_constant n cont =
let lo = Int64.to_nativeint n in
if size_int = 8 then
- Csymbol_address("caml_int64_ops") :: Cint lo :: cont
+ Csymbol_address("caml_int64_ops", 0) :: Cint lo :: cont
else begin
let hi = Int64.to_nativeint (Int64.shift_right n 32) in
if big_endian then
- Csymbol_address("caml_int64_ops") :: Cint hi :: Cint lo :: cont
+ Csymbol_address("caml_int64_ops", 0) :: Cint hi :: Cint lo :: cont
else
- Csymbol_address("caml_int64_ops") :: Cint lo :: Cint hi :: cont
+ Csymbol_address("caml_int64_ops", 0) :: Cint lo :: Cint hi :: cont
end
(* Emit constant closures *)
@@ -1665,25 +1666,25 @@
| (label, arity, params, body) :: rem ->
if arity = 1 then
Cint(infix_header pos) ::
- Csymbol_address label ::
+ Csymbol_address(label, 0) ::
Cint 3n ::
emit_others (pos + 3) rem
else
Cint(infix_header pos) ::
- Csymbol_address(curry_function arity) ::
+ Csymbol_address((curry_function arity), 0) ::
Cint(Nativeint.of_int (arity lsl 1 + 1)) ::
- Csymbol_address label ::
+ Csymbol_address(label, 0) ::
emit_others (pos + 4) rem in
- Cint(closure_header (fundecls_size fundecls)) ::
Cdefine_symbol symb ::
+ Cint(closure_header (fundecls_size fundecls)) ::
if arity = 1 then
- Csymbol_address label ::
+ Csymbol_address(label, 0) ::
Cint 3n ::
emit_others 3 remainder
else
- Csymbol_address(curry_function arity) ::
+ Csymbol_address((curry_function arity), 0) ::
Cint(Nativeint.of_int (arity lsl 1 + 1)) ::
- Csymbol_address label ::
+ Csymbol_address(label, 0) ::
emit_others 4 remainder
(* Emit all structured constants *)
@@ -1712,9 +1713,9 @@
fun_body = init_code; fun_fast = false}] in
let c2 = transl_all_functions StringSet.empty c1 in
let c3 = emit_all_constants c2 in
- Cdata [Cint(block_header 0 size);
- Cglobal_symbol glob;
+ Cdata [Cglobal_symbol glob;
Cdefine_symbol glob;
+ Cint(block_header 0 size);
Cskip(size * size_addr)] :: c3
(*
@@ -1954,7 +1955,7 @@
let global_table namelist =
let mksym name =
- Csymbol_address (Compilenv.make_symbol ~unitname:name None)
+ Csymbol_address((Compilenv.make_symbol ~unitname:name None), size_addr)
in
Cdata(Cglobal_symbol "caml_globals" ::
Cdefine_symbol "caml_globals" ::
@@ -1970,7 +1971,8 @@
let frame_table namelist =
let mksym name =
- Csymbol_address (Compilenv.make_symbol ~unitname:name (Some "frametable"))
+ Csymbol_address(
+ (Compilenv.make_symbol ~unitname:name (Some "frametable")), 0)
in
Cdata(Cglobal_symbol "caml_frametable" ::
Cdefine_symbol "caml_frametable" ::
@@ -1981,8 +1983,8 @@
let segment_table namelist symbol begname endname =
let addsyms name lst =
- Csymbol_address (Compilenv.make_symbol ~unitname:name (Some begname)) ::
- Csymbol_address (Compilenv.make_symbol ~unitname:name (Some endname)) ::
+ Csymbol_address((Compilenv.make_symbol ~unitname:name (Some begname)), 0) ::
+ Csymbol_address((Compilenv.make_symbol ~unitname:name (Some endname)), 0) ::
lst
in
Cdata(Cglobal_symbol symbol ::
@@ -2003,6 +2005,6 @@
Cdata(Cglobal_symbol symname ::
emit_constant symname (Const_block(0,[Const_base(Const_string name)]))
[ Cglobal_symbol bucketname;
- Cint(block_header 0 1);
Cdefine_symbol bucketname;
- Csymbol_address symname ])
+ Cint(block_header 0 1);
+ Csymbol_address(symname, size_addr) ])
Index: asmcomp/emitaux.ml
===================================================================
RCS file: /caml/ocaml/asmcomp/emitaux.ml,v
retrieving revision 1.12
diff -u -r1.12 emitaux.ml
--- asmcomp/emitaux.ml 29 Jan 2007 12:10:50 -0000 1.12
+++ asmcomp/emitaux.ml 10 Oct 2007 01:12:59 -0000
@@ -44,6 +44,13 @@
Printf.fprintf !output_channel "%c%02x" esc (Char.code c)
done
+let emit_disp disp =
+ if disp > 0 then begin
+ emit_string " + "; emit_int disp
+ end else if disp < 0 then begin
+ emit_string " - "; emit_int (-disp)
+ end
+
let emit_string_literal s =
let last_was_escape = ref false in
emit_string "\"";
Index: asmcomp/emitaux.mli
===================================================================
RCS file: /caml/ocaml/asmcomp/emitaux.mli,v
retrieving revision 1.12
diff -u -r1.12 emitaux.mli
--- asmcomp/emitaux.mli 29 Jan 2007 12:10:50 -0000 1.12
+++ asmcomp/emitaux.mli 10 Oct 2007 01:12:59 -0000
@@ -20,6 +20,7 @@
val emit_nativeint: nativeint -> unit
val emit_int32: int32 -> unit
val emit_symbol: char -> string -> unit
+val emit_disp: int -> unit
val emit_printf: ('a, out_channel, unit) format -> 'a
val emit_char: char -> unit
val emit_string_literal: string -> unit
Index: asmcomp/printcmm.ml
===================================================================
RCS file: /caml/ocaml/asmcomp/printcmm.ml,v
retrieving revision 1.25
diff -u -r1.25 printcmm.ml
--- asmcomp/printcmm.ml 29 Jan 2007 12:10:50 -0000 1.25
+++ asmcomp/printcmm.ml 10 Oct 2007 01:12:59 -0000
@@ -189,8 +189,8 @@
| Cint n -> fprintf ppf "int %s" (Nativeint.to_string n)
| Csingle f -> fprintf ppf "single %s" f
| Cdouble f -> fprintf ppf "double %s" f
- | Csymbol_address s -> fprintf ppf "addr \"%s\"" s
- | Clabel_address l -> fprintf ppf "addr L%i" l
+ | Csymbol_address(s, disp) -> fprintf ppf "addr \"%s\"%+d" s disp
+ | Clabel_address(l, disp) -> fprintf ppf "addr L%i%+d" l disp
| Cstring s -> fprintf ppf "string \"%s\"" s
| Cskip n -> fprintf ppf "skip %i" n
| Calign n -> fprintf ppf "align %i" n
Index: asmcomp/alpha/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/alpha/emit.mlp,v
retrieving revision 1.42
diff -u -r1.42 emit.mlp
--- asmcomp/alpha/emit.mlp 16 Apr 2006 23:28:14 -0000 1.42
+++ asmcomp/alpha/emit.mlp 10 Oct 2007 01:12:59 -0000
@@ -796,10 +796,10 @@
` .float {emit_string f}\n`
| Cdouble f ->
` .double {emit_string f}\n`
- | Csymbol_address s ->
- ` .quad {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .quad {emit_label (100000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .quad {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .quad {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmcomp/amd64/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/amd64/emit.mlp,v
retrieving revision 1.13
diff -u -r1.13 emit.mlp
--- asmcomp/amd64/emit.mlp 29 Jan 2007 12:10:50 -0000 1.13
+++ asmcomp/amd64/emit.mlp 10 Oct 2007 01:12:59 -0000
@@ -661,10 +661,10 @@
` .float {emit_string f}\n`
| Cdouble f ->
` .double {emit_string f}\n`
- | Csymbol_address s ->
- ` .quad {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .quad {emit_label (100000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .quad {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .quad {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmcomp/amd64/emit_nt.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/amd64/emit_nt.mlp,v
retrieving revision 1.6
diff -u -r1.6 emit_nt.mlp
--- asmcomp/amd64/emit_nt.mlp 1 Mar 2007 10:26:51 -0000 1.6
+++ asmcomp/amd64/emit_nt.mlp 10 Oct 2007 01:12:59 -0000
@@ -691,11 +691,11 @@
` REAL4 {emit_float f}\n`
| Cdouble f ->
` REAL8 {emit_float f}\n`
- | Csymbol_address s ->
+ | Csymbol_address(s, disp) ->
add_used_symbol s;
- ` QWORD {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` QWORD {emit_label (100000 + lbl)}\n`
+ ` QWORD {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` QWORD {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_bytes_directive " BYTE " s
| Cskip n ->
Index: asmcomp/arm/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/arm/emit.mlp,v
retrieving revision 1.18
diff -u -r1.18 emit.mlp
--- asmcomp/arm/emit.mlp 3 May 2004 12:46:50 -0000 1.18
+++ asmcomp/arm/emit.mlp 10 Oct 2007 01:12:59 -0000
@@ -627,10 +627,10 @@
| Cdouble f ->
` .align 0\n`;
` .double {emit_string f}\n`
- | Csymbol_address s ->
- ` .word {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .word {emit_label (10000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .word {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .word {emit_label (10000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmcomp/hppa/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/hppa/emit.mlp,v
retrieving revision 1.20
diff -u -r1.20 emit.mlp
--- asmcomp/hppa/emit.mlp 16 Apr 2006 23:28:14 -0000 1.20
+++ asmcomp/hppa/emit.mlp 10 Oct 2007 01:12:59 -0000
@@ -975,11 +975,11 @@
` .float {emit_string f}\n`
| Cdouble f ->
` .double {emit_string f}\n`
- | Csymbol_address s ->
+ | Csymbol_address(s, disp) ->
use_symbol s;
- ` .long {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .long {emit_label(lbl + 100000)}\n`
+ ` .long {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .long {emit_label(lbl + 100000)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmcomp/i386/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/i386/emit.mlp,v
retrieving revision 1.39
diff -u -r1.39 emit.mlp
--- asmcomp/i386/emit.mlp 8 Oct 2007 14:19:32 -0000 1.39
+++ asmcomp/i386/emit.mlp 10 Oct 2007 01:12:59 -0000
@@ -930,10 +930,10 @@
` .float {emit_string f}\n`
| Cdouble f ->
` .double {emit_string f}\n`
- | Csymbol_address s ->
- ` .long {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .long {emit_label (100000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .long {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .long {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
if use_ascii_dir
then emit_string_directive " .ascii " s
Index: asmcomp/i386/emit_nt.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/i386/emit_nt.mlp,v
retrieving revision 1.27
diff -u -r1.27 emit_nt.mlp
--- asmcomp/i386/emit_nt.mlp 29 Jan 2007 12:10:50 -0000 1.27
+++ asmcomp/i386/emit_nt.mlp 10 Oct 2007 01:13:00 -0000
@@ -826,11 +826,11 @@
` REAL4 {emit_float f}\n`
| Cdouble f ->
` REAL8 {emit_float f}\n`
- | Csymbol_address s ->
+ | Csymbol_address(s, disp) ->
add_used_symbol s ;
- ` DWORD {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` DWORD {emit_label (100000 + lbl)}\n`
+ ` DWORD {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` DWORD {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_bytes_directive " BYTE " s
| Cskip n ->
Index: asmcomp/ia64/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/ia64/emit.mlp,v
retrieving revision 1.17
diff -u -r1.17 emit.mlp
--- asmcomp/ia64/emit.mlp 13 Jul 2004 12:18:53 -0000 1.17
+++ asmcomp/ia64/emit.mlp 10 Oct 2007 01:13:00 -0000
@@ -1290,10 +1290,10 @@
` real4 {emit_string f}\n`
| Cdouble f ->
` real8 {emit_string f}\n`
- | Csymbol_address s ->
- ` data8 {emit_symbol s}#\n`
- | Clabel_address lbl ->
- ` data8 {emit_label (100000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` data8 {emit_symbol s}#{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` data8 {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " string " s
| Cskip n ->
Index: asmcomp/mips/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/mips/emit.mlp,v
retrieving revision 1.18
diff -u -r1.18 emit.mlp
--- asmcomp/mips/emit.mlp 5 Jan 2004 20:25:56 -0000 1.18
+++ asmcomp/mips/emit.mlp 10 Oct 2007 01:13:00 -0000
@@ -531,10 +531,10 @@
| Cdouble f ->
` .align 0\n`; (* Prevent alignment on 8-byte boundary *)
` .double {emit_string f}\n`
- | Csymbol_address s ->
- ` .word {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .word {emit_label (100000 + lbl)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .word {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .word {emit_label (100000 + lbl)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmcomp/power/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/power/emit.mlp,v
retrieving revision 1.24
diff -u -r1.24 emit.mlp
--- asmcomp/power/emit.mlp 8 Oct 2007 14:19:32 -0000 1.24
+++ asmcomp/power/emit.mlp 10 Oct 2007 01:13:00 -0000
@@ -901,10 +901,10 @@
` .float 0d{emit_string f}\n`
| Cdouble f ->
` .double 0d{emit_string f}\n`
- | Csymbol_address s ->
- ` {emit_string datag} {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` {emit_string datag} {emit_label (lbl + 100000)}\n`
+ | Csymbol_address(s, disp) ->
+ ` {emit_string datag} {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` {emit_string datag} {emit_label (lbl + 100000)}{emit_disp disp}\n`
| Cstring s ->
emit_bytes_directive " .byte " s
| Cskip n ->
Index: asmcomp/sparc/emit.mlp
===================================================================
RCS file: /caml/ocaml/asmcomp/sparc/emit.mlp,v
retrieving revision 1.24
diff -u -r1.24 emit.mlp
--- asmcomp/sparc/emit.mlp 16 Apr 2006 23:28:15 -0000 1.24
+++ asmcomp/sparc/emit.mlp 10 Oct 2007 01:13:00 -0000
@@ -726,10 +726,10 @@
` .single 0r{emit_string f}\n`
| Cdouble f ->
` .double 0r{emit_string f}\n`
- | Csymbol_address s ->
- ` .word {emit_symbol s}\n`
- | Clabel_address lbl ->
- ` .word {emit_label (lbl + 100000)}\n`
+ | Csymbol_address(s, disp) ->
+ ` .word {emit_symbol s}{emit_disp disp}\n`
+ | Clabel_address(lbl, disp) ->
+ ` .word {emit_label (lbl + 100000)}{emit_disp disp}\n`
| Cstring s ->
emit_string_directive " .ascii " s
| Cskip n ->
Index: asmrun/fail.c
===================================================================
RCS file: /caml/ocaml/asmrun/fail.c,v
retrieving revision 1.38
diff -u -r1.38 fail.c
--- asmrun/fail.c 28 Nov 2006 15:45:24 -0000 1.38
+++ asmrun/fail.c 10 Oct 2007 01:13:00 -0000
@@ -29,7 +29,7 @@
/* The globals holding predefined exceptions */
-typedef value caml_generated_constant[1];
+typedef header_t caml_generated_constant;
extern caml_generated_constant
caml_exn_Out_of_memory,
@@ -101,12 +101,12 @@
void caml_failwith (char const *msg)
{
- caml_raise_with_string((value) caml_exn_Failure, msg);
+ caml_raise_with_string(Val_hp(&caml_exn_Failure), msg);
}
void caml_invalid_argument (char const *msg)
{
- caml_raise_with_string((value) caml_exn_Invalid_argument, msg);
+ caml_raise_with_string(Val_hp(&caml_exn_Invalid_argument), msg);
}
/* To raise [Out_of_memory], we can't use [caml_raise_constant],
@@ -119,37 +119,37 @@
void caml_raise_out_of_memory(void)
{
- caml_raise((value) &caml_bucket_Out_of_memory);
+ caml_raise(Val_hp(&caml_bucket_Out_of_memory));
}
void caml_raise_stack_overflow(void)
{
- caml_raise((value) &caml_bucket_Stack_overflow);
+ caml_raise(Val_hp(&caml_bucket_Stack_overflow));
}
void caml_raise_sys_error(value msg)
{
- caml_raise_with_arg((value) caml_exn_Sys_error, msg);
+ caml_raise_with_arg(Val_hp(&caml_exn_Sys_error), msg);
}
void caml_raise_end_of_file(void)
{
- caml_raise_constant((value) caml_exn_End_of_file);
+ caml_raise_constant(Val_hp(&caml_exn_End_of_file));
}
void caml_raise_zero_divide(void)
{
- caml_raise_constant((value) caml_exn_Division_by_zero);
+ caml_raise_constant(Val_hp(&caml_exn_Division_by_zero));
}
void caml_raise_not_found(void)
{
- caml_raise_constant((value) caml_exn_Not_found);
+ caml_raise_constant(Val_hp(&caml_exn_Not_found));
}
void caml_raise_sys_blocked_io(void)
{
- caml_raise_constant((value) caml_exn_Sys_blocked_io);
+ caml_raise_constant(Val_hp(&caml_exn_Sys_blocked_io));
}
/* We allocate statically the bucket for the exception because we can't
@@ -177,7 +177,7 @@
array_bound_error_msg.hdr = Make_header(wosize, String_tag, Caml_white);
array_bound_error_msg.data[offset_index] = offset_index - BOUND_MSG_LEN;
array_bound_error_bucket.hdr = Make_header(2, 0, Caml_white);
- array_bound_error_bucket.exn = (value) caml_exn_Invalid_argument;
+ array_bound_error_bucket.exn = Val_hp(&caml_exn_Invalid_argument);
array_bound_error_bucket.arg = (value) array_bound_error_msg.data;
caml_raise((value) &array_bound_error_bucket.exn);
}
|