Request for reviews (XL): 6894206: JVM needs a way to traverse method handle structures
John Rose
John.Rose at Sun.COM
Fri Dec 4 00:49:45 PST 2009
P.S. I don't think there's a portability issue with the long switch. C++ allows any "integral type" (including int64_t) as a switch selector.
I tried a little fault-injection by having the ID3 fields overlap completely. The result was a nice compile-time error about duplicate case statements.
The code would be better with more asserts of the form Vladimir asked for. One extra assert that would be nice would be to have find_id, when it returns a hit, immediately check the resulting i-id against the i-id query functions, such as in this sketch:
private:
static ID find_id_impl(vmSymbols::SID holder,
vmSymbols::SID name,
vmSymbols::SID sig,
jshort flags);
public:
static ID find_id(vmSymbols::SID holder,
vmSymbols::SID name,
vmSymbols::SID sig,
jshort flags) {
ID id = find_id_impl(holder, name, sig, flags);
assert(class_for(id) == holder, "correct id");
...
return id;
}
On Dec 4, 2009, at 12:36 AM, John Rose wrote:
> On Dec 2, 2009, at 11:00 AM, Vladimir Kozlov wrote:
>
>> I think you can use the original code for this push.
>> The John's code is just optimization which could be skipped
>> until he figure out how to do it.
>
> Just turning the int to longs. The following diffs should work. -- John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20091204/7c6efa17/attachment-0001.html
More information about the hotspot-compiler-dev
mailing list