263 * {@link #parsingIntrinsic() parsing an intrinsic}.
264 */
265 IntrinsicContext getIntrinsic();
266
267 BailoutException bailout(String string);
268
269 default ValueNode nullCheckedValue(ValueNode value) {
270 return nullCheckedValue(value, InvalidateReprofile);
271 }
272
273 /**
274 * Gets a version of a given value that has a {@linkplain StampTool#isPointerNonNull(ValueNode)
275 * non-null} stamp.
276 */
277 default ValueNode nullCheckedValue(ValueNode value, DeoptimizationAction action) {
278 if (!StampTool.isPointerNonNull(value)) {
279 LogicNode condition = getGraph().unique(IsNullNode.create(value));
280 ObjectStamp receiverStamp = (ObjectStamp) value.stamp();
281 Stamp stamp = receiverStamp.join(objectNonNull());
282 FixedGuardNode fixedGuard = append(new FixedGuardNode(condition, NullCheckException, action, true));
283 ValueNode nonNullReceiver = getGraph().addOrUnique(PiNode.create(value, stamp, fixedGuard));
284 // TODO: Propogating the non-null into the frame state would
285 // remove subsequent null-checks on the same value. However,
286 // it currently causes an assertion failure when merging states.
287 //
288 // frameState.replace(value, nonNullReceiver);
289 return nonNullReceiver;
290 }
291 return value;
292 }
293
294 @SuppressWarnings("unused")
295 default void notifyReplacedCall(ResolvedJavaMethod targetMethod, ConstantNode node) {
296
297 }
298
299 /**
300 * Interface whose instances hold inlining information about the current context, in a wider
301 * sense. The wider sense in this case concerns graph building approaches that don't necessarily
302 * keep a chain of {@link GraphBuilderContext} instances normally available through
303 * {@linkplain #getParent()}. Examples of such approaches are partial evaluation and incremental
|
263 * {@link #parsingIntrinsic() parsing an intrinsic}.
264 */
265 IntrinsicContext getIntrinsic();
266
267 BailoutException bailout(String string);
268
269 default ValueNode nullCheckedValue(ValueNode value) {
270 return nullCheckedValue(value, InvalidateReprofile);
271 }
272
273 /**
274 * Gets a version of a given value that has a {@linkplain StampTool#isPointerNonNull(ValueNode)
275 * non-null} stamp.
276 */
277 default ValueNode nullCheckedValue(ValueNode value, DeoptimizationAction action) {
278 if (!StampTool.isPointerNonNull(value)) {
279 LogicNode condition = getGraph().unique(IsNullNode.create(value));
280 ObjectStamp receiverStamp = (ObjectStamp) value.stamp();
281 Stamp stamp = receiverStamp.join(objectNonNull());
282 FixedGuardNode fixedGuard = append(new FixedGuardNode(condition, NullCheckException, action, true));
283 ValueNode nonNullReceiver = getGraph().addOrUniqueWithInputs(PiNode.create(value, stamp, fixedGuard));
284 // TODO: Propogating the non-null into the frame state would
285 // remove subsequent null-checks on the same value. However,
286 // it currently causes an assertion failure when merging states.
287 //
288 // frameState.replace(value, nonNullReceiver);
289 return nonNullReceiver;
290 }
291 return value;
292 }
293
294 @SuppressWarnings("unused")
295 default void notifyReplacedCall(ResolvedJavaMethod targetMethod, ConstantNode node) {
296
297 }
298
299 /**
300 * Interface whose instances hold inlining information about the current context, in a wider
301 * sense. The wider sense in this case concerns graph building approaches that don't necessarily
302 * keep a chain of {@link GraphBuilderContext} instances normally available through
303 * {@linkplain #getParent()}. Examples of such approaches are partial evaluation and incremental
|