@Override public void Filename(Filename filename) { jvmMethod().loadContext(); jvmMethod().loadStaticScope(); jvmMethod().invokeIRHelper("getFileNameStringFromScope", sig(RubyString.class, ThreadContext.class, StaticScope.class)); }
@Override public void AliasInstr(AliasInstr aliasInstr) { IRBytecodeAdapter m = jvm.method(); m.loadContext(); m.loadSelf(); jvmLoadLocal(DYNAMIC_SCOPE); visit(aliasInstr.getNewName()); visit(aliasInstr.getOldName()); m.invokeIRHelper("defineAlias", sig(void.class, ThreadContext.class, IRubyObject.class, DynamicScope.class, IRubyObject.class, IRubyObject.class)); }
@Override public void RecordEndBlockInstr(RecordEndBlockInstr recordEndBlockInstr) { jvmMethod().loadContext(); jvmMethod().loadContext(); visit(recordEndBlockInstr.getEndBlockClosure()); jvmMethod().invokeIRHelper("getBlockFromObject", sig(Block.class, ThreadContext.class, Object.class)); jvmMethod().invokeIRHelper("pushExitBlock", sig(void.class, ThreadContext.class, Block.class)); }
@Override public void AliasInstr(AliasInstr aliasInstr) { IRBytecodeAdapter m = jvm.method(); m.loadContext(); m.loadSelf(); jvmLoadLocal(DYNAMIC_SCOPE); visit(aliasInstr.getNewName()); visit(aliasInstr.getOldName()); m.invokeIRHelper("defineAlias", sig(void.class, ThreadContext.class, IRubyObject.class, DynamicScope.class, IRubyObject.class, IRubyObject.class)); }
@Override public void RecordEndBlockInstr(RecordEndBlockInstr recordEndBlockInstr) { jvmMethod().loadContext(); jvmMethod().loadContext(); visit(recordEndBlockInstr.getEndBlockClosure()); jvmMethod().invokeIRHelper("getBlockFromObject", sig(Block.class, ThreadContext.class, Object.class)); jvmMethod().invokeIRHelper("pushExitBlock", sig(void.class, ThreadContext.class, Block.class)); }
@Override public void ReifyClosureInstr(ReifyClosureInstr reifyclosureinstr) { jvmMethod().loadRuntime(); jvmLoadLocal("$blockArg"); jvmMethod().invokeIRHelper("newProc", sig(IRubyObject.class, Ruby.class, Block.class)); jvmStoreLocal(reifyclosureinstr.getResult()); }
private void compileCallCommon(IRBytecodeAdapter m, CallBase call) { Operand[] args = call.getCallArgs(); BlockPassType blockPassType = BlockPassType.fromIR(call); m.loadContext(); m.adapter.invokevirtual(p(RubyArray.class), "toJavaArray", sig(IRubyObject[].class)); arity = -1; } else if (CallBase.containsArgSplat(args)) { m.loadContext(); visit(call.getClosureArg()); m.invokeIRHelper("getBlockFromObject", sig(Block.class, ThreadContext.class, Object.class));
@Override public void Filename(Filename filename) { jvmMethod().loadContext(); jvmMethod().loadStaticScope(); jvmMethod().invokeIRHelper("getFileNameStringFromScope", sig(RubyString.class, ThreadContext.class, StaticScope.class)); }
@Override public void ReifyClosureInstr(ReifyClosureInstr reifyclosureinstr) { jvmMethod().loadRuntime(); jvmLoadLocal("$blockArg"); jvmMethod().invokeIRHelper("newProc", sig(IRubyObject.class, Ruby.class, Block.class)); jvmStoreLocal(reifyclosureinstr.getResult()); }
private void compileCallCommon(IRBytecodeAdapter m, CallBase call) { Operand[] args = call.getCallArgs(); BlockPassType blockPassType = BlockPassType.fromIR(call); m.loadContext(); m.adapter.invokevirtual(p(RubyArray.class), "toJavaArray", sig(IRubyObject[].class)); arity = -1; } else if (CallBase.containsArgSplat(args)) { m.loadContext(); visit(call.getClosureArg()); m.invokeIRHelper("getBlockFromObject", sig(Block.class, ThreadContext.class, Object.class));
@Override public void NthRef(NthRef nthref) { jvmMethod().loadContext(); jvmAdapter().pushInt(nthref.matchNumber); jvmMethod().invokeIRHelper("nthMatch", sig(IRubyObject.class, ThreadContext.class, int.class)); }
@Override public void UnboxFloatInstr(UnboxFloatInstr instr) { // Load boxed value visit(instr.getValue()); // Unbox it jvmMethod().invokeIRHelper("unboxFloat", sig(double.class, IRubyObject.class)); // Store it jvmStoreLocal(instr.getResult()); }
@Override public void NthRef(NthRef nthref) { jvmMethod().loadContext(); jvmAdapter().pushInt(nthref.matchNumber); jvmMethod().invokeIRHelper("nthMatch", sig(IRubyObject.class, ThreadContext.class, int.class)); }
@Override public void UnboxBooleanInstr(UnboxBooleanInstr instr) { // Load boxed value visit(instr.getValue()); // Unbox it jvmMethod().invokeIRHelper("unboxBoolean", sig(boolean.class, IRubyObject.class)); // Store it jvmStoreLocal(instr.getResult()); }
@Override public void PrepareSingleBlockArgInstr(PrepareSingleBlockArgInstr instr) { jvmMethod().loadContext(); jvmMethod().loadSelfBlock(); jvmMethod().loadArgs(); jvmMethod().invokeIRHelper("prepareSingleBlockArgs", sig(IRubyObject[].class, ThreadContext.class, Block.class, IRubyObject[].class)); jvmMethod().storeArgs(); }
@Override public void UnboxBooleanInstr(UnboxBooleanInstr instr) { // Load boxed value visit(instr.getValue()); // Unbox it jvmMethod().invokeIRHelper("unboxBoolean", sig(boolean.class, IRubyObject.class)); // Store it jvmStoreLocal(instr.getResult()); }
@Override public void PrepareFixedBlockArgsInstr(PrepareFixedBlockArgsInstr instr) { jvmMethod().loadContext(); jvmMethod().loadSelfBlock(); jvmMethod().loadArgs(); jvmMethod().invokeIRHelper("prepareFixedBlockArgs", sig(IRubyObject[].class, ThreadContext.class, Block.class, IRubyObject[].class)); jvmMethod().storeArgs(); }
@Override public void UnboxFixnumInstr(UnboxFixnumInstr instr) { // Load boxed value visit(instr.getValue()); // Unbox it jvmMethod().invokeIRHelper("unboxFixnum", sig(long.class, IRubyObject.class)); // Store it jvmStoreLocal(instr.getResult()); }