Skip to content

Commit

Permalink
Showing 5 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
*/
public class BodyInterpreterEngine extends InterpreterEngine {
@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -78,7 +78,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -155,7 +155,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case RECV_RUBY_EXC: // NO INTERP
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), IRRuntimeHelpers.unwrapRubyException(exception));
@@ -213,7 +213,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject[] args, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, block, blockType);
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject[] args, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, blockArg, blockType);
}
}
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Original file line number Diff line number Diff line change
@@ -106,20 +106,20 @@ public static IRubyObject INTERPRET_ROOT(ThreadContext context, IRubyObject self
}

public static IRubyObject INTERPRET_EVAL(ThreadContext context, IRubyObject self,
InterpreterContext ic, RubyModule clazz, IRubyObject[] args, String name, Block block, Block.Type blockType) {
InterpreterContext ic, RubyModule clazz, IRubyObject[] args, String name, Block blockArg, Block.Type blockType) {
try {
ThreadContext.pushBacktrace(context, name, ic.getFileName(), context.getLine());
return ic.engine.interpret(context, self, ic, clazz, name, args, block, blockType);
return ic.engine.interpret(context, self, ic, clazz, name, args, blockArg, blockType);
} finally {
ThreadContext.popBacktrace(context);
}
}

public static IRubyObject INTERPRET_BLOCK(ThreadContext context, IRubyObject self,
InterpreterContext ic, IRubyObject[] args, String name, Block block, Block.Type blockType) {
InterpreterContext ic, IRubyObject[] args, String name, Block blockArg, Block.Type blockType) {
try {
ThreadContext.pushBacktrace(context, name, ic.getFileName(), context.getLine());
return ic.engine.interpret(context, self, ic, null, name, args, block, blockType);
return ic.engine.interpret(context, self, ic, null, name, args, blockArg, blockType);
} finally {
ThreadContext.popBacktrace(context);
}
@@ -153,7 +153,7 @@ public static IRubyObject evalSimple(ThreadContext context, RubyModule under, IR
}

private static IRubyObject evalCommon(ThreadContext context, DynamicScope evalScope, IRubyObject self, IRubyObject src,
String file, int lineNumber, String name, Block block, EvalType evalType) {
String file, int lineNumber, String name, Block blockArg, EvalType evalType) {
StaticScope ss = evalScope.getStaticScope();
BeginEndInterpreterContext ic = prepareIC(context, evalScope, src, file, lineNumber, evalType);

@@ -164,7 +164,7 @@ private static IRubyObject evalCommon(ThreadContext context, DynamicScope evalSc

runBeginBlocks(ic.getBeginBlocks(), context, self, ss, null);

return Interpreter.INTERPRET_EVAL(context, self, ic, ic.getStaticScope().getModule(), IRubyObject.NULL_ARRAY, name, block, null);
return Interpreter.INTERPRET_EVAL(context, self, ic, ic.getStaticScope().getModule(), IRubyObject.NULL_ARRAY, name, blockArg, null);
} finally {
evalScope.clearEvalType();
context.popScope();
34 changes: 17 additions & 17 deletions core/src/main/java/org/jruby/ir/interpreter/InterpreterEngine.java
Original file line number Diff line number Diff line change
@@ -73,37 +73,37 @@ public class InterpreterEngine {

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, IRubyObject.NULL_ARRAY , block, blockType);
String name, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, IRubyObject.NULL_ARRAY, blockArg, blockType);
}

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject arg1, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1}, block, blockType);
String name, IRubyObject arg1, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1}, blockArg, blockType);
}

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject arg1, IRubyObject arg2, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2}, block, blockType);
String name, IRubyObject arg1, IRubyObject arg2, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2}, blockArg, blockType);
}

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2, arg3}, block, blockType);
String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2, arg3}, blockArg, blockType);
}

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block block, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2, arg3, arg4}, block, blockType);
String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block blockArg, Block.Type blockType) {
return interpret(context, self, interpreterContext, implClass, name, new IRubyObject[] {arg1, arg2, arg3, arg4}, blockArg, blockType);
}

public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject[] args, Block block, Block.Type blockType) {
String name, IRubyObject[] args, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
double[] floats = interpreterContext.allocateTemporaryFloatVariables();
@@ -148,7 +148,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
interpretFloatOp((AluInstr) instr, operation, floats, booleans);
break;
case ARG_OP:
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, block);
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, blockArg);
break;
case CALL_OP:
if (profile) Profiler.updateCallSite(instr, interpreterContext.getScope(), scopeVersion);
@@ -170,7 +170,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
currDynScope = interpreterContext.newDynamicScope(context);
context.pushScope(currDynScope);
} else {
processBookKeepingOp(context, instr, operation, name, args, self, block, blockType, implClass);
processBookKeepingOp(context, instr, operation, name, args, self, blockArg, blockType, implClass);
}
break;
case OTHER_OP:
@@ -236,7 +236,7 @@ protected static void interpretFloatOp(AluInstr instr, Operation op, double[] fl
}
}

protected static void receiveArg(ThreadContext context, Instr i, Operation operation, IRubyObject[] args, boolean acceptsKeywordArgument, DynamicScope currDynScope, Object[] temp, Object exception, Block block) {
protected static void receiveArg(ThreadContext context, Instr i, Operation operation, IRubyObject[] args, boolean acceptsKeywordArgument, DynamicScope currDynScope, Object[] temp, Object exception, Block blockArg) {
Object result;
ResultInstr instr = (ResultInstr)i;

@@ -257,7 +257,7 @@ protected static void receiveArg(ThreadContext context, Instr i, Operation opera
setResult(temp, currDynScope, instr.getResult(), exception);
return;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, instr.getResult(), block);
setResult(temp, currDynScope, instr.getResult(), blockArg);
return;
default:
result = ((ReceiveArgBase)instr).receiveArg(context, args, acceptsKeywordArgument);
@@ -326,13 +326,13 @@ protected static void processCall(ThreadContext context, Instr instr, Operation
}

protected static void processBookKeepingOp(ThreadContext context, Instr instr, Operation operation,
String name, IRubyObject[] args, IRubyObject self, Block block,
String name, IRubyObject[] args, IRubyObject self, Block blockArg,
Block.Type blockType, RubyModule implClass) {
switch(operation) {
case LABEL:
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
Original file line number Diff line number Diff line change
@@ -68,13 +68,13 @@ public class SimpleMethodInterpreterEngine extends InterpreterEngine {
put(Operation.CONST_MISSING, true);
}};
@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, Block blockArg, Block.Type blockType) {
// Just use any interp since it will contain no recvs
return interpret(context, self, interpreterContext, implClass, name, (IRubyObject) null, block, blockType);
return interpret(context, self, interpreterContext, implClass, name, (IRubyObject) null, blockArg, blockType);
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -120,7 +120,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -195,7 +195,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
ipc = instr.interpretAndGetNewIPC(context, currDynScope, currScope, self, temp, ipc);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case COPY: // NO INTERP
setResult(temp, currDynScope, ((CopyInstr) instr).getResult(),
@@ -268,7 +268,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -321,7 +321,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -396,7 +396,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
ipc = instr.interpretAndGetNewIPC(context, currDynScope, currScope, self, temp, ipc);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case COPY: // NO INTERP
setResult(temp, currDynScope, ((CopyInstr) instr).getResult(),
@@ -469,7 +469,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -523,7 +523,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -598,7 +598,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
ipc = instr.interpretAndGetNewIPC(context, currDynScope, currScope, self, temp, ipc);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case COPY: // NO INTERP
setResult(temp, currDynScope, ((CopyInstr) instr).getResult(),
@@ -671,7 +671,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, IRubyObject arg4, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -726,7 +726,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -801,7 +801,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
ipc = instr.interpretAndGetNewIPC(context, currDynScope, currScope, self, temp, ipc);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case COPY: // NO INTERP
setResult(temp, currDynScope, ((CopyInstr) instr).getResult(),
@@ -874,7 +874,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
}

@Override
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject[] args, Block block, Block.Type blockType) {
public IRubyObject interpret(ThreadContext context, IRubyObject self, InterpreterContext interpreterContext, RubyModule implClass, String name, IRubyObject[] args, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -921,7 +921,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
instr.interpret(context, currScope, currDynScope, self, temp);
break;
case PUSH_FRAME:
context.preMethodFrameOnly(implClass, name, self, block);
context.preMethodFrameOnly(implClass, name, self, blockArg);
// Only the top-level script scope has PRIVATE visibility.
// This is already handled as part of Interpreter.execute above.
// Everything else is PUBLIC by default.
@@ -996,7 +996,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
ipc = instr.interpretAndGetNewIPC(context, currDynScope, currScope, self, temp, ipc);
break;
case LOAD_IMPLICIT_CLOSURE:
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), block);
setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), blockArg);
break;
case COPY: // NO INTERP
setResult(temp, currDynScope, ((CopyInstr) instr).getResult(),
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@
public class StartupInterpreterEngine extends InterpreterEngine {
public IRubyObject interpret(ThreadContext context, IRubyObject self,
InterpreterContext interpreterContext, RubyModule implClass,
String name, IRubyObject[] args, Block block, Block.Type blockType) {
String name, IRubyObject[] args, Block blockArg, Block.Type blockType) {
Instr[] instrs = interpreterContext.getInstructions();
Object[] temp = interpreterContext.allocateTemporaryVariables();
int n = instrs.length;
@@ -70,7 +70,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
try {
switch (operation.opClass) {
case ARG_OP:
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, block);
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, blockArg);
break;
case CALL_OP:
if (profile) Profiler.updateCallSite(instr, interpreterContext.getScope(), scopeVersion);
@@ -108,7 +108,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
rescuePCs.pop();
break;
default:
processBookKeepingOp(context, instr, operation, name, args, self, block, blockType, implClass);
processBookKeepingOp(context, instr, operation, name, args, self, blockArg, blockType, implClass);
}
break;
case OTHER_OP:

0 comments on commit 913b44f

Please sign in to comment.