Skip to content

Commit

Permalink
Tweak interpreter debug output to emit IPC as well
Browse files Browse the repository at this point in the history
  • Loading branch information
subbuss committed May 8, 2015
1 parent 690d554 commit 89c7044
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self, Interprete
while (ipc < n) {
Instr instr = instrs[ipc];

ipc++;

Operation operation = instr.getOperation();
if (debug) {
Interpreter.LOG.info("I: {}", instr);
Interpreter.LOG.info("I: {" + ipc + "} ", instr);
Interpreter.interpInstrsCount++;
}

ipc++;

try {
switch (operation) {
case RETURN:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,18 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
// Enter the looooop!
while (ipc < n) {
Instr instr = instrs[ipc];
ipc++;

Operation operation = instr.getOperation();
if (debug) {
Interpreter.LOG.info("I: {}", instr);
Interpreter.LOG.info("I: {" + ipc + "} ", instr);
Interpreter.interpInstrsCount++;
} else if (profile) {
Profiler.instrTick(operation);
Interpreter.interpInstrsCount++;
}

ipc++;

try {
switch (operation.opClass) {
case INT_OP:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,18 @@ public IRubyObject interpret(ThreadContext context, IRubyObject self,
// Enter the looooop!
while (ipc < n) {
Instr instr = instrs[ipc];
ipc++;

Operation operation = instr.getOperation();
if (debug) {
Interpreter.LOG.info("I: {}", instr);
Interpreter.LOG.info("I: {" + ipc + "} ", instr);
Interpreter.interpInstrsCount++;
} else if (profile) {
Profiler.instrTick(operation);
Interpreter.interpInstrsCount++;
}

ipc++;

try {
switch (operation.opClass) {
case ARG_OP:
Expand Down

0 comments on commit 89c7044

Please sign in to comment.