Skip to content

Commit

Permalink
[Truffle] Add a resolve method on LazyTranslationNode to illustrate t…
Browse files Browse the repository at this point in the history
…he problem we have.
  • Loading branch information
chrisseaton committed Dec 19, 2016
1 parent f4d64b9 commit 4f296b6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ public LazyTranslationNode(Supplier<RubyNode> resolver) {
@Override
public Object execute(VirtualFrame frame) {
CompilerDirectives.transferToInterpreterAndInvalidate();
return resolve().execute(frame);
}

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

}

0 comments on commit 4f296b6

Please sign in to comment.