use of com.oracle.truffle.api.Assumption in project graal by oracle.
the class FrameDescriptor method invalidateNotInFrameAssumption.
private void invalidateNotInFrameAssumption(Object identifier) {
if (identifierToNotInFrameAssumptionMap != null) {
Assumption assumption = identifierToNotInFrameAssumptionMap.get(identifier);
if (assumption != null) {
assumption.invalidate();
identifierToNotInFrameAssumptionMap.removeKey(identifier);
}
}
}
use of com.oracle.truffle.api.Assumption in project graal by oracle.
the class FrameDescriptor method getNotInFrameAssumption.
/**
* Make an assumption that no slot with the specified identifier is present in this frame
* descriptor. Invalidated when a frame slot with the identifier is added.
*
* @param identifier frame slot identifier
* @return an assumption that this frame descriptor does not contain a slot with the identifier
* @throws IllegalArgumentException if the frame descriptor contains a slot with the identifier
* @since 0.8 or earlier
*/
public Assumption getNotInFrameAssumption(Object identifier) {
if (identifierToSlotMap.containsKey(identifier)) {
throw new IllegalArgumentException("Cannot get not-in-frame assumption for existing frame slot!");
}
if (identifierToNotInFrameAssumptionMap == null) {
identifierToNotInFrameAssumptionMap = EconomicMap.create();
} else {
Assumption assumption = identifierToNotInFrameAssumptionMap.get(identifier);
if (assumption != null) {
return assumption;
}
}
Assumption assumption = Truffle.getRuntime().createAssumption("identifier not in frame");
identifierToNotInFrameAssumptionMap.put(identifier, assumption);
return assumption;
}
Aggregations