Skip to content

Commit

Permalink
[GR-49481] Document explicit NPE for GraphBuilderContext#nullCheckedV…
Browse files Browse the repository at this point in the history
…alue.
  • Loading branch information
rmosaner committed Dec 20, 2023
1 parent 4c79426 commit e31b87d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ default boolean isPluginEnabled(GraphBuilderPlugin plugin) {

BailoutException bailout(String string);

/**
* Gets a version of a given value that has a non-null stamp. Emits a guard or an explicit
* exception check which is triggered if the value is null. Thus, <b> use only for values where
* the underlying bytecode can throw a {@link NullPointerException}! </b>
*/
default ValueNode nullCheckedValue(ValueNode value) {
return nullCheckedValue(value, InvalidateReprofile);
}
Expand All @@ -336,8 +341,9 @@ default GuardingNode intrinsicRangeCheck(LogicNode condition, boolean negated) {
}

/**
* Gets a version of a given value that has a {@linkplain StampTool#isPointerNonNull(ValueNode)
* non-null} stamp.
* Gets a version of a given value that has a non-null stamp. Emits a guard or an explicit
* exception check which is triggered if the value is null. Thus, <b> use only for values where
* the underlying bytecode can throw a {@link NullPointerException}! </b>
*/
default ValueNode nullCheckedValue(ValueNode value, DeoptimizationAction action) {
if (!StampTool.isPointerNonNull(value)) {
Expand Down

0 comments on commit e31b87d

Please sign in to comment.