There might be a simpler variant to what you propose but in a similar
spirit.  Instead of injecting code into static initializers, could we just
use an ASM visitor to gather the information that we'd get later through
reflection, without actually having to load the target class?

On Thu, Dec 11, 2008 at 5:12 PM, BobV <b...@google.com> wrote:

>  My original solution to the ClassCircularityError was to implement
> an ASM visitor that added or modified a class's static initializer to
> call over to CCL.injectJsni().  This ensured that the Class was
> fully-reified before any attempt at dispId assignment was attempted.
> Even though it is mechanically more complicated than performing
> injection from within findClass(), it is conceptually easier to reason
> about the timing.
>
>  Given that we now require the user to specify all modules to be
> loaded on the command-line of hosted mode, it is now feasible to
> compute all JSNI code that might be reachable from the entry point.
> As long as we're careful not to prematurely trigger class
> initialization, we could inject all JSNI in one fell swoop, but at the
> cost of injecting more code than we otherwise would into the browser.
>
> --
> Bob Vawter
> Google Web Toolkit Team
>

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

Reply via email to