Reviewers: scottb,

Description:
Eliminates empty constructor seed functions by using 2 helper functions
to setup
anonymous closure versions. Something like this:
function fooSeed() {}
_ = fooSeed.prototype = FooConstructor.prototype = new superType();
_.castableTypeMap = { ... }
_.getClass = function() {
return classLiteral;
}
is replaced with

defineSeed(seedId, superSeedid, { castableTypeMap },
function() { return classLiteral; },
FooConstructor1,
FooConstructor2, ...)

This has two effects. First, it reduces both compressed and uncompressed
codesize by a non-trivial amount. Secondly, it frees up extra obfuscated
identifiers (by using numeric ids to identifer function seeds) in the
global
scope. The seedId is not neccessarily the queryId, it could be anything,
but in
this version, it uses the queryId for types that have them.

Note on class literals: I considered doing away with ClassLiteralHolder
for ordinary class types, and instead letting defineSeed construct them
as needed lazily via a lookup table, but will defer that until a follow
on patch.


Please review this at http://gwt-code-reviews.appspot.com/1360802/show

Affected files:
  M dev/core/src/com/google/gwt/dev/jjs/ast/JProgram.java
  M dev/core/src/com/google/gwt/dev/jjs/impl/FragmentExtractor.java
  M dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaScriptAST.java
  A dev/core/src/com/google/gwt/dev/jjs/impl/SeedUtil.java
  M dev/core/src/com/google/gwt/dev/js/JsStackEmulator.java


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to