RFR: 8042235: redefining method used by multiple MethodHandles crashes VM
kevin.walls at oracle.com
Wed Dec 17 15:48:11 UTC 2014
This is a request for review of a backport to 7u of 8042235. There are
a few changes from the original, hence the request here.
On JDK7 this is not a crash, but we run the wrong method, i.e.
invocation through a MethodHandle invokes the old version of the method,
if it has been redefined.
The test is different also: in jdk8 we have the ASM library, and can
visit methods and bytecodes. Here in 7, I wrote a non-bytecode aware
byte replacer method, and replaced some literal bytecode sequence with
another. As we're crafting a method that we will rewrite, we can do
something that avoids use of the constant pool (which we haven't
actually understood in this trivial rewriter), so we rewrite some simple
arithmetic, and from the result of the method it's obvious whether we
are running the correct code.
Coleen: thanks for your earlier hints on oop / obj_field vs. address_field.
More information about the hotspot-runtime-dev