< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JDK9StringSubstitutions.java

Print this page
rev 52509 : [mq]: graal


  58 
  59         if (thisString.length() == 0) {
  60             return true;
  61         }
  62         if (getCoder(thisString) != getCoder(thatString)) {
  63             return false;
  64         }
  65 
  66         final byte[] array1 = getValue(thisString);
  67         final byte[] array2 = getValue(thatString);
  68 
  69         return ArrayEqualsNode.equals(array1, array2, array1.length);
  70     }
  71 
  72     /**
  73      * Will be intrinsified with an {@link InvocationPlugin} to a {@link LoadFieldNode}.
  74      */
  75     public static native byte[] getValue(String s);
  76 
  77     public static native int getCoder(String s);




  78 }


  58 
  59         if (thisString.length() == 0) {
  60             return true;
  61         }
  62         if (getCoder(thisString) != getCoder(thatString)) {
  63             return false;
  64         }
  65 
  66         final byte[] array1 = getValue(thisString);
  67         final byte[] array2 = getValue(thatString);
  68 
  69         return ArrayEqualsNode.equals(array1, array2, array1.length);
  70     }
  71 
  72     /**
  73      * Will be intrinsified with an {@link InvocationPlugin} to a {@link LoadFieldNode}.
  74      */
  75     public static native byte[] getValue(String s);
  76 
  77     public static native int getCoder(String s);
  78 
  79     public static boolean isCompactString(String s) {
  80         return getCoder(s) == 0;
  81     }
  82 }
< prev index next >