@@ -2598,27 +2598,13 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
2598
2598
});
2599
2599
}
2600
2600
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
-
2610
2601
private static void registerStringCodingPlugins (InvocationPlugins plugins , Replacements replacements ) {
2611
2602
Registration r = new Registration (plugins , "java.lang.StringCoding" , replacements );
2612
2603
r .register (new InvocationPlugin ("encodeISOArray0" , byte [].class , int .class , byte [].class , int .class , int .class ) {
2613
2604
@ Override
2614
2605
public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode sa , ValueNode sp ,
2615
2606
ValueNode da , ValueNode dp , ValueNode len ) {
2616
2607
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
-
2622
2608
int charElementShift = CodeUtil .log2 (b .getMetaAccess ().getArrayIndexScale (JavaKind .Char ));
2623
2609
ValueNode src = helper .arrayElementPointer (sa , JavaKind .Byte , LeftShiftNode .create (sp , ConstantNode .forInt (charElementShift ), NodeView .DEFAULT ));
2624
2610
ValueNode dst = helper .arrayElementPointer (da , JavaKind .Byte , dp );
@@ -2632,11 +2618,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
2632
2618
public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode sa , ValueNode sp ,
2633
2619
ValueNode da , ValueNode dp , ValueNode len ) {
2634
2620
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
-
2640
2621
ValueNode src = helper .arrayElementPointer (sa , JavaKind .Char , sp );
2641
2622
ValueNode dst = helper .arrayElementPointer (da , JavaKind .Byte , dp );
2642
2623
b .addPush (JavaKind .Int , new EncodeArrayNode (src , dst , len , ASCII , JavaKind .Char ));
@@ -2648,10 +2629,6 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
2648
2629
@ Override
2649
2630
public boolean apply (GraphBuilderContext b , ResolvedJavaMethod targetMethod , Receiver receiver , ValueNode ba , ValueNode off , ValueNode len ) {
2650
2631
try (InvocationPluginHelper helper = new InvocationPluginHelper (b , targetMethod )) {
2651
- if (b .getPlatformConfigurationProvider ().shouldVerifyIntrinsicChecks ()) {
2652
- generateStringRangeCheck (b , helper , ba , off , len );
2653
- }
2654
-
2655
2632
ValueNode array = helper .arrayElementPointer (ba , JavaKind .Byte , off );
2656
2633
b .addPush (JavaKind .Int , new CountPositivesNode (array , len ));
2657
2634
return true ;
0 commit comments