[gwt-contrib] Re: Use class seed functions in -XdisableClassMetadata mode
Are you in a big hurry to get this in? If not, it seems like the perfect reason to go back to the drawing board with JClassLiteral to make it not suck now that we have a much better idea what we really want out of it. Otherwise, it feels an awful lot like we're piling suckitude on top of suckitude. :( Can you guarantee that one or the other of the classSeedFunc logic or the typeName logic will always get optimized out? I tend to think that you cannot make this guarantee because of synthetic class literals like String[].class. On Thu, Apr 2, 2009 at 11:12 AM, BobV wrote: > On Tue, Mar 31, 2009 at 9:09 PM, BobV wrote: > > On Tue, Mar 31, 2009 at 8:12 PM, Scott Blum wrote: > >> This seems kinda hacky since you could recompute the seed func name at > >> compile time during GenerateJavaScriptAST? > > > > I thought about that, but discounted it because > > GenerateJavaScriptAST would have to take a look at the pruned / > > mangled / optimized by as-yet-unknown call sites of CreateForFoo() and > > determine which parameter to replace (assuming any parameters were > > left) instead of being told exactly what to do via the Java AST. That > > seemed more likely to break over time as well as contribute to clutter > > in the string literal pool. > > @Scott, > > Can I get a thumbs up/down on this approach as an interim solution? > Otherwise, I can come up with some other way of de-mangling class > identity for instantiable types at runtime with a method similar to > the old GWT.getTypeName(). > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Use class seed functions in -XdisableClassMetadata mode
On Tue, Mar 31, 2009 at 9:09 PM, BobV wrote: > On Tue, Mar 31, 2009 at 8:12 PM, Scott Blum wrote: >> This seems kinda hacky since you could recompute the seed func name at >> compile time during GenerateJavaScriptAST? > > I thought about that, but discounted it because > GenerateJavaScriptAST would have to take a look at the pruned / > mangled / optimized by as-yet-unknown call sites of CreateForFoo() and > determine which parameter to replace (assuming any parameters were > left) instead of being told exactly what to do via the Java AST. That > seemed more likely to break over time as well as contribute to clutter > in the string literal pool. @Scott, Can I get a thumbs up/down on this approach as an interim solution? Otherwise, I can come up with some other way of de-mangling class identity for instantiable types at runtime with a method similar to the old GWT.getTypeName(). -- Bob Vawter Google Web Toolkit Team --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Use class seed functions in -XdisableClassMetadata mode
On Tue, Mar 31, 2009 at 8:12 PM, Scott Blum wrote: > This seems kinda hacky since you could recompute the seed func name at > compile time during GenerateJavaScriptAST? I thought about that, but discounted it because GenerateJavaScriptAST would have to take a look at the pruned / mangled / optimized by as-yet-unknown call sites of CreateForFoo() and determine which parameter to replace (assuming any parameters were left) instead of being told exactly what to do via the Java AST. That seemed more likely to break over time as well as contribute to clutter in the string literal pool. -- Bob Vawter Google Web Toolkit Team --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Use class seed functions in -XdisableClassMetadata mode
On Tue, Mar 31, 2009 at 8:12 PM, Scott Blum wrote: > Honestly, the way JClassLiteral works is pretty crappy... ideally you'd > rather just emit exactly what you need during GenerateJavaScriptAST anyway. > ^ And yes, I wrote it that way. Crappy, I mean. --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---
[gwt-contrib] Re: Use class seed functions in -XdisableClassMetadata mode
This seems kinda hacky since you could recompute the seed func name at compile time during GenerateJavaScriptAST? Honestly, the way JClassLiteral works is pretty crappy... ideally you'd rather just emit exactly what you need during GenerateJavaScriptAST anyway. 2009/3/31 > Reviewers: scottb, rjrjr, > > Description: > This patch changes class literal setup to pass the class's seed function > into createForClass when a seed function is available for the type. The > behavior of Class.getName() in -XdisableClassMetadata mode is changed to > return "Class$" for instantiable types or "Class$ number>" for all non-instantiable or JSO types. > > Please review this at http://gwt-code-reviews.appspot.com/15805 > > Affected files: > dev/core/src/com/google/gwt/dev/jjs/ast/JClassLiteral.java > dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java > dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java > dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java > user/super/com/google/gwt/emul/java/lang/Class.java > user/test/com/google/gwt/dev/jjs/test/ClassObjectTest.java > > > --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---