@Override public Instr clone(CloneInfo ii) { return new DefineInstanceMethodInstr(method); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getMethod()); }
@Override public String toString() { return getOperation() + "(" + container + ", " + method.getName() + ", " + method.getFileName() + ")"; }
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); case DEF_MODULE: return DefineModuleInstr.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); case DEF_MODULE: return DefineModuleInstr.decode(this);
@Override public Instr clone(CloneInfo ii) { return new DefineInstanceMethodInstr(method); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getMethod()); }
@Override public String toString() { return getOperation() + "(" + container + ", " + method.getName() + ", " + method.getFileName() + ")"; }
@Override public Instr cloneForInlining(InlinerInfo ii) { // SSS FIXME: So, what happens to the method? return new DefineInstanceMethodInstr(container.cloneForInlining(ii), method); }
@Override public void DefineInstanceMethodInstr(DefineInstanceMethodInstr defineinstancemethodinstr) { IRMethod method = defineinstancemethodinstr.getMethod(); JVMVisitorMethodContext context = new JVMVisitorMethodContext(); IRBytecodeAdapter m = jvmMethod(); SkinnyMethodAdapter a = m.adapter; m.loadContext(); emitMethod(method, context); MethodType variable = context.getNativeSignature(-1); // always a variable arity handle assert(variable != null); String defSignature = pushHandlesForDef( context.getVariableName(), context.getSpecificName(), context.getNativeSignaturesExceptVariable(), variable, sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, IRScope.class, DynamicScope.class, IRubyObject.class), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, java.lang.invoke.MethodHandle.class, int.class, IRScope.class, DynamicScope.class, IRubyObject.class)); a.getstatic(jvm.clsData().clsName, context.getBaseName() + "_IRScope", ci(IRScope.class)); jvmLoadLocal(DYNAMIC_SCOPE); jvmMethod().loadSelf(); // add method a.invokestatic(p(IRRuntimeHelpers.class), "defCompiledInstanceMethod", defSignature); }
@Override public Instr cloneForInlining(InlinerInfo ii) { // SSS FIXME: So, what happens to the method? return new DefineInstanceMethodInstr(container.cloneForInlining(ii), method); }
@Override public void DefineInstanceMethodInstr(DefineInstanceMethodInstr defineinstancemethodinstr) { IRMethod method = defineinstancemethodinstr.getMethod(); JVMVisitorMethodContext context = new JVMVisitorMethodContext(); IRBytecodeAdapter m = jvmMethod(); SkinnyMethodAdapter a = m.adapter; m.loadContext(); emitMethod(method, context); MethodType variable = context.getNativeSignature(-1); // always a variable arity handle assert(variable != null); String defSignature = pushHandlesForDef( context.getVariableName(), context.getSpecificName(), context.getNativeSignaturesExceptVariable(), variable, sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, IRScope.class, DynamicScope.class, IRubyObject.class), sig(void.class, ThreadContext.class, java.lang.invoke.MethodHandle.class, java.lang.invoke.MethodHandle.class, int.class, IRScope.class, DynamicScope.class, IRubyObject.class)); a.getstatic(jvm.clsData().clsName, context.getBaseName() + "_IRScope", ci(IRScope.class)); jvmLoadLocal(DYNAMIC_SCOPE); jvmMethod().loadSelf(); // add method a.invokestatic(p(IRRuntimeHelpers.class), "defCompiledInstanceMethod", defSignature); }
public static DefineInstanceMethodInstr decode(IRReaderDecoder d) { return new DefineInstanceMethodInstr((IRMethod) d.decodeScope()); }
@Override public void DefineInstanceMethodInstr(DefineInstanceMethodInstr defineinstancemethodinstr) { IRMethod method = defineinstancemethodinstr.getMethod(); StaticScope scope = method.getStaticScope(); if (scope.getRequiredArgs() > 3 || scope.getRestArg() >= 0 || scope.getOptionalArgs() != 0) {
public static DefineInstanceMethodInstr decode(IRReaderDecoder d) { return new DefineInstanceMethodInstr((IRMethod) d.decodeScope()); }
@Override public void DefineInstanceMethodInstr(DefineInstanceMethodInstr defineinstancemethodinstr) { IRMethod method = defineinstancemethodinstr.getMethod(); StaticScope scope = method.getStaticScope(); if (scope.getRequiredArgs() > 3 || scope.getRestArg() >= 0 || scope.getOptionalArgs() != 0) {
public Operand buildDefn(MethodDefNode node) { // Instance method IRMethod method = defineNewMethod(node, true); addInstr(new DefineInstanceMethodInstr(method)); return new Symbol(node.getName()); }
public Operand buildDefn(MethodDefNode node) { // Instance method IRMethod method = defineNewMethod(node, true); addInstr(new DefineInstanceMethodInstr(method)); return new Symbol(node.getName()); }
public Operand buildDefn(MethodDefNode node, IRScope s) { // Instance method IRMethod method = defineNewMethod(node, s, true); s.addInstr(new DefineInstanceMethodInstr(new StringLiteral("--unused--"), method)); return manager.getNil(); }
public Operand buildDefn(MethodDefNode node, IRScope s) { // Instance method IRMethod method = defineNewMethod(node, s, true); s.addInstr(new DefineInstanceMethodInstr(new StringLiteral("--unused--"), method)); return manager.getNil(); }