groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "death lord (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8706) A way to implement Java casting/integer division without reflection and overhead
Date Fri, 20 Jul 2018 13:00:00 GMT
death lord created GROOVY-8706:
----------------------------------

             Summary: A way to implement Java casting/integer division without reflection
and overhead
                 Key: GROOVY-8706
                 URL: https://issues.apache.org/jira/browse/GROOVY-8706
             Project: Groovy
          Issue Type: Improvement
            Reporter: death lord


Normally the expression (Type) a compiles to ScriptBytecodeAdapter.castToType(a, Type) using
CompileStatic, but this can be too much in a lot of cases where a is just a superclass of
Type. Somewhat related the expression (int) (a / b) when a and b are ints compiles to defaultIntUnbox(NumberNumberDiv.div(a,
b)) when it could just utilize an idiv instruction. For the first one maybe a cast<Type>(a)
or some other operator like what was done with ===, and for the second one I'd prefer the
(int) (a / b) syntax over a new division operator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message