@Override public Instr cloneForInlining(InlinerInfo ii) { // SSS FIXME: So, what happens to the method? return new DefineClassMethodInstr(container.cloneForInlining(ii), method); }
@Override public Instr clone(CloneInfo ii) { return new DefineClassMethodInstr(getContainer().cloneForInlining(ii), method); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getContainer()); e.encode(getMethod()); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { IRubyObject obj = (IRubyObject) getContainer().retrieve(context, self, currScope, currDynScope, temp); IRRuntimeHelpers.defInterpretedClassMethod(context, method, obj); return null; }
@Override public String toString() { return getOperation() + "(" + container + ", " + method.getName() + ", " + method.getFileName() + ")"; }
public Operand getContainer() { return getOperand1(); }
case COPY: return CopyInstr.decode(this); case DEF_CLASS: return DefineClassInstr.decode(this); case DEF_CLASS_METH: return DefineClassMethodInstr.decode(this); case DEF_INST_METH: return DefineInstanceMethodInstr.decode(this); case DEF_META_CLASS: return DefineMetaClassInstr.decode(this);
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { IRubyObject obj = (IRubyObject) getContainer().retrieve(context, self, currScope, currDynScope, temp); IRRuntimeHelpers.defInterpretedClassMethod(context, method, obj); return null; }
@Override public String toString() { return getOperation() + "(" + container + ", " + method.getName() + ", " + method.getFileName() + ")"; }
public Operand getContainer() { return getOperand1(); }
case COPY: return CopyInstr.decode(this); case DEF_CLASS: return DefineClassInstr.decode(this); case DEF_CLASS_METH: return DefineClassMethodInstr.decode(this); case DEF_INST_METH: return DefineInstanceMethodInstr.decode(this); case DEF_META_CLASS: return DefineMetaClassInstr.decode(this);
@Override public Instr cloneForInlining(InlinerInfo ii) { // SSS FIXME: So, what happens to the method? return new DefineClassMethodInstr(container.cloneForInlining(ii), method); }
@Override public Instr clone(CloneInfo ii) { return new DefineClassMethodInstr(getContainer().cloneForInlining(ii), method); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getContainer()); e.encode(getMethod()); }
public static DefineClassMethodInstr decode(IRReaderDecoder d) { return new DefineClassMethodInstr(d.decodeOperand(), (IRMethod) d.decodeScope()); }
@Override public void DefineClassMethodInstr(DefineClassMethodInstr defineclassmethodinstr) { IRMethod method = defineclassmethodinstr.getMethod(); jvmMethod().loadContext(); JVMVisitorMethodContext context = new JVMVisitorMethodContext(); emitMethod(method, context); String defSignature = pushHandlesForDef( context.getVariableName(), context.getSpecificName(), context.getNativeSignaturesExceptVariable(), METHOD_SIGNATURE_VARARGS.type(), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, IRScope.class, IRubyObject.class), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, java.lang.invoke.MethodHandle.class, int.class, IRScope.class, IRubyObject.class)); jvmAdapter().getstatic(jvm.clsData().clsName, context.getBaseName() + "_IRScope", ci(IRScope.class)); visit(defineclassmethodinstr.getContainer()); // add method jvmMethod().adapter.invokestatic(p(IRRuntimeHelpers.class), "defCompiledClassMethod", defSignature); }
public static DefineClassMethodInstr decode(IRReaderDecoder d) { return new DefineClassMethodInstr(d.decodeOperand(), (IRMethod) d.decodeScope()); }
@Override public void DefineClassMethodInstr(DefineClassMethodInstr defineclassmethodinstr) { IRMethod method = defineclassmethodinstr.getMethod(); jvmMethod().loadContext(); JVMVisitorMethodContext context = new JVMVisitorMethodContext(); emitMethod(method, context); String defSignature = pushHandlesForDef( context.getVariableName(), context.getSpecificName(), context.getNativeSignaturesExceptVariable(), METHOD_SIGNATURE_VARARGS.type(), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, IRScope.class, IRubyObject.class), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, java.lang.invoke.MethodHandle.class, int.class, IRScope.class, IRubyObject.class)); jvmAdapter().getstatic(jvm.clsData().clsName, context.getBaseName() + "_IRScope", ci(IRScope.class)); visit(defineclassmethodinstr.getContainer()); // add method jvmMethod().adapter.invokestatic(p(IRRuntimeHelpers.class), "defCompiledClassMethod", defSignature); }
public Operand buildDefs(DefsNode node, IRScope s) { // Class method Operand container = build(node.getReceiverNode(), s); IRMethod method = defineNewMethod(node, s, false); s.addInstr(new DefineClassMethodInstr(container, method)); return manager.getNil(); }
public Operand buildDefs(DefsNode node, IRScope s) { // Class method Operand container = build(node.getReceiverNode(), s); IRMethod method = defineNewMethod(node, s, false); s.addInstr(new DefineClassMethodInstr(container, method)); return manager.getNil(); }