classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] Patch: support for reading directories viaURL.openConne


From: Archie Cobbs
Subject: Re: [cp-patches] Patch: support for reading directories viaURL.openConnection()
Date: Fri, 10 Sep 2004 11:21:37 -0500 (CDT)

Jeroen Frijters wrote:
> OK, so you're compiling classes independently ahead of time, but at
> runtime they still have to be linked right? Wouldn't that also give you
> an opportunity to insert the class init checks. In essence you're doing
> the same thing as gjc is going to do with their new model and I'm sure
> that they'll be optimizing <clinit>.

Not really..

For JC, "linking" simply amounts to loading sections and resolving
ELF symbols. Inserting new code would be much more difficult. The
pre-generated code is in the form of standard relocatable ELF
objects produced by GCC, with a specially defined symbol namespace..
see http://jcvm.sourceforge.net/doc/jc.html#Appendix%20A

So JC doesn't ever have to "touch" the generated code, and this is a good
thing :-) I let GCC produce the code ahead of time (or at runtime), and
JC then simply links it all together.

By the way, an "active use" check looks like this:

  #define _JC_ACTIVE_USE(env, class)                                    \
    do {                                                                \
        _jc_type *const _type0 = &_jc_ ## class ## $type.type;          \
                                                                        \
        if ((_type0->flags & _JC_TYPE_INITIALIZED) == 0)                \
                _jc_cs_initialize_type((env), _type0);                  \
    } while (0)

so the overhead in the non-invoke case is a bitmask comparison and branch.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]