diff options
author | No author <no_author@ocaml.org> | 1995-06-15 08:17:30 +0000 |
---|---|---|
committer | No author <no_author@ocaml.org> | 1995-06-15 08:17:30 +0000 |
commit | f0a0321f07084edd6d4b4761b855d74e0521a86a (patch) | |
tree | 1a49ecaa36e8d05f8171b3395e46f69e24e94462 /byterun/fix_code.c | |
parent | 3ceaa85c72b2094bb090a1819b65a2792cf2d3c1 (diff) | |
download | ocaml-unlabeled-1.1.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-1.1.2
'unlabeled-1.1.2'.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/unlabeled-1.1.2@35 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/fix_code.c')
-rw-r--r-- | byterun/fix_code.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/byterun/fix_code.c b/byterun/fix_code.c deleted file mode 100644 index 9c24de180e..0000000000 --- a/byterun/fix_code.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Translate a block of bytecode (endianness switch, threading). */ - -#include "config.h" -#include "fix_code.h" -#include "misc.h" -#include "mlvalues.h" -#include "instruct.h" -#include "reverse.h" - -/* This code is needed only if the processor is big endian */ - -#ifdef BIG_ENDIAN - -void fixup_endianness(code, len) - code_t code; - asize_t len; -{ - code_t p; - len /= sizeof(opcode_t); - for (p = code; p < code + len; p++) { - Reverse_int32(p); - } -} - -#endif - -/* This code is needed only if we're using threaded code */ - -#ifdef THREADED_CODE - -void thread_code(code, len, instr_table) - code_t code; - asize_t len; - void * instr_table[]; -{ - code_t p; - len /= sizeof(opcode_t); - for (p = code; p < code + len; /*nothing*/) { - opcode_t instr = *p; - Assert(instr >= 0 && instr <= STOP); - *p++ = (opcode_t)((unsigned long)(instr_table[instr])); - switch(instr) { - /* Instructions with one operand */ - case PUSHACC: case ACC: case POP: case ASSIGN: - case PUSHENVACC: case ENVACC: case PUSH_RETADDR: case APPLY: - case APPTERM1: case APPTERM2: case APPTERM3: case RETURN: - case GRAB: case PUSHGETGLOBAL: case GETGLOBAL: case SETGLOBAL: - case PUSHATOM: case ATOM: case MAKEBLOCK1: case MAKEBLOCK2: - case MAKEBLOCK3: case GETFIELD: case SETFIELD: case DUMMY: - case BRANCH: case BRANCHIF: case BRANCHIFNOT: case PUSHTRAP: - case C_CALL1: case C_CALL2: case C_CALL3: case C_CALL4: - case CONSTINT: case PUSHCONSTINT: case OFFSETINT: case OFFSETREF: - p += 1; break; - /* Instructions with two operands */ - case APPTERM: case CLOSURE: case CLOSUREREC: case PUSHGETGLOBALFIELD: - case GETGLOBALFIELD: case MAKEBLOCK: case C_CALLN: - p += 2; break; - /* Instructions with N+1 operands */ - case SWITCH: case TRANSLATE: - p += *p + 1; break; - } - } - Assert(p = code + len); -} - -#endif |