RFR: JDK-8237528: Inefficient compilation of Pattern Matching for instanceof

Jan Lahoda jan.lahoda at oracle.com
Wed Jan 29 12:06:51 UTC 2020


Right, thanks. I'll fix with some future patch.

Thanks,
     Jan

On 29. 01. 20 12:23, Evgeny Mandrikov wrote:
> Hi,
> 
>  > I.e. the (s = (String)s$temp) == (String)s$temp) is replaced with
>  > (let s = (String)s$temp; in true)
> 
> Looks like an update of comment was forgotten - see tiny patch below.
> 
> And please excuse me for missing the original RFR thread.
> 
> 
> diff -r 9fb094231eee 
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java
> --- 
> a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java 
>         Wed Jan 29 11:04:00 2020 +0100
> +++ 
> b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java 
>         Wed Jan 29 12:13:25 2020 +0100
> @@ -151,7 +151,7 @@
>           if (tree.pattern.hasTag(Tag.BINDINGPATTERN)) {
>               //E instanceof T N
>               //=>
> -            //(let T' N$temp = E; N$temp instanceof T && (N = (T) 
> N$temp == (T) N$temp))
> +            //(let T' N$temp = E; N$temp instanceof T && (N = (T) 
> N$temp; in true))
>               JCBindingPattern patt = (JCBindingPattern)tree.pattern;
>               VarSymbol pattSym = patt.symbol;
>               Type tempType = tree.expr.type.hasTag(BOT) ?
> 
> 
> Regards,
> Evgeny
> 


More information about the compiler-dev mailing list