Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -372,10 +372,9 @@ public Object set(DynamicObject array, int index, Object value, NotProvided unus
// array[index] = object with non-int index

@Specialization(guards = { "!isInteger(indexObject)", "!isIntegerFixnumRange(indexObject)" })
public Object set(VirtualFrame frame, DynamicObject array, Object indexObject, Object value, NotProvided unused,
@Cached("createBinaryProfile()") ConditionProfile negativeIndexProfile) {
public Object set(VirtualFrame frame, DynamicObject array, Object indexObject, Object value, NotProvided unused) {
final int index = toInt(frame, indexObject);
return set(array, index, value, unused, negativeIndexProfile);
return executeSet(frame, array, index, value, unused);
}

// array[start, end] = object

3 comments on commit bd8c92e

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make sure you exercise this somewhere. I tried doing something similar with ropes and Graal was not happy with it, even though the recursion was quite limited.

@eregon
Copy link
Member Author

@eregon eregon commented on bd8c92e Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirvdrum Right, there is a danger to doing recursion with PE. Here I think it's fine since there is explicit int/non-int guards which should limit it very clearly. Otherwise, creating another node of the same type could be an option (that one would never specialize to this specialization so there should not be a risk).

@eregon
Copy link
Member Author

@eregon eregon commented on bd8c92e Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nirvdrum I verified for this case in IGV and it looks alright.

Please sign in to comment.