Reviewers: Lex, tobyr, Description: Follow-on to http://gwt-code-reviews.appspot.com/675801/show
This patch removes the extra hop through a synthetic static 'new' function that is currently used for implementing JSNI ::new() invocations. In the 99% case, the JsInvocation is replaced with a JsNew operation on the target constructor. In rare cases where the constructor is not immediately invoked, a tear off function is creation which performs the new op internally. Examples: test.Foo::new()(); -> new test_Foo(); var factory = test.Foo::new(); -> var factory = function() { return new test_Foo(); }; Please review this at http://gwt-code-reviews.appspot.com/676801/show Affected files: M dev/core/src/com/google/gwt/dev/jjs/ast/JVisitor.java M dev/core/src/com/google/gwt/dev/jjs/impl/BuildTypeMap.java M dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java M dev/core/src/com/google/gwt/dev/jjs/impl/JsniRefLookup.java M dev/core/test/com/google/gwt/dev/jjs/impl/JsniRefLookupTest.java -- http://groups.google.com/group/Google-Web-Toolkit-Contributors