예제 #1
0
 @Override
 public Instr cloneForInlining(InlinerInfo ii) {
   return new ToAryInstr(
       (Variable) result.cloneForInlining(ii),
       array.cloneForInlining(ii),
       (BooleanLiteral) dontToAryArrays.cloneForInlining(ii));
 }
예제 #2
0
 @Override
 public Instr cloneForInlining(InlinerInfo ii) {
   Operand receiver = getReceiver();
   if (this.implMethod == JRubyImplementationMethod.CHECK_ARITY) {
     Operand[] args = getCallArgs();
     int required = ((Fixnum) args[0]).value.intValue();
     int opt = ((Fixnum) args[1]).value.intValue();
     int rest = ((Fixnum) args[2]).value.intValue();
     int numArgs = ii.getArgsCount();
     if ((numArgs < required) || ((rest == -1) && (numArgs > (required + opt)))) {
       // Argument error! Throw it at runtime
       return new JRubyImplCallInstr(
           null,
           JRubyImplementationMethod.RAISE_ARGUMENT_ERROR,
           null,
           new Operand[] {args[0], args[1], args[2], new Fixnum((long) numArgs)});
     } else {
       return null;
     }
   } else {
     return new JRubyImplCallInstr(
         result == null ? null : ii.getRenamedVariable(result),
         this.implMethod,
         receiver == null ? null : receiver.cloneForInlining(ii),
         cloneCallArgs(ii),
         closure == null ? null : closure.cloneForInlining(ii));
   }
 }
 @Override
 public Instr cloneForInlinedScope(InlinerInfo ii) {
   return new ModuleVersionGuardInstr(
       module,
       expectedVersion,
       candidateObj.cloneForInlining(ii),
       ii.getRenamedLabel(failurePathLabel));
 }
예제 #4
0
 public Instr cloneForInlining(InlinerInfo ii) {
   return new RescueEQQInstr(
       ii.getRenamedVariable(result), arg1.cloneForInlining(ii), arg2.cloneForInlining(ii));
 }
예제 #5
0
 @Override
 public Instr cloneForInlining(InlinerInfo ii) {
   return new IsTrueInstr(ii.getRenamedVariable(result), value.cloneForInlining(ii));
 }
예제 #6
0
 public Instr cloneForInlining(InlinerInfo ii) {
   return new MethodLookupInstr(
       ii.getRenamedVariable(result), (MethodHandle) methodHandle.cloneForInlining(ii));
 }