diff options
author | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2014-05-04 20:14:23 +0000 |
---|---|---|
committer | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2014-05-04 20:14:23 +0000 |
commit | 680fe9f91d2ba04f09c86b06f1dd84919c054b26 (patch) | |
tree | 2fded4d28dedbe565c446a7a04b6026867314707 | |
parent | c141951f2a88ce5e32b5a80552f74c5c8d1dd148 (diff) |
Add FIRST_UNIMPLEMENTED_OP instructioon to simplify bootstrapping after adding new bytecode instructions at the end
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14734 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rwxr-xr-x | boot/ocamlc | bin | 1529945 -> 1530185 bytes | |||
-rwxr-xr-x | boot/ocamldep | bin | 421355 -> 421351 bytes | |||
-rwxr-xr-x | boot/ocamllex | bin | 185796 -> 185808 bytes | |||
-rw-r--r-- | byterun/fix_code.c | 6 | ||||
-rw-r--r-- | byterun/instruct.h | 6 | ||||
-rw-r--r-- | byterun/interp.c | 1 |
6 files changed, 8 insertions, 5 deletions
diff --git a/boot/ocamlc b/boot/ocamlc Binary files differindex 8176924cb..302872676 100755 --- a/boot/ocamlc +++ b/boot/ocamlc diff --git a/boot/ocamldep b/boot/ocamldep Binary files differindex 21d8d540c..79e9d90fc 100755 --- a/boot/ocamldep +++ b/boot/ocamldep diff --git a/boot/ocamllex b/boot/ocamllex Binary files differindex b7a2decc5..29312e1de 100755 --- a/boot/ocamllex +++ b/boot/ocamllex diff --git a/byterun/fix_code.c b/byterun/fix_code.c index 746f8b750..3380dc919 100644 --- a/byterun/fix_code.c +++ b/byterun/fix_code.c @@ -98,10 +98,10 @@ char * caml_instr_base; void caml_thread_code (code_t code, asize_t len) { code_t p; - int l [STOP + 1]; + int l [FIRST_UNIMPLEMENTED_OP]; int i; - for (i = 0; i <= STOP; i++) { + for (i = 0; i < FIRST_UNIMPLEMENTED_OP; i++) { l [i] = 0; } /* Instructions with one operand */ @@ -125,7 +125,7 @@ void caml_thread_code (code_t code, asize_t len) len /= sizeof(opcode_t); for (p = code; p < code + len; /*nothing*/) { opcode_t instr = *p; - if (instr < 0 || instr > STOP){ + if (instr < 0 || instr >= FIRST_UNIMPLEMENTED_OP){ /* FIXME -- should Assert(false) ? caml_fatal_error_arg ("Fatal error in fix_code: bad opcode (%lx)\n", (char *)(long)instr); diff --git a/byterun/instruct.h b/byterun/instruct.h index a643b0f93..351a4cff9 100644 --- a/byterun/instruct.h +++ b/byterun/instruct.h @@ -40,7 +40,6 @@ enum instructions { GETSTRINGCHAR, SETSTRINGCHAR, BRANCH, BRANCHIF, BRANCHIFNOT, SWITCH, BOOLNOT, PUSHTRAP, POPTRAP, RAISE, - RERAISE, RAISE_NOTRACE, CHECK_SIGNALS, C_CALL1, C_CALL2, C_CALL3, C_CALL4, C_CALL5, C_CALLN, CONST0, CONST1, CONST2, CONST3, CONSTINT, @@ -55,7 +54,10 @@ enum instructions { BULTINT, BUGEINT, GETPUBMET, GETDYNMET, STOP, - EVENT, BREAK + EVENT, BREAK, + RERAISE, RAISE_NOTRACE, + FIRST_UNIMPLEMENTED_OP }; + #endif /* CAML_INSTRUCT_H */ diff --git a/byterun/interp.c b/byterun/interp.c index 9b682ba6e..059862719 100644 --- a/byterun/interp.c +++ b/byterun/interp.c @@ -1112,6 +1112,7 @@ value caml_interprete(code_t prog, asize_t prog_size) /* Debugging and machine control */ + Instruct(FIRST_UNIMPLEMENTED_OP): Instruct(STOP): caml_external_raise = initial_external_raise; caml_extern_sp = sp; |