summaryrefslogtreecommitdiffstats
path: root/vm.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-04-23 06:22:19 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-04-23 06:22:19 -0700
commitec0ae5b465e8254f7cc767eb86db1c66ed3a9733 (patch)
treeccb6b1760db79f5ccb189e4227c423e3a1226e02 /vm.c
parenta361c89773e5faa9a0abde94361b1060e939ba66 (diff)
downloadtxr-ec0ae5b465e8254f7cc767eb86db1c66ed3a9733.tar.gz
txr-ec0ae5b465e8254f7cc767eb86db1c66ed3a9733.tar.bz2
txr-ec0ae5b465e8254f7cc767eb86db1c66ed3a9733.zip
New macro: load-time.
This is similar to the ANSI CL load-time-value. * eval.c (load_time_s, load_time_lit_s): New symbol variables. (op_load_time_lit, me_load_time): New static functions. (eval_init): Intern load-time symbol and sys:load-time-lit. Register the sys:load-time-lit special operator and load-time macro. * share/txr/stdlib/asm.tl (assembler parse-args): We must now allow the d registers to be the targets of a mov instruction, because load-time depends on being able to mutate the data vector, in order to turn the result of a calculation into a de facto literal. * share/txr/stdlib/compiler.tl (compiler): New member, lt-frags. (compile-in-toplevel): New macro. (compiler alloc-dreg): New method. (compiler compile): Handle sys:load-time-lit special form via comp-load-time-lit method. (compiler comp-load-time-lit): New method. (usr:compile-toplevel): Prepend the load-time assembly code fragments to the compiled assembly code. * vm.c (vm_set, vm_sm_set): Do not reject an attempt to modify the static data, since load-time now generates mov instructions targetting the d registers. * txr.1: Document load-time.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/vm.c b/vm.c
index f2dc3bd7..ed22cebb 100644
--- a/vm.c
+++ b/vm.c
@@ -322,9 +322,6 @@ INLINE void vm_set(struct vm_env *dspl, unsigned ref, val newval)
unsigned i = vm_idx(ref);
struct vm_env *env = &dspl[d];
- if (d == 1)
- uw_throwf(error_s, lit("modification of VM static data"), nao);
-
if (ref == 0)
uw_throwf(error_s, lit("modification of t00/nil"), nao);
@@ -340,9 +337,6 @@ INLINE void vm_sm_set(struct vm_env *dspl, unsigned ref, val newval)
unsigned i = vm_sm_idx(ref);
struct vm_env *env = &dspl[d];
- if (d == 1)
- uw_throwf(error_s, lit("modification of VM static data"), nao);
-
if (ref == 0)
uw_throwf(error_s, lit("modification of t00/nil"), nao);