Request for reviews (XXL): 6893268: additional dynamic language related optimizations in C2
Tom Rodriguez
Thomas.Rodriguez at Sun.COM
Tue Dec 8 17:11:58 PST 2009
>> Any reason you're using external_name instead of the symbolOop itself?
>> external_name requires allocation and conversion.
>
> I think I used external_name() because it returns the name with / to .
> converted and probably because I didn't see that symbolOop has an
> equals() method.
>
> But I just noticed that symbolOopDesc::equals(const char* str, int len)
> also checks that the length is the same, which I didn't expect (given
> there is a len argument).
>
> So I added three methods to symbolOopDesc:
>
> + bool equals(const char* str) const { return equals(str, (int) strlen(str)); }
> +
> + // Tests if the symbol starts with the given prefix.
> + bool starts_with(const char* prefix, int len) const;
> + bool starts_with(const char* prefix) const {
> + return starts_with(prefix, (int) strlen(prefix));
> + }
>
> and used the first one in places where it's appropriate. Here is a
> webrev of the changes:
>
> http://cr.openjdk.java.net/~twisti/starts_with/webrev.01/
>
> Could I roll that into this change?
It seems overly complicated. If the actual class name is java/dyn then you'll get a range check on the final byte_at(len) test. Why not just require the trailing / and check it via asserts?
tom
>
> -- Christian
>
More information about the hotspot-compiler-dev
mailing list