On 2010/12/07 13:53:13, alexander.mitin wrote:
You cannot build the TypeOracle using the class bytes using the
classpath only,
because of the re-rooted resources which have no compiled classes near
the
source file.
Good point. I'm using this method of getting byteCode just for the purposes of exercising the TypeOracle build from byteCode that wasn't generated by JDT. The assumption is we will have to be smart about finding the resources needed to add to the TypeOracle just as we do today with source code - that logic isn't a part of this patch.
So, as part of the GWT Designer I implemented disk caching of the compiled CompilationUnits. The CU caught after compiling and it's
class (and
inner classes) bytes and JSNI code stored on disk in single file per
class.
Then, when new session starts up the cache loads as
CachedCompilationUnit and no
compilation occurred at all (except generated resources of course).
This gives
us 2-3 times faster startup of the dev mode.
Our hope is that by using bytecode, we can delegate the work of building the information we need in the TypeOracle to some process that will run before DevMode or WebMode is invoked - such as an Eclipse plugin or a java compiler frontend.
Now, it slow in the building of the TypeOracle itself. For this is the
idea to
prepare the TypeOracles from classpath (ex., one per JAR file) and
then share
them between sessions. This requires delegating TypeOracle which
consists of
several shared TypeOracles (in this case the recent refactoring of the TypeOracle as interface is very suitable, I did the same by myself but
I'll use
the Scott's version; additionally, I did some refactoring of the CompiledClassLoader to remove the DispatchIdOracle (and related) from
it). We haven't yet considered a hierarchy of type oracles, which is an interesting idea. Thus far, we've been considering ways of refreshing the type oracle in DevMode by using an old type oracle and then feeding it a list of types that are unchanged to copy from the previous version and new types to add in. In particular, we've been pondering how to quickly compute some sort of signature so we can tell even if a cached type oracle entry can be kept, even if a class has been recompiled. http://gwt-code-reviews.appspot.com/1188802/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
