Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4f296b63bee2
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 53760a3a2e6d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 20, 2016

  1. Copy the full SHA
    9dc511a View commit details
  2. Copy the full SHA
    53760a3 View commit details
Original file line number Diff line number Diff line change
@@ -32,9 +32,11 @@ public Object execute(VirtualFrame frame) {
}

public RubyNode resolve() {
final RubyNode resolved = resolver.get();
replace(resolved, "lazy translation node resolved");
return resolved;
return atomic(() -> {
final RubyNode resolved = resolver.get();
replace(resolved, "lazy translation node resolved");
return resolved;
});
}

}
Original file line number Diff line number Diff line change
@@ -293,13 +293,13 @@ public RubyNode doCompileMethodBody(RubySourceSection sourceSection, String meth
}

public MethodDefinitionNode compileMethodNode(RubySourceSection sourceSection, String methodName, MethodDefParseNode defNode, ParseNode bodyNode, SharedMethodInfo sharedMethodInfo) {
final TranslatorState state = getCurrentState();

final SourceSection fullMethodSourceSection = new RubySourceSection(defNode.getLine() + 1, defNode.getEndLine() + 1).toSourceSection(source);

final RubyNode body;

if (context.getOptions().LAZY_TRANSLATION) {
final TranslatorState state = getCurrentState();

body = new LazyTranslationNode(() -> {
restoreState(state);
return compileMethodBody(sourceSection, methodName, bodyNode, sharedMethodInfo);