public void Fixnum(Fixnum fixnum) { print(fixnum.getValue()); } public void FrozenString(FrozenString frozen) { print(frozen.getByteList()); }
public void Fixnum(Fixnum fixnum) { print(fixnum.getValue()); } public void FrozenString(FrozenString frozen) { print(frozen.getByteList()); }
@Override public void Fixnum(Fixnum fixnum) { jvmMethod().pushFixnum(fixnum.getValue()); }
@Override public void Fixnum(Fixnum fixnum) { jvm.method().pushFixnum(fixnum.getValue()); }
@Override public void Fixnum(Fixnum fixnum) { jvmMethod().pushFixnum(fixnum.getValue()); }
@Override public void Fixnum(Fixnum fixnum) { jvm.method().pushFixnum(fixnum.getValue()); }
private Operand getUnboxedOperand(UnboxState state, Map<Variable, TemporaryLocalVariable> unboxMap, Operand arg) { if (arg instanceof Variable) { Variable v = (Variable)arg; Class unboxedType = state.unboxedVars.get(v); return unboxedType == null ? arg : getUnboxedVar(unboxedType, unboxMap, v); } else if (arg instanceof Float) { return new UnboxedFloat(((Float)arg).getValue()); } else if (arg instanceof Fixnum) { return new UnboxedFixnum(((Fixnum)arg).getValue()); } else if (arg instanceof Boolean) { return new UnboxedBoolean(((Boolean)arg).isTrue()); } // This has to be a known operand like (UnboxedBoolean, etc.) return arg; }
private Operand getUnboxedOperand(UnboxState state, Map<Variable, TemporaryLocalVariable> unboxMap, Operand arg) { if (arg instanceof Variable) { Variable v = (Variable)arg; Class unboxedType = state.unboxedVars.get(v); return unboxedType == null ? arg : getUnboxedVar(unboxedType, unboxMap, v); } else if (arg instanceof Float) { return new UnboxedFloat(((Float)arg).getValue()); } else if (arg instanceof Fixnum) { return new UnboxedFixnum(((Fixnum)arg).getValue()); } else if (arg instanceof Boolean) { return new UnboxedBoolean(((Boolean)arg).isTrue()); } // This has to be a known operand like (UnboxedBoolean, etc.) return arg; }
private Operand unboxOperand(UnboxState state, Class reqdType, Map<Variable, TemporaryLocalVariable> unboxMap, Operand arg, List<Instr> newInstrs) { if (arg instanceof Variable) { Variable v = (Variable)arg; boolean isUnboxed = state.unboxedVars.get(v) == reqdType; // Get a temp var for 'v' if we dont already have one TemporaryLocalVariable unboxedVar = getUnboxedVar(reqdType, unboxMap, v); // Unbox if 'v' is not already unboxed if (!isUnboxed) { unboxVar(state, reqdType, unboxMap, v, newInstrs); } return unboxedVar; } else if (arg instanceof Float) { return new UnboxedFloat(((Float)arg).getValue()); } else if (arg instanceof Fixnum) { return new UnboxedFixnum(((Fixnum)arg).getValue()); } else if (arg instanceof Boolean) { return new UnboxedBoolean(((Boolean)arg).isTrue()); } // This has to be a known operand like (UnboxedBoolean, etc.) return arg; }
private Operand unboxOperand(UnboxState state, Class reqdType, Map<Variable, TemporaryLocalVariable> unboxMap, Operand arg, List<Instr> newInstrs) { if (arg instanceof Variable) { Variable v = (Variable)arg; boolean isUnboxed = state.unboxedVars.get(v) == reqdType; // Get a temp var for 'v' if we dont already have one TemporaryLocalVariable unboxedVar = getUnboxedVar(reqdType, unboxMap, v); // Unbox if 'v' is not already unboxed if (!isUnboxed) { unboxVar(state, reqdType, unboxMap, v, newInstrs); } return unboxedVar; } else if (arg instanceof Float) { return new UnboxedFloat(((Float)arg).getValue()); } else if (arg instanceof Fixnum) { return new UnboxedFixnum(((Fixnum)arg).getValue()); } else if (arg instanceof Boolean) { return new UnboxedBoolean(((Boolean)arg).isTrue()); } // This has to be a known operand like (UnboxedBoolean, etc.) return arg; }
return IRRuntimeHelpers.isDefinedNthRef( context, (int) ((Fixnum) operands[0]).getValue(), (IRubyObject) operands[1].retrieve(context, self, currScope, currDynScope, temp)); case IS_DEFINED_GLOBAL:
return IRRuntimeHelpers.isDefinedNthRef( context, (int) ((Fixnum) operands[0]).getValue(), (IRubyObject) operands[1].retrieve(context, self, currScope, currDynScope, temp)); case IS_DEFINED_GLOBAL:
case IS_DEFINED_NTH_REF: jvmMethod().loadContext(); jvmAdapter().ldc((int)((Fixnum)runtimehelpercall.getArgs()[0]).getValue()); visit(runtimehelpercall.getArgs()[1]); jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "isDefinedNthRef", sig(IRubyObject.class, ThreadContext.class, int.class, IRubyObject.class));
case IS_DEFINED_NTH_REF: jvmMethod().loadContext(); jvmAdapter().ldc((int)((Fixnum)runtimehelpercall.getArgs()[0]).getValue()); visit(runtimehelpercall.getArgs()[1]); jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "isDefinedNthRef", sig(IRubyObject.class, ThreadContext.class, int.class, IRubyObject.class));