Skip to content
Snippets Groups Projects
Commit a7119692 authored by Gero Leinemann's avatar Gero Leinemann
Browse files

Added BinaryConditionProfile to ResolvePromiseNode

parent 1a5b4ac8
Branches
No related tags found
No related merge requests found
...@@ -215,6 +215,8 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro ...@@ -215,6 +215,8 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro
return value; return value;
} }
private final ConditionProfile isPromiseProfile = ConditionProfile.createBinaryProfile();
/** /**
* Catch all calls to {@link #execute(VirtualFrame, MaterializedFrame)} ({@code final} so it * Catch all calls to {@link #execute(VirtualFrame, MaterializedFrame)} ({@code final} so it
* is not overridden by the annotation processor) and forward them to {@link #getReadNode()} * is not overridden by the annotation processor) and forward them to {@link #getReadNode()}
...@@ -224,7 +226,7 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro ...@@ -224,7 +226,7 @@ public abstract class ReadVariableNode extends RNode implements VisibilityContro
@Override @Override
public final Object execute(VirtualFrame frame, MaterializedFrame enclosingFrame) { public final Object execute(VirtualFrame frame, MaterializedFrame enclosingFrame) {
Object obj = getReadNode().execute(frame, enclosingFrame); Object obj = getReadNode().execute(frame, enclosingFrame);
if (isPromise(obj)) { if (isPromiseProfile.profile(isPromise(obj))) {
return doValue(frame, (RPromise) obj); return doValue(frame, (RPromise) obj);
} }
return obj; return obj;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment