@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); }
@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); }
@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 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); }