@@ -2598,27 +2598,13 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
25982598 });
25992599 }
26002600
2601- private static void generateStringRangeCheck (GraphBuilderContext b , InvocationPluginHelper helper , ValueNode array , ValueNode off , ValueNode len ) {
2602- helper .intrinsicRangeCheck (off , Condition .LT , ConstantNode .forInt (0 ));
2603- helper .intrinsicRangeCheck (len , Condition .LT , ConstantNode .forInt (0 ));
2604-
2605- ValueNode arrayLength = b .add (new ArrayLengthNode (array ));
2606- ValueNode limit = b .add (AddNode .create (off , len , NodeView .DEFAULT ));
2607- helper .intrinsicRangeCheck (arrayLength , Condition .LT , limit );
2608- }
2609-
26102601 private static void registerStringCodingPlugins (InvocationPlugins plugins , Replacements replacements ) {
26112602 Registration r = new Registration (plugins , "java.lang.StringCoding" , replacements );
26122603 r .register (new InvocationPlugin ("encodeISOArray0" , byte [].class , int .class , byte [].class , int .class , int .class ) {
26132604 @ Override
26142605 public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode sa , ValueNode sp ,
26152606 ValueNode da , ValueNode dp , ValueNode len ) {
26162607 try (InvocationPluginHelper helper = new InvocationPluginHelper (b , targetMethod )) {
2617- if (b .getPlatformConfigurationProvider ().shouldVerifyIntrinsicChecks ()) {
2618- generateStringRangeCheck (b , helper , sa , sp , len );
2619- generateStringRangeCheck (b , helper , da , dp , len );
2620- }
2621-
26222608 int charElementShift = CodeUtil .log2 (b .getMetaAccess ().getArrayIndexScale (JavaKind .Char ));
26232609 ValueNode src = helper .arrayElementPointer (sa , JavaKind .Byte , LeftShiftNode .create (sp , ConstantNode .forInt (charElementShift ), NodeView .DEFAULT ));
26242610 ValueNode dst = helper .arrayElementPointer (da , JavaKind .Byte , dp );
@@ -2632,11 +2618,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
26322618 public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode sa , ValueNode sp ,
26332619 ValueNode da , ValueNode dp , ValueNode len ) {
26342620 try (InvocationPluginHelper helper = new InvocationPluginHelper (b , targetMethod )) {
2635- if (b .getPlatformConfigurationProvider ().shouldVerifyIntrinsicChecks ()) {
2636- generateStringRangeCheck (b , helper , sa , sp , len );
2637- generateStringRangeCheck (b , helper , da , dp , len );
2638- }
2639-
26402621 ValueNode src = helper .arrayElementPointer (sa , JavaKind .Char , sp );
26412622 ValueNode dst = helper .arrayElementPointer (da , JavaKind .Byte , dp );
26422623 b .addPush (JavaKind .Int , new EncodeArrayNode (src , dst , len , ASCII , JavaKind .Char ));
@@ -2648,10 +2629,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
26482629 @ Override
26492630 public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode ba , ValueNode off , ValueNode len ) {
26502631 try (InvocationPluginHelper helper = new InvocationPluginHelper (b , targetMethod )) {
2651- if (b .getPlatformConfigurationProvider ().shouldVerifyIntrinsicChecks ()) {
2652- generateStringRangeCheck (b , helper , ba , off , len );
2653- }
2654-
26552632 ValueNode array = helper .arrayElementPointer (ba , JavaKind .Byte , off );
26562633 b .addPush (JavaKind .Int , new CountPositivesNode (array , len ));
26572634 return true ;
0 commit comments