meth review
John Rose
John.Rose at Sun.COM
Thu Sep 18 15:40:55 PDT 2008
On Sep 13, 2008, at 3:24 PM, Rémi Forax wrote:
> I've done a more deep review of the code.
> Two codes are weird :
> MethodType.java, line 155
> if (!trusted)
> // defensively copy the array passed in by the user
> ptypes = ptypes.clone();
>
> ptypes is not used after this line.
> I think this test should be moved before the creation of mt1
> (before line 146).
Excellent; thanks. That line should be:
mt1.ptypes = ptypes.clone();
But it should not be moved. The initial query can be done with an
untrusted array; that's the common fast case.
The query is re-done from scratch afterward with the trusted copy.
Also, I noticed that the trust bit was set wrong for the version of
make taking Class<?>... ptypes.
> MH.java, line 234
> static void setVMDataArgSlot(MH self, int argSlot) {
> long index = self.vmdata >> 32;
> self.vmdata = (index << 32) | (argSlot << 32 >>> 32);
> }
>
> knowing that argSlot is an int, I don't understand 'argSlot << 32'.
Heh; argSlot wants to be a long.
Thanks for the close reading!
-- John
P.S. I'm working in the JVM code right now, hooking up the
unimplemented compiled-code paths.
More information about the mlvm-dev
mailing list