Skip to content

Commit

Permalink
[Truffle] Rename some time metrics and make sure they're always run.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Feb 9, 2016
1 parent 16a5783 commit 3be711f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
Expand Up @@ -841,8 +841,11 @@ public IRubyObject runInterpreter(ThreadContext context, Node rootNode, IRubyObj
assert self == getTopSelf();
final JRubyTruffleInterface truffleContext = getTruffleContext();
Main.printTruffleTimeMetric("before-run");
truffleContext.execute((RootNode) rootNode);
Main.printTruffleTimeMetric("after-run");
try {
truffleContext.execute((RootNode) rootNode);
} finally {
Main.printTruffleTimeMetric("after-run");
}
return getNil();
} else {
return interpreter.execute(this, rootNode, self);
Expand Down Expand Up @@ -890,7 +893,7 @@ public JRubyTruffleInterface getTruffleContext() {
}

private JRubyTruffleInterface loadTruffle() {
Main.printTruffleTimeMetric("before-load-truffle-context");
Main.printTruffleTimeMetric("before-load-context");

final Class<?> clazz;

Expand All @@ -909,7 +912,7 @@ private JRubyTruffleInterface loadTruffle() {
throw new RuntimeException("Error while calling the constructor of Truffle's RubyContext", e);
}

Main.printTruffleTimeMetric("after-load-truffle-context");
Main.printTruffleTimeMetric("after-load-context");

return truffleContext;
}
Expand Down
4 changes: 2 additions & 2 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ public void initializeAfterMethodsAdded() {
// Load Ruby core

try {
Main.printTruffleTimeMetric("before-load-truffle-core");
Main.printTruffleTimeMetric("before-load-core");

state = State.LOADING_RUBY_CORE;
try {
Expand All @@ -767,7 +767,7 @@ public void initializeAfterMethodsAdded() {
throw new RuntimeException(e);
}

Main.printTruffleTimeMetric("after-load-truffle-core");
Main.printTruffleTimeMetric("after-load-core");
} catch (RaiseException e) {
final Object rubyException = e.getRubyException();
BacktraceFormatter.createDefaultFormatter(getContext()).printBacktrace(context, (DynamicObject) rubyException, Layouts.EXCEPTION.getBacktrace((DynamicObject) rubyException));
Expand Down

0 comments on commit 3be711f

Please sign in to comment.