コード例 #1
0
ファイル: code_blocks.cpp プロジェクト: erg/factor
/* References to undefined symbols are patched up to call this function on
image load. It finds the symbol and library, and throws an error. */
void factor_vm::undefined_symbol()
{
	stack_frame *frame = innermost_stack_frame(ctx->callstack_bottom,
		ctx->callstack_top);
	code_block *compiled = frame_code(frame);
	cell return_address = (cell)FRAME_RETURN_ADDRESS(frame, this);
	find_symbol_at_address_visitor visitor(this, return_address);
	compiled->each_instruction_operand(visitor);
	if (!to_boolean(visitor.symbol))
		critical_error("Can't find RT_DLSYM at return address", return_address);
	else
		general_error(ERROR_UNDEFINED_SYMBOL,visitor.symbol,visitor.library);
}
コード例 #2
0
ファイル: callstack.cpp プロジェクト: william42/factor
void factor_vm::primitive_set_innermost_stack_frame_quot()
{
	data_root<callstack> callstack(ctx->pop(),this);
	data_root<quotation> quot(ctx->pop(),this);

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

	jit_compile_quot(quot.value(),true);

	stack_frame *inner = innermost_stack_frame(callstack.untagged());
	cell offset = (char *)FRAME_RETURN_ADDRESS(inner,this) - (char *)inner->entry_point;
	inner->entry_point = quot->entry_point;
	FRAME_RETURN_ADDRESS(inner,this) = (char *)quot->entry_point + offset;
}
コード例 #3
0
ファイル: callstack.cpp プロジェクト: alaricsp/factor
stack_frame *innermost_stack_frame_quot(callstack *callstack)
{
	stack_frame *inner = innermost_stack_frame(callstack);
	tagged<quotation>(frame_executing(inner)).untag_check();
	return inner;
}
コード例 #4
0
ファイル: callstack.cpp プロジェクト: william42/factor
void factor_vm::primitive_innermost_stack_frame_scan()
{
	stack_frame *frame = innermost_stack_frame(untag_check<callstack>(ctx->pop()));
	ctx->push(frame_scan(frame));
}
コード例 #5
0
ファイル: callstack.cpp プロジェクト: william42/factor
/* Some primitives implementing a limited form of callstack mutation.
Used by the single stepper. */
void factor_vm::primitive_innermost_stack_frame_executing()
{
	stack_frame *frame = innermost_stack_frame(untag_check<callstack>(ctx->pop()));
	ctx->push(frame_executing_quot(frame));
}
コード例 #6
0
ファイル: callstack.cpp プロジェクト: chris-ream/factor
/* Some primitives implementing a limited form of callstack mutation.
Used by the single stepper. */
void factor_vm::primitive_innermost_stack_frame_executing()
{
	dpush(frame_executing(innermost_stack_frame(untag_check<callstack>(dpop()))));
}
コード例 #7
0
/* Some primitives implementing a limited form of callstack mutation.
Used by the single stepper. */
inline void factorvm::vmprim_innermost_stack_frame_executing()
{
	dpush(frame_executing(innermost_stack_frame(untag_check<callstack>(dpop()))));
}