本文整理汇总了C++中CompiledCode::internalize方法的典型用法代码示例。如果您正苦于以下问题:C++ CompiledCode::internalize方法的具体用法?C++ CompiledCode::internalize怎么用?C++ CompiledCode::internalize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompiledCode
的用法示例。
在下文中一共展示了CompiledCode::internalize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: default_executor
Object* CompiledCode::default_executor(STATE, CallFrame* call_frame,
Executable* exec, Module* mod, Arguments& args)
{
LockableScopedLock lg(state, &state->shared(), __FILE__, __LINE__);
CompiledCode* code = as<CompiledCode>(exec);
if(code->execute == default_executor) {
const char* reason = 0;
int ip = -1;
OnStack<5> os(state, code, exec, mod, args.recv_location(), args.block_location());
VariableRootBuffer vrb(state->vm()->current_root_buffers(),
&args.arguments_location(), args.total());
GCTokenImpl gct;
if(!code->internalize(state, gct, call_frame, &reason, &ip)) {
Exception::bytecode_error(state, call_frame, code, ip, reason);
return 0;
}
}
lg.unlock();
return code->execute(state, call_frame, exec, mod, args);
}
示例2: constant_caches
Tuple* CompiledCode::constant_caches(STATE) {
CompiledCode* self = this;
OnStack<1> os(state, self);
if(self->machine_code() == NULL) {
if(!self->internalize(state)) return force_as<Tuple>(Primitives::failure());
}
MachineCode* mcode = self->machine_code();
return mcode->constant_caches(state);
}
示例3: default_executor
Object* CompiledCode::default_executor(STATE,
Executable* exec, Module* mod, Arguments& args)
{
CompiledCode* code = as<CompiledCode>(exec);
if(code->execute == default_executor) {
if(!code->internalize(state)) return 0;
}
return code->execute(state, exec, mod, args);
}
示例4: constant_caches
Tuple* CompiledCode::constant_caches(STATE, CallFrame* calling_environment) {
GCTokenImpl gct;
CompiledCode* self = this;
OnStack<1> os(state, self);
if(self->machine_code_ == NULL) {
if(!self->internalize(state, gct, calling_environment)) return force_as<Tuple>(Primitives::failure());
}
MachineCode* mcode = self->machine_code_;
return mcode->constant_caches(state);
}
示例5: set_breakpoint
Object* CompiledCode::set_breakpoint(STATE, GCToken gct, Fixnum* ip, Object* bp) {
CompiledCode* self = this;
OnStack<3> os(state, self, ip, bp);
int i = ip->to_native();
if(self->machine_code_ == NULL) {
if(!self->internalize(state, gct)) return Primitives::failure();
}
if(!self->machine_code_->validate_ip(state, i)) return Primitives::failure();
if(self->breakpoints_->nil_p()) {
self->breakpoints(state, LookupTable::create(state));
}
self->breakpoints_->store(state, ip, bp);
self->machine_code_->debugging = 1;
self->machine_code_->run = MachineCode::debugger_interpreter;
return ip;
}