You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/11/20 18:19:00 UTC

[jira] [Commented] (GROOVY-10377) SC: === and !== compiled to ScriptBytecodeAdapter#compareIdentical

    [ https://issues.apache.org/jira/browse/GROOVY-10377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446855#comment-17446855 ] 

Eric Milles commented on GROOVY-10377:
--------------------------------------

https://github.com/apache/groovy/commit/bec691dbcc15cd7df4691fa149e6d57212c883d1

> SC: === and !== compiled to ScriptBytecodeAdapter#compareIdentical
> ------------------------------------------------------------------
>
>                 Key: GROOVY-10377
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10377
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static compilation
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
> @groovy.transform.CompileStatic
> void test(ref) {
>   if (ref === null) {
>     //...
>   }
> }
> {code}
> The null check is written as a call to {{.ScriptBytecodeAdapter#compareIdentical}}.  For "ref == null" direct null-comparison bytecode is generated.  There may also be opportunities for constant or reference-to-reference comparisons as well.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)