Code Review for 7092712

Prepared by:twisti on Wed Oct 12 04:37:48 PDT 2011
Workspace:/home/twisti/hsx/hotspot-comp/7092712
Compare against: /home/twisti/hsx/hotspot-comp/hotspot
Summary of changes: 86 lines changed: 46 ins; 3 del; 37 mod; 6243 unchg
Patch of changes: 7092712.patch
Printable review: 7092712.pdf
Author comments:
7092712: JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
Reviewed-by:

The problem is that ciEnv::get_fake_invokedynamic_method_impl calls
get_unloaded_method with java.lang.invoke.MethodHandle as the holder
for unresolved call sites.

Since the loader of j.l.i.MethodHandle is the boot class loader the
resolving of e.g. signature classes is done with the boot class loader
resulting in problems like:

(dbx) p this->print()
<ciInstanceKlass name=NEW2 loader=0xe5e88000 loaded=true initialized=true finalized=false subklass=false size=16 flags=public,super super=java/lang/Object ident=714 PERM address=0x8480c40>this->print() = (void)
(dbx) p that->print()
<ciInstanceKlass name=NEW2 loader=0x0 loaded=false ident=720 address=0x8481178>that->print() = (void)

Later in the game a ciInstanceKlass lookup for NEW2 returns a
ciInstanceKlass created during the signature resolving in
get_unloaded_method with the boot class loader as loader resulting in
the above situation.

The fix is to always pass an accessor to get_unloaded_method and
subsequently the ciMethod constructor.

Bug id: 7092712 JSR 292: unloaded invokedynamic call sites can lead to a crash with signature types not on BCP
Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciEnv.cpp

14 lines changed: 3 ins; 1 del; 10 mod; 1170 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciEnv.hpp

7 lines changed: 2 ins; 0 del; 5 mod; 403 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciMethod.cpp

19 lines changed: 6 ins; 0 del; 13 mod; 1214 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciMethod.hpp

1 line changed: 0 ins; 0 del; 1 mod; 305 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciObjectFactory.cpp

17 lines changed: 12 ins; 0 del; 5 mod; 743 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciObjectFactory.hpp

2 lines changed: 1 ins; 0 del; 1 mod; 140 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciSignature.cpp

20 lines changed: 18 ins; 0 del; 2 mod; 113 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/ci/ciSignature.hpp

4 lines changed: 4 ins; 0 del; 0 mod; 66 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New Patch Raw src/share/vm/prims/methodHandleWalk.cpp

2 lines changed: 0 ins; 2 del; 0 mod; 2089 unchg

This code review page was prepared using /home/twisti/bin/webrev (vers 23.18-hg-never).