You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2006/06/27 18:10:40 UTC

[jchevm] _jc_parse_classfile called twice in common case

Archie,

I notice that there is a common code path that goes:

  _jc_derive_type_from_classfile which calls:
    _jc_parse_classfile
    _jc_derive_type_interp which calls:
      _jc_parse_classfile (with, I think, the same arguments as before)

Is this correct?  Perhaps we could avoid making the second call?

Regards,
 Mark.



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jchevm] _jc_parse_classfile called twice in common case

Posted by Archie Cobbs <ar...@dellroad.org>.
Archie Cobbs wrote:
> Mark Hindess wrote:
>> I notice that there is a common code path that goes:
>>
>>   _jc_derive_type_from_classfile which calls:
>>     _jc_parse_classfile
>>     _jc_derive_type_interp which calls:
>>       _jc_parse_classfile (with, I think, the same arguments as before)
>>
>> Is this correct?  Perhaps we could avoid making the second call?
> 
> That's correct.. but we don't duplicate much work. The first call to
> _jc_parse_classfile() has howmuch=1, which means "just parse the
> names of the class, superclass, and superinterfaces, and then return".

Actually, we do parse the constant pool twice, which is silly.
But this is easy to fix... done in r417540.

-Archie

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

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [jchevm] _jc_parse_classfile called twice in common case

Posted by Archie Cobbs <ar...@dellroad.org>.
Mark Hindess wrote:
> I notice that there is a common code path that goes:
> 
>   _jc_derive_type_from_classfile which calls:
>     _jc_parse_classfile
>     _jc_derive_type_interp which calls:
>       _jc_parse_classfile (with, I think, the same arguments as before)
> 
> Is this correct?  Perhaps we could avoid making the second call?

That's correct.. but we don't duplicate much work. The first call to
_jc_parse_classfile() has howmuch=1, which means "just parse the
names of the class, superclass, and superinterfaces, and then return".

The overall class loading calling sequence is slightly less efficient than
it could be, however, a holdover from the support in JCVM for loading
classfiles from both ELF objects and/or the classpath.

-Archie

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

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org