Esempio n. 1
0
/* Compile a word definition with the non-optimizing compiler. Allocates memory */
void factor_vm::jit_compile_word(cell word_, cell def_, bool relocate)
{
	gc_root<word> word(word_,this);
	gc_root<quotation> def(def_,this);

	jit_compile(def.value(),relocate);

	word->code = def->code;

	if(to_boolean(word->pic_def)) jit_compile(word->pic_def,relocate);
	if(to_boolean(word->pic_tail_def)) jit_compile(word->pic_tail_def,relocate);
}
Esempio n. 2
0
void factor_vm::primitive_set_innermost_stack_frame_quot()
{
	gc_root<callstack> callstack(dpop(),this);
	gc_root<quotation> quot(dpop(),this);

	callstack.untag_check(this);
	quot.untag_check(this);

	jit_compile(quot.value(),true);

	stack_frame *inner = innermost_stack_frame_quot(callstack.untagged());
	cell offset = (char *)FRAME_RETURN_ADDRESS(inner,this) - (char *)inner->xt;
	inner->xt = quot->xt;
	FRAME_RETURN_ADDRESS(inner,this) = (char *)quot->xt + offset;
}
Esempio n. 3
0
int main(int argc, char *argv[]) {
  JIT_FUNCTION codes = jit_compile("++++++++---++");
  printf("result: %d\n", codes());

  return 0;
}
Esempio n. 4
0
int main() {
  Xbyak::CodeGenerator gen(20000);
  const JIT_FUNCTION codes = jit_compile(gen, "++++++++---++");
  printf("result: %d\n", codes());
  return 0;
}