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

Evgeny Mandrikov mandrikov at gmail.com
Wed Jan 29 11:23:55 UTC 2020


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20200129/91530c61/attachment.htm>


More information about the compiler-dev mailing list