@Override public Instr clone(CloneInfo ii) { return new ConstMissingInstr(ii.getScope(), ii.getRenamedVariable(result), getReceiver().cloneForInlining(ii), missingConst, cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
@Override public void encode(IRWriterEncoder e) { if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("Instr(" + getOperation() + "): " + this); e.encode(getOperation()); e.encode(getResult()); e.encode(getReceiver()); e.encode(getMissingConst()); }
@Override public void ConstMissingInstr(ConstMissingInstr constmissinginstr) { visit(constmissinginstr.getReceiver()); jvmAdapter().checkcast("org/jruby/RubyModule"); jvmMethod().loadContext(); jvmAdapter().ldc("const_missing"); jvmMethod().pushSymbol(constmissinginstr.getMissingConst().getBytes()); jvmMethod().invokeVirtual(Type.getType(RubyModule.class), Method.getMethod("org.jruby.runtime.builtin.IRubyObject callMethod(org.jruby.runtime.ThreadContext, java.lang.String, org.jruby.runtime.builtin.IRubyObject)")); jvmStoreLocal(constmissinginstr.getResult()); }
@Override public void ConstMissingInstr(ConstMissingInstr constmissinginstr) { visit(constmissinginstr.getReceiver()); jvm.method().adapter.checkcast("org/jruby/RubyModule"); jvm.method().loadContext(); jvm.method().adapter.ldc("const_missing"); jvm.method().pushSymbol(constmissinginstr.getMissingConst()); jvm.method().invokeVirtual(Type.getType(RubyModule.class), Method.getMethod("org.jruby.runtime.builtin.IRubyObject callMethod(org.jruby.runtime.ThreadContext, java.lang.String, org.jruby.runtime.builtin.IRubyObject)")); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new ConstMissingInstr(ii.getRenamedVariable(result), receiver.cloneForInlining(ii), missingConst); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { RubyModule module = (RubyModule) getReceiver().retrieve(context, self, currScope, currDynScope, temp); return module.callMethod(context, "const_missing", missingConst); }
case CLASS_SUPER: return ClassSuperInstr.decode(this); case CLASS_VAR_MODULE: return GetClassVarContainerModuleInstr.decode(this); case CONST_MISSING: return ConstMissingInstr.decode(this); case COPY: return CopyInstr.decode(this); case DEF_CLASS: return DefineClassInstr.decode(this);
@Override public void ConstMissingInstr(ConstMissingInstr constmissinginstr) { visit(constmissinginstr.getReceiver()); jvmAdapter().checkcast("org/jruby/RubyModule"); jvmMethod().loadContext(); jvmAdapter().ldc("const_missing"); jvmMethod().pushSymbol(constmissinginstr.getMissingConst().getBytes()); jvmMethod().invokeVirtual(Type.getType(RubyModule.class), Method.getMethod("org.jruby.runtime.builtin.IRubyObject callMethod(org.jruby.runtime.ThreadContext, java.lang.String, org.jruby.runtime.builtin.IRubyObject)")); jvmStoreLocal(constmissinginstr.getResult()); }
@Override public void ConstMissingInstr(ConstMissingInstr constmissinginstr) { visit(constmissinginstr.getReceiver()); jvm.method().adapter.checkcast("org/jruby/RubyModule"); jvm.method().loadContext(); jvm.method().adapter.ldc("const_missing"); jvm.method().pushSymbol(constmissinginstr.getMissingConst()); jvm.method().invokeVirtual(Type.getType(RubyModule.class), Method.getMethod("org.jruby.runtime.builtin.IRubyObject callMethod(org.jruby.runtime.ThreadContext, java.lang.String, org.jruby.runtime.builtin.IRubyObject)")); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new ConstMissingInstr(ii.getRenamedVariable(result), receiver.cloneForInlining(ii), missingConst); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { RubyModule module = (RubyModule) getReceiver().retrieve(context, self, currScope, currDynScope, temp); return module.callMethod(context, "const_missing", missingConst); }
case CLASS_SUPER: return ClassSuperInstr.decode(this); case CLASS_VAR_MODULE: return GetClassVarContainerModuleInstr.decode(this); case CONST_MISSING: return ConstMissingInstr.decode(this); case COPY: return CopyInstr.decode(this); case DEF_CLASS: return DefineClassInstr.decode(this);
@Override public Instr clone(CloneInfo ii) { return new ConstMissingInstr(ii.getScope(), ii.getRenamedVariable(result), getReceiver().cloneForInlining(ii), missingConst, cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
@Override public void encode(IRWriterEncoder e) { if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("Instr(" + getOperation() + "): " + this); e.encode(getOperation()); e.encode(getResult()); e.encode(getReceiver()); e.encode(getMissingConst()); }
public static ConstMissingInstr decode(IRReaderDecoder d) { return new ConstMissingInstr(d.getCurrentScope(), d.decodeVariable(), d.decodeOperand(), d.decodeSymbol(), d.getCurrentScope().maybeUsingRefinements()); }
public static ConstMissingInstr decode(IRReaderDecoder d) { return new ConstMissingInstr(d.getCurrentScope(), d.decodeVariable(), d.decodeOperand(), d.decodeSymbol(), d.getCurrentScope().maybeUsingRefinements()); }
private void genInheritanceSearchInstrs(IRScope s, Operand startingModule, Variable constVal, Label foundLabel, boolean noPrivateConstants, String name) { s.addInstr(new InheritanceSearchConstInstr(constVal, startingModule, name, noPrivateConstants)); s.addInstr(BNEInstr.create(constVal, UndefinedValue.UNDEFINED, foundLabel)); s.addInstr(new ConstMissingInstr(constVal, startingModule, name)); s.addInstr(new LabelInstr(foundLabel)); }
private void genInheritanceSearchInstrs(IRScope s, Operand startingModule, Variable constVal, Label foundLabel, boolean noPrivateConstants, String name) { s.addInstr(new InheritanceSearchConstInstr(constVal, startingModule, name, noPrivateConstants)); s.addInstr(BNEInstr.create(constVal, UndefinedValue.UNDEFINED, foundLabel)); s.addInstr(new ConstMissingInstr(constVal, startingModule, name)); s.addInstr(new LabelInstr(foundLabel)); }