Skip to content
Snippets Groups Projects
Commit a40ea846 authored by stepan's avatar stepan
Browse files

Remove naProfile field in CastDoubleBaseNode and use it only as @Cached

parent 150ae12c
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,6 @@ import com.oracle.truffle.r.runtime.ops.na.NAProfile;
public abstract class CastDoubleBaseNode extends CastBaseNode {
protected final NACheck naCheck = NACheck.create();
protected final NAProfile naProfile = NAProfile.create();
protected CastDoubleBaseNode(boolean preserveNames, boolean preserveDimensions, boolean preserveAttributes) {
super(preserveNames, preserveDimensions, preserveAttributes);
......@@ -110,7 +109,8 @@ public abstract class CastDoubleBaseNode extends CastBaseNode {
@Specialization
protected double doString(String operand,
@Cached("createBinaryProfile()") ConditionProfile emptyStringProfile) {
@Cached("createBinaryProfile()") ConditionProfile emptyStringProfile,
@Cached("create()") NAProfile naProfile) {
if (naProfile.isNA(operand) || emptyStringProfile.profile(operand.isEmpty())) {
return RRuntime.DOUBLE_NA;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment