Skip to content
Snippets Groups Projects
Commit 0adb283f authored by Stepan Sindelar's avatar Stepan Sindelar
Browse files

Merge pull request #394 in G/fastr from...

Merge pull request #394 in G/fastr from ~LUKAS.STADLER_ORACLE.COM/fastr:specialcall_profiles to master

* commit '36f542d4':
  ValueProfile in RCallSpecialNode
parents 9572cbff 36f542d4
Branches
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ import com.oracle.truffle.api.CompilerDirectives; ...@@ -26,6 +26,7 @@ import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.profiles.ConditionProfile; import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.profiles.ValueProfile;
import com.oracle.truffle.api.source.SourceSection; import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode; import com.oracle.truffle.r.nodes.access.variables.LocalReadVariableNode;
import com.oracle.truffle.r.runtime.ArgumentsSignature; import com.oracle.truffle.r.runtime.ArgumentsSignature;
...@@ -48,6 +49,7 @@ final class PeekLocalVariableNode extends RNode { ...@@ -48,6 +49,7 @@ final class PeekLocalVariableNode extends RNode {
@Child private LocalReadVariableNode read; @Child private LocalReadVariableNode read;
private final ConditionProfile isPromiseProfile = ConditionProfile.createBinaryProfile(); private final ConditionProfile isPromiseProfile = ConditionProfile.createBinaryProfile();
private final ValueProfile valueProfile = ValueProfile.createClassProfile();
PeekLocalVariableNode(String name) { PeekLocalVariableNode(String name) {
this.read = LocalReadVariableNode.create(name, false); this.read = LocalReadVariableNode.create(name, false);
...@@ -64,9 +66,9 @@ final class PeekLocalVariableNode extends RNode { ...@@ -64,9 +66,9 @@ final class PeekLocalVariableNode extends RNode {
if (!promise.isEvaluated()) { if (!promise.isEvaluated()) {
throw RSpecialFactory.throwFullCallNeeded(); throw RSpecialFactory.throwFullCallNeeded();
} }
return promise.getValue(); return valueProfile.profile(promise.getValue());
} }
return value; return valueProfile.profile(value);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment