Skip to content

Commit

Permalink
Showing 4 changed files with 12 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -47,7 +47,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -205,7 +204,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

Original file line number Diff line number Diff line change
@@ -3,11 +3,9 @@
import org.jruby.RubyBoolean;
import org.jruby.RubyFixnum;
import org.jruby.RubyFloat;
import org.jruby.RubyHash;
import org.jruby.RubyModule;
import org.jruby.common.IRubyWarnings;
import org.jruby.exceptions.Unrescuable;
import org.jruby.ir.IRScope;
import org.jruby.ir.Operation;
import org.jruby.ir.instructions.BreakInstr;
import org.jruby.ir.instructions.CheckArityInstr;
@@ -118,13 +116,12 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();
boolean acceptsKeywordArgument = interpreterContext.receivesKeywordArguments();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
boolean profile = IRRuntimeHelpers.inProfileMode();
Integer scopeVersion = profile ? Profiler.initProfiling(scope) : 0;
Integer scopeVersion = profile ? Profiler.initProfiling(interpreterContext.getScope()) : 0;

// Enter the looooop!
while (ipc < n) {
@@ -153,7 +150,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, block);
break;
case CALL_OP:
if (profile) Profiler.updateCallSite(instr, scope, scopeVersion);
if (profile) Profiler.updateCallSite(instr, interpreterContext.getScope(), scopeVersion);
processCall(context, instr, operation, currDynScope, currScope, temp, self);
break;
case RET_OP:
@@ -185,7 +182,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
ipc = instr.getRPC();

if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

Original file line number Diff line number Diff line change
@@ -84,7 +84,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -255,7 +254,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

@@ -279,7 +278,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -457,7 +455,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

@@ -481,7 +479,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -660,7 +657,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

@@ -684,7 +681,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -864,7 +860,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

@@ -888,7 +884,6 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -1060,7 +1055,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
} catch (Throwable t) {
ipc = instr.getRPC();
if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

Original file line number Diff line number Diff line change
@@ -43,15 +43,14 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
IRScope scope = currScope.getIRScope();
boolean acceptsKeywordArgument = interpreterContext.receivesKeywordArguments();

Stack<Integer> rescuePCs = new Stack<>();

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
boolean profile = IRRuntimeHelpers.inProfileMode();
Integer scopeVersion = profile ? Profiler.initProfiling(scope) : 0;
Integer scopeVersion = profile ? Profiler.initProfiling(interpreterContext.getScope()) : 0;

// Enter the looooop!
while (ipc < n) {
@@ -74,7 +73,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
receiveArg(context, instr, operation, args, acceptsKeywordArgument, currDynScope, temp, exception, block);
break;
case CALL_OP:
if (profile) Profiler.updateCallSite(instr, scope, scopeVersion);
if (profile) Profiler.updateCallSite(instr, interpreterContext.getScope(), scopeVersion);
processCall(context, instr, operation, currDynScope, currScope, temp, self);
break;
case RET_OP:
@@ -119,7 +118,7 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
}

if (debug) {
Interpreter.LOG.info("in : " + interpreterContext.getStaticScope().getIRScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("in : " + interpreterContext.getScope() + ", caught Java throwable: " + t + "; excepting instr: " + instr);
Interpreter.LOG.info("ipc for rescuer: " + ipc);
}

0 comments on commit 9d2d570

Please sign in to comment.