Details
Description
Groovy 2 will bring a new couple of annotations for static dispatching and type checking. Integrating these require some rework of artefacts to not depend on any dynamic features (using compile-time injection, ast visitor on builders, reloading workarounds for typed injected properties etc).
Eventually, a config option to globally enable the static checking/compilation will be provided.
Quick bytecode sample:
//original action code : def blabla() { println "test2-dd" def results = userService.findAllWantedUser(55) render results as XML } //without @CompileStatic @Action public Object blabla() { CallSite[] arrayOfCallSite = $getCallSiteArray(); arrayOfCallSite[5].callCurrent(this, "test2-dd"); Object results = arrayOfCallSite[6].call(userService, Integer.valueOf(55)); return arrayOfCallSite[7].callCurrent(this, ScriptBytecodeAdapter.createPojoWrapper( (XML)ScriptBytecodeAdapter.asType(results, XML.class), XML.class ) ); return null; } //with @CompileStatic @Action public Object blabla() { DefaultGroovyMethods.println(this, "test2-dd"); null; List results = userService.findAllWantedUser(55); render((XML)ScriptBytecodeAdapter.asType(results, XML.class)); return null; return null; }
Issue Links
- is related to
-
GRAILS-8130
Optimize Grails AST "instance api" performance for plain getter (properties)
-
-
GRAILS-8667
Update UrlMapping : extensions points - syntax - results
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits