summaryrefslogtreecommitdiffstats
path: root/byterun/fix_code.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1998-04-06 09:15:55 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1998-04-06 09:15:55 +0000
commitea8fe59ea07cb8da82c8581d8cf0c9d844867375 (patch)
tree61e86e83bf329920d4af220a47867f682a10d099 /byterun/fix_code.c
parentd83bfc2f72be1d4861369eb80ecce0a3a29c2f79 (diff)
Adoption des memes representations que dans ocamlopt pour les tableaux de flottants et les fonctions mutuellement recursives.
Simplification de la compilation du let rec de valeurs. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1895 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/fix_code.c')
-rw-r--r--byterun/fix_code.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/byterun/fix_code.c b/byterun/fix_code.c
index 7cdf64547..1ea06568e 100644
--- a/byterun/fix_code.c
+++ b/byterun/fix_code.c
@@ -98,13 +98,15 @@ void thread_code (code_t code, asize_t len)
l[APPTERM1] = l[APPTERM2] = l[APPTERM3] = l[RETURN] =
l[GRAB] = l[PUSHGETGLOBAL] = l[GETGLOBAL] = l[SETGLOBAL] =
l[PUSHATOM] = l[ATOM] = l[MAKEBLOCK1] = l[MAKEBLOCK2] =
- l[MAKEBLOCK3] = l[GETFIELD] = l[SETFIELD] = l[DUMMY] =
+ l[MAKEBLOCK3] = l[MAKEFLOATBLOCK] = l[GETFIELD] =
+ l[GETFLOATFIELD] = l[SETFIELD] = l[SETFLOATFIELD] =
l[BRANCH] = l[BRANCHIF] = l[BRANCHIFNOT] = l[PUSHTRAP] =
l[C_CALL1] = l[C_CALL2] = l[C_CALL3] = l[C_CALL4] = l[C_CALL5] =
- l[CONSTINT] = l[PUSHCONSTINT] = l[OFFSETINT] = l[OFFSETREF] = 1;
+ l[CONSTINT] = l[PUSHCONSTINT] = l[OFFSETINT] =
+ l[OFFSETREF] = l[OFFSETCLOSURE] = l[PUSHOFFSETCLOSURE] = 1;
/* Instructions with two operands */
- l[APPTERM] = l[CLOSURE] = l[CLOSUREREC] = l[PUSHGETGLOBALFIELD] =
+ l[APPTERM] = l[CLOSURE] = l[PUSHGETGLOBALFIELD] =
l[GETGLOBALFIELD] = l[MAKEBLOCK] = l[C_CALLN] = 2;
len /= sizeof(opcode_t);
@@ -120,6 +122,10 @@ void thread_code (code_t code, asize_t len)
uint32 const_size = sizes & 0xFFFF;
uint32 block_size = sizes >> 16;
p += const_size + block_size;
+ } else if (instr == CLOSUREREC) {
+ uint32 nfuncs = *p++;
+ p++; /* skip nvars */
+ p += nfuncs;
} else {
p += l[instr];
}