aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/cemitcodes.ml
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2017-11-23 14:48:05 +0100
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2018-02-14 16:16:12 +0100
commit8fa3c26adb1bc2c0201a61adede278a0e889eef4 (patch)
treed0763354c3b05da2e80780d057af068beb3be539 /kernel/cemitcodes.ml
parent8cd6ddb98c12b6aba002781158180ffb68aba02f (diff)
Move the call to the computation of bytecode inside Cemitcodes.
This shouldn't matter because the tcode_of_code function is pure, its only effect being allocating a string and filling it with the translated bytecode.
Diffstat (limited to 'kernel/cemitcodes.ml')
-rw-r--r--kernel/cemitcodes.ml11
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/cemitcodes.ml b/kernel/cemitcodes.ml
index bc6140ef4..41494441b 100644
--- a/kernel/cemitcodes.ml
+++ b/kernel/cemitcodes.ml
@@ -15,6 +15,10 @@ open Cbytecodes
open Copcodes
open Mod_subst
+type emitcodes = String.t
+
+external tcode_of_code : emitcodes -> int -> Vmvalues.tcode = "coq_tcode_of_code"
+
(* Relocation information *)
type reloc_info =
| Reloc_annot of annot_switch
@@ -57,9 +61,10 @@ let patch_int buff patches =
let patch buff pl f =
let map (r, pos) = (pos, f r) in
+ (** Order seems important here? *)
let patches = CList.map_left map pl in
let buff = patch_int buff patches in
- buff
+ tcode_of_code buff (String.length buff)
(* Buffering of bytecode *)
@@ -327,10 +332,6 @@ let init () =
label_table := Array.make 16 (Label_undefined []);
reloc_info := []
-type emitcodes = String.t
-
-let length = String.length
-
type to_patch = emitcodes * (patch list) * fv
(* Substitution *)