Skip to content

Commit

Permalink
Remove some unused internal parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Oct 20, 2014
1 parent 4e3a4e2 commit 9c391cf
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Expand Up @@ -54,7 +54,7 @@ public static void dumpStats() {
}
}

private static IRScope getEvalContainerScope(StaticScope evalScope, EvalType evalType) {
private static IRScope getEvalContainerScope(StaticScope evalScope) {
// We cannot get the containing IR scope from evalScope because of static-scope wrapping
// that is going on.
// 1. In all cases, DynamicScope.getEvalScope wraps the executing static scope in a new local scope.
Expand All @@ -76,7 +76,7 @@ private static IRScope getEvalContainerScope(StaticScope evalScope, EvalType eva

public static IRubyObject interpretCommonEval(Ruby runtime, String file, int lineNumber, String backtraceName, RootNode rootNode, IRubyObject self, Block block, EvalType evalType) {
StaticScope ss = rootNode.getStaticScope();
IRScope containingIRScope = getEvalContainerScope(ss, evalType);
IRScope containingIRScope = getEvalContainerScope(ss);
IREvalScript evalScript = IRBuilder.createIRBuilder(runtime, runtime.getIRManager()).buildEvalRoot(ss, containingIRScope, file, lineNumber, rootNode, evalType);
// ClosureInterpreterContext never retrieved as an operand in this context.
// So, self operand is not required here.
Expand Down Expand Up @@ -217,11 +217,11 @@ private static void setFixnumVar(long[] fixnums, TemporaryLocalVariable var, lon
fixnums[var.offset] = val;
}

private static void setBooleanVar(ThreadContext context, boolean[] booleans, TemporaryLocalVariable var, boolean val) {
private static void setBooleanVar(boolean[] booleans, TemporaryLocalVariable var, boolean val) {
booleans[var.offset] = val;
}

private static void interpretIntOp(AluInstr instr, Operation op, ThreadContext context, long[] fixnums, boolean[] booleans, Object[] temp) {
private static void interpretIntOp(AluInstr instr, Operation op, long[] fixnums, boolean[] booleans) {
TemporaryLocalVariable dst = (TemporaryLocalVariable)instr.getResult();
long i1 = getFixnumArg(fixnums, instr.getArg1());
long i2 = getFixnumArg(fixnums, instr.getArg2());
Expand All @@ -235,14 +235,14 @@ private static void interpretIntOp(AluInstr instr, Operation op, ThreadContext c
case IXOR: setFixnumVar(fixnums, dst, i1 ^ i2); break;
case ISHL: setFixnumVar(fixnums, dst, i1 << i2); break;
case ISHR: setFixnumVar(fixnums, dst, i1 >> i2); break;
case ILT : setBooleanVar(context, booleans, dst, i1 < i2); break;
case IGT : setBooleanVar(context, booleans, dst, i1 > i2); break;
case IEQ : setBooleanVar(context, booleans, dst, i1 == i2); break;
case ILT : setBooleanVar(booleans, dst, i1 < i2); break;
case IGT : setBooleanVar(booleans, dst, i1 > i2); break;
case IEQ : setBooleanVar(booleans, dst, i1 == i2); break;
default: throw new RuntimeException("Unhandled int op: " + op + " for instr " + instr);
}
}

private static void interpretFloatOp(AluInstr instr, Operation op, ThreadContext context, double[] floats, boolean[] booleans, Object[] temp) {
private static void interpretFloatOp(AluInstr instr, Operation op, double[] floats, boolean[] booleans) {
TemporaryLocalVariable dst = (TemporaryLocalVariable)instr.getResult();
double a1 = getFloatArg(floats, instr.getArg1());
double a2 = getFloatArg(floats, instr.getArg2());
Expand All @@ -251,9 +251,9 @@ private static void interpretFloatOp(AluInstr instr, Operation op, ThreadContext
case FSUB: setFloatVar(floats, dst, a1 - a2); break;
case FMUL: setFloatVar(floats, dst, a1 * a2); break;
case FDIV: setFloatVar(floats, dst, a1 / a2); break;
case FLT : setBooleanVar(context, booleans, dst, a1 < a2); break;
case FGT : setBooleanVar(context, booleans, dst, a1 > a2); break;
case FEQ : setBooleanVar(context, booleans, dst, a1 == a2); break;
case FLT : setBooleanVar(booleans, dst, a1 < a2); break;
case FGT : setBooleanVar(booleans, dst, a1 > a2); break;
case FEQ : setBooleanVar(booleans, dst, a1 == a2); break;
default: throw new RuntimeException("Unhandled float op: " + op + " for instr " + instr);
}
}
Expand Down Expand Up @@ -286,7 +286,6 @@ private static void receiveArg(ThreadContext context, Instr i, Operation operati
default:
result = ((ReceiveArgBase)instr).receiveArg(context, args, acceptsKeywordArgument);
setResult(temp, currDynScope, instr.getResult(), result);
return;
}
}

Expand Down Expand Up @@ -344,7 +343,7 @@ private static void processCall(ThreadContext context, Instr instr, Operation op

private static void processBookKeepingOp(ThreadContext context, Instr instr, Operation operation,
String name, IRubyObject[] args, IRubyObject self, Block block,
RubyModule implClass, Visibility visibility, Object[] temp, DynamicScope currDynamicScope) {
RubyModule implClass, Visibility visibility) {
switch(operation) {
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
Expand Down Expand Up @@ -564,10 +563,10 @@ private static IRubyObject interpret(ThreadContext context, IRubyObject self,
try {
switch (operation.opClass) {
case INT_OP:
interpretIntOp((AluInstr) instr, operation, context, fixnums, booleans, temp);
interpretIntOp((AluInstr) instr, operation, fixnums, booleans);
break;
case FLOAT_OP:
interpretFloatOp((AluInstr)instr, operation, context, floats, booleans, temp);
interpretFloatOp((AluInstr) instr, operation, floats, booleans);
break;
case ARG_OP:
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, block);
Expand All @@ -589,7 +588,7 @@ private static IRubyObject interpret(ThreadContext context, IRubyObject self,
currDynScope = getNewDynScope(context, scope, currScope);
context.pushScope(currDynScope);
} else {
processBookKeepingOp(context, instr, operation, name, args, self, block, implClass, visibility, temp, currDynScope);
processBookKeepingOp(context, instr, operation, name, args, self, block, implClass, visibility);
}
break;
case OTHER_OP:
Expand Down

0 comments on commit 9c391cf

Please sign in to comment.