diff options
author | Andy Wingo <wingo@pobox.com> | 2009-07-24 11:00:32 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2009-07-24 11:00:32 +0200 |
commit | 80545853d544f347ae991a476d78ccbf4d305ec7 (patch) | |
tree | 3dbf17cfe4f519ecb1fff9edc5e360ef48bba49f /libguile/vm-i-system.c | |
parent | ccf77d955c875ce95473098af96da9e1bec0b7eb (diff) | |
download | guile-80545853d544f347ae991a476d78ccbf4d305ec7.tar.gz |
compiler support for nlocs >= 256
* libguile/vm-i-system.c (long-local-ref, long-local-set)
(make-variable): New intructions, for handling nlocs >= 256.
* module/language/glil/compile-assembly.scm (glil->assembly): Compile
<glil-lexical> with support for nlocs >= 256.
Diffstat (limited to 'libguile/vm-i-system.c')
-rw-r--r-- | libguile/vm-i-system.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index e12217ecc..c2c674d27 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -278,6 +278,16 @@ VM_DEFINE_INSTRUCTION (25, local_ref, "local-ref", 1, 0, 1) NEXT; } +VM_DEFINE_INSTRUCTION (26, long_local_ref, "long-local-ref", 2, 0, 1) +{ + unsigned int i = FETCH (); + i <<= 8; + i += FETCH (); + PUSH (LOCAL_REF (i)) + ASSERT_BOUND (*sp); + NEXT; +} + VM_DEFINE_INSTRUCTION (27, variable_ref, "variable-ref", 0, 0, 1) { SCM x = *sp; @@ -354,6 +364,16 @@ VM_DEFINE_INSTRUCTION (30, local_set, "local-set", 1, 1, 0) NEXT; } +VM_DEFINE_INSTRUCTION (31, long_local_set, "long-local-set", 2, 1, 0) +{ + unsigned int i = FETCH (); + i <<= 8; + i += FETCH (); + LOCAL_SET (i, *sp); + DROP (); + NEXT; +} + VM_DEFINE_INSTRUCTION (32, variable_set, "variable-set", 0, 1, 0) { VARIABLE_SET (sp[0], sp[-1]); @@ -1183,6 +1203,14 @@ VM_DEFINE_INSTRUCTION (63, make_closure, "make-closure", 0, 2, 1) NEXT; } +VM_DEFINE_INSTRUCTION (64, make_variable, "make-variable", 0, 0, 1) +{ + SYNC_BEFORE_GC (); + /* fixme underflow */ + PUSH (scm_cell (scm_tc7_variable, SCM_UNPACK (SCM_UNDEFINED))); + NEXT; +} + /* (defun renumber-ops () |