Skip to content

Commit

Permalink
[GR-6160] Temporarily avoid static fields in PolyglotRootNode.
Browse files Browse the repository at this point in the history
  • Loading branch information
mur47x111 committed Sep 22, 2017
1 parent ca62113 commit 4ce3097
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@

abstract class PolyglotRootNode extends RootNode {

private static final CallTarget VOID_TARGET = Truffle.getRuntime().createCallTarget(new VoidRootNode());

final PolyglotEngine engine;

PolyglotRootNode(PolyglotEngine engine) {
Expand All @@ -77,7 +75,7 @@ static CallTarget createExecuteSymbol(PolyglotEngine engine, Class<?> type) {
RootNode symbolNode;
if (isPrimitiveType(type)) {
// no conversion necessary just return value
return VOID_TARGET;
return Truffle.getRuntime().createCallTarget(new VoidRootNode());
} else {
symbolNode = new ForeignExecuteRootNode(engine, (Class<? extends TruffleObject>) type);
}
Expand All @@ -89,7 +87,7 @@ static CallTarget createAsJava(PolyglotEngine engine, Class<?> type) {
RootNode symbolNode;
if (isPrimitiveType(type)) {
// no conversion necessary just return value
return VOID_TARGET;
return Truffle.getRuntime().createCallTarget(new VoidRootNode());
} else {
symbolNode = new AsJavaRootNode(engine, (Class<? extends TruffleObject>) type);
}
Expand Down

0 comments on commit 4ce3097

Please sign in to comment.