gwt /
gwt /
f99de34e221df774568702cf54915b7678c15155 JConstructor redesign.
Implementation notes:
- new type JConstructor extends JMethod
- JNewInstance now extends JMethodCall
- The wonky "Ctor(new TypeName(), arg1, arg2)" construction is gone in favor of "new Ctor(arg1, arg2)"
- A lot of calls to JMethod.isStatic() have been replaced by JMethod.needsVtable(). This is because what the code really wanted to ask was "can this method participate in instance dispatch?" And it used to be true that this was exactly "!isStatic()". But constructors muddy the water. It seemed wrong to model constructors as being static, especially since they can contain this references, so I went with the needsVtable() approach.
Follow-on work:
- I can reduce some of the code size with a subsequent patch that merges empty constructors and seed functions, but I ran afoul of DeRPC's expectations so I'll do this in a follow-up.
- I also have another follow-on that can inline super/this constructors into calling constructors at the JS layer; and it also improves a few other places where "function.call()" is used. I doubt this will be a size win, but probably a speed win.
- One last tiny size improvement would be to avoid setting up a prototype on constructors that are used only for super calls.
http://gwt-code-reviews.appspot.com/159803
Review by: spoon
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7714 8db76d5a-ed1c-0410-87a9-c151d255dfc7
31 files changed