@@ -311,22 +311,17 @@ private static ValueNode narrowOsrLocal(StructuredGraph graph, Stamp narrowedSta
311
311
* test against a type, it is not an instance of operation but a null check and an
312
312
* isArray check
313
313
*/
314
- if (checkedStamp .isObjectStamp () && ((ObjectStamp ) checkedStamp ).nonNull ()) {
315
- // without a null check
316
- check = graph .addOrUniqueWithInputs (ObjectIsArrayNode .create (effectiveOsrLocal ));
317
- } else {
318
- // add a preceding null check with the same speculation reason
319
- check = graph .addOrUniqueWithInputs (LogicNegationNode .create (IsNullNode .create (effectiveOsrLocal )));
320
- SpeculationLog .Speculation constant = graph .getSpeculationLog ().speculate (reason );
321
- FixedGuardNode guard = graph .add (new FixedGuardNode (check , DeoptimizationReason .OptimizedTypeCheckViolated , DeoptimizationAction .InvalidateRecompile , constant , false ));
322
- graph .addAfterFixed (osrStart , guard );
323
- PiNode nonNullPi = graph .addOrUnique (new PiNode (effectiveOsrLocal , ((ObjectStamp ) checkedStamp ).asNonNull (), guard ));
324
-
325
- insertionPoint = guard ;
326
-
327
- // with a null check
328
- check = graph .addOrUnique (ObjectIsArrayNode .create (nonNullPi ));
329
- }
314
+ // add a preceding null check with the same speculation reason
315
+ check = graph .addOrUniqueWithInputs (LogicNegationNode .create (IsNullNode .create (effectiveOsrLocal )));
316
+ SpeculationLog .Speculation constant = graph .getSpeculationLog ().speculate (reason );
317
+ FixedGuardNode guard = graph .add (new FixedGuardNode (check , DeoptimizationReason .OptimizedTypeCheckViolated , DeoptimizationAction .InvalidateRecompile , constant , false ));
318
+ graph .addAfterFixed (osrStart , guard );
319
+ PiNode nonNullPi = graph .addOrUnique (new PiNode (effectiveOsrLocal , ((ObjectStamp ) checkedStamp ).asNonNull (), guard ));
320
+
321
+ insertionPoint = guard ;
322
+
323
+ // with a null check
324
+ check = graph .addOrUnique (ObjectIsArrayNode .create (nonNullPi ));
330
325
checkedStamp = new ObjectStamp (null , false , true , false , true );
331
326
} else {
332
327
check = graph .addOrUniqueWithInputs (InstanceOfNode .createHelper ((ObjectStamp ) checkedStamp , effectiveOsrLocal , null , null ));
0 commit comments