print_obj(callframe);
fprintf(stderr,"\n");
fprintf(stderr,"*** Executing:\n");
- print_word(executing);
+ print_obj(executing);
fprintf(stderr,"\n");
fflush(stderr);
}
/* the bignum 0 1 -1 constants must be the next three */
copy_bignum_constants();
copy_object(&callframe);
+ copy_object(&executing);
for(ptr = ds_bot; ptr <= ds; ptr += CELLS)
copy_object((void*)ptr);
untag_word(obj)->allot_count += a;
}
- executing->allot_count += a;
+ if(in_zone(&prior,executing))
+ critical_error("executing in prior zone",executing);
+ untag_word_fast(executing)->allot_count += a;
}
void flip_zones()
for(i = 0; i < USER_ENV; i++)
userenv[i] = F;
profile_depth = 0;
+ executing = F;
}
-#define EXECUTE(w) ((XT)(w->xt))()
+#define EXECUTE(w) ((XT)(untag_word_fast(w)->xt))()
void run(void)
{
if(TAG(next) == WORD_TYPE)
{
- executing = (F_WORD*)UNTAG(next);
+ executing = next;
EXECUTE(executing);
}
else
/* XT of deferred words */
void undefined()
{
- general_error(ERROR_UNDEFINED_WORD,tag_word(executing));
+ general_error(ERROR_UNDEFINED_WORD,executing);
}
/* XT of compound definitions */
void docol(void)
{
- call(executing->parameter);
+ call(untag_word_fast(executing)->parameter);
}
/* pushes word parameter */
void dosym(void)
{
- dpush(executing->parameter);
+ dpush(untag_word_fast(executing)->parameter);
}
void primitive_execute(void)
{
- executing = untag_word(dpop());
+ type_check(WORD_TYPE,dpeek());
+ executing = dpop();
EXECUTE(executing);
}
/* TAGGED currently executing quotation */
CELL callframe;
-/* raw pointer to currently executing word */
-F_WORD* executing;
+/* TAGGED pointer to currently executing word */
+CELL executing;
/* TAGGED user environment data; see getenv/setenv prims */
CELL userenv[USER_ENV];
/* tail call optimization */
if(callframe != F)
{
- cpush(tag_word(executing));
+ cpush(executing);
cpush(callframe);
}
callframe = quot;
untag_word(obj)->call_count++;
}
- executing->call_count++;
+ untag_word_fast(executing)->call_count++;
}
void init_signals(void)
CELL allot_count;
} F_WORD;
+INLINE F_WORD* untag_word_fast(CELL tagged)
+{
+ return (F_WORD*)UNTAG(tagged);
+}
+
INLINE F_WORD* untag_word(CELL tagged)
{
type_check(WORD_TYPE,tagged);
- return (F_WORD*)UNTAG(tagged);
+ return untag_word_fast(tagged);
}
INLINE CELL tag_word(F_WORD* word)