}
}
-void factor_vm::set_quot_entry_point(quotation *quot, code_block *code)
-{
- quot->code = code;
- quot->entry_point = code->entry_point();
-}
-
/* Allocates memory */
code_block *factor_vm::jit_compile_quot(cell owner_, cell quot_, bool relocating)
{
if(!quot_compiled_p(quot.untagged()))
{
code_block *compiled = jit_compile_quot(quot.value(),quot.value(),relocating);
- set_quot_entry_point(quot.untagged(),compiled);
+ quot.untagged()->entry_point = compiled->entry_point();
}
}
jit_compile_quot(ctx->pop(),true);
}
-code_block *factor_vm::lazy_jit_compile_block()
+void *factor_vm::lazy_jit_compile_entry_point()
{
- return untag<word>(special_objects[LAZY_JIT_COMPILE_WORD])->code;
+ return untag<word>(special_objects[LAZY_JIT_COMPILE_WORD])->entry_point;
}
/* push a new quotation on the stack */
quot->array = ctx->peek();
quot->cached_effect = false_object;
quot->cache_counter = false_object;
- set_quot_entry_point(quot,lazy_jit_compile_block());
+ quot->entry_point = lazy_jit_compile_entry_point();
ctx->replace(tag<quotation>(quot));
}
{
quotation *quot = untag_check<quotation>(ctx->pop());
- ctx->push(from_unsigned_cell((cell)quot->code->entry_point()));
- ctx->push(from_unsigned_cell((cell)quot->code + quot->code->size()));
+ ctx->push(from_unsigned_cell((cell)quot->entry_point));
+ ctx->push(from_unsigned_cell((cell)quot->code() + quot->code()->size()));
}
/* Allocates memory */
assert(!quot_compiled_p(quot.untagged()));
code_block *compiled = jit_compile_quot(quot.value(),quot.value(),true);
- set_quot_entry_point(quot.untagged(),compiled);
+ quot.untagged()->entry_point = compiled->entry_point();
return quot.value();
}
bool factor_vm::quot_compiled_p(quotation *quot)
{
- return quot->code != NULL && quot->code != lazy_jit_compile_block();
+ return quot->entry_point != NULL && quot->entry_point != lazy_jit_compile_entry_point();
}
void factor_vm::primitive_quot_compiled_p()
for(cell i = 0; i < length; i++)
{
data_root<quotation> quot(array_nth(quotations.untagged(),i),this);
- if(!quot->code)
- set_quot_entry_point(quot.untagged(),lazy_jit_compile_block());
+ if(!quot->entry_point)
+ quot.untagged()->entry_point = lazy_jit_compile_entry_point();
}
}