StringSubstitutions are disabled in 1.9

Doug Simon doug.simon at oracle.com
Thu Feb 1 16:17:43 UTC 2018



> On 1 Feb 2018, at 17:01, Dmitry Samersoff <dms at samersoff.net> wrote:
> 
> Hi Everybody,
> 
> 1.
> I found following remark in StringSubstitutionTest.java
> 
> if (!Java8OrEarlier) {
>   // StringSubstitutions are disabled in 1.9
>    return;
> }
> 
> 
> What is the reason for disabling StringSubstitutions in jdk9 and should
> we enable it for jdk11?

The reason is was disabled is because String internals changed in JDK 9 (http://openjdk.java.net/jeps/254).
That should have been in the comment about them being disabled.
New substitutions would be needed to support the compact strings. And they would have to be enabled in org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.registerStringPlugins.

> 
> 2.
> StringSubstitutionTest.testSubstitution method is almost identical to
> one in its baseclass, MethodSubstitutionTest.testSubstitution.
> 
> What is the reason of that slight diverge?

I'm not sure why MethodSubstitutionTest.testSubstitution was not modified to accommodate StringSubstitutionTest's requirements. Cleaning that up would be preferable.

> 
> Should we create more specific StringSubstitutionTest class?

Why? If it's to test compact string substitutions (when they are added), then I would just modify StringSubstitutionTest.

-Doug


More information about the graal-dev mailing list