This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFC: make verifier more lazy
- From: Tom Tromey <tromey at redhat dot com>
- To: Robert Schuster <theBohemian at gmx dot net>
- Cc: java-patches at gcc dot gnu dot org
- Date: 16 Nov 2005 09:49:24 -0700
- Subject: Re: RFC: make verifier more lazy
- References: <4378D5AB.1010201@gmx.net>
- Reply-to: tromey at redhat dot com
>>>>> "Robert" == Robert Schuster <theBohemian@gmx.net> writes:
Robert> this is my patch for PR #17021. It makes the verification step
Robert> more lazy and allows loading of classes where classes files
Robert> are referenced from which the bytecode cannot be found.
Robert> I wrote a couple of mauve (module verify) tests to make sure
Robert> that I introduced no regressions and prove that my fix works.
Excellent.
Robert> @Bryce: I sent my paperwork back to the FSF office already (~10 days).
We have to wait for them to receive it before we can check anything
in.
Robert> +// For strcpy
Robert> +#include <string.h>
This doesn't need a comment.
Robert> + if ( self->data.klass == &java::lang::Object::class$ )
In our coding style there are no spaces after '(' or before ')'.
Robert> + if ( klass->data.name->limit()[-1] == ';' ||
Robert> + _Jv_isDerivedFromPrimitive(klass->data.name) )
Instead of _Jv_isDerivedFromPrimitive, can't you just look for a
leading '[' here?
I suppose we need to test this to make sure it works with class names
like 'I'.
Robert> +jboolean
Robert> +_Jv_equalUtf8Classnames (const Utf8Const *a, const Utf8Const *b)
Robert> +{
Robert> + if ( _Jv_equalUtf8Consts(a, b) )
Robert> + return true;
This is inefficient. Couldn't we handle this check in the same loop
as the other others?
Robert> + // Skips any leading L characters (even if they belong to the package
Robert> + // name).
Robert> + while ( ac == 'L' )
Robert> + ac = UTF8_GET(aptr, alimit);
I think there can only be one leading 'L', and you only want to strip
it if the last character is a ';'. You can "strip" the ';'s by
decrementing the corresponding limit variable.
Robert> + friend jboolean _Jv_equalUtf8Classnames (const _Jv_Utf8Const*, const _Jv_Utf8Const*);
This goes over 80 columns and should be split at the ','.
Tom