Skip to content
Snippets Groups Projects
Commit d17d2dbe authored by Zbynek Slajchrt's avatar Zbynek Slajchrt
Browse files

A specialization added to RemoveFixedAttributeNode

parent ee998f39
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,8 @@ import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.Location;
import com.oracle.truffle.api.object.Shape;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.profiles.ValueProfile;
......@@ -68,6 +70,15 @@ public abstract class RemoveFixedAttributeNode extends FixedAttributeAccessNode
public abstract void execute(Object attrs);
@Specialization(limit = "3", //
guards = {"shapeCheck(shape, attrs)", "location == null"}, //
assumptions = {"shape.getValidAssumption()"})
protected void removeNonExistantAttr(@SuppressWarnings("unused") DynamicObject attrs,
@SuppressWarnings("unused") @Cached("lookupShape(attrs)") Shape shape,
@SuppressWarnings("unused") @Cached("lookupLocation(shape, name)") Location location) {
// do nothing
}
@Specialization
@TruffleBoundary
protected void removeAttrFallback(DynamicObject attrs) {
......
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