Wed, 22 Oct 2008 14:48:08 -0400
6761092: jvm crashes when CDS is enabled.
Summary: CDS hardcoded max c++ virtual method table increased
Reviewed-by: coleenp, xlu, jmasa
src/share/vm/memory/compactingPermGenGen.hpp | file | annotate | diff | comparison | revisions | |
src/share/vm/memory/dump.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/memory/compactingPermGenGen.hpp Tue Oct 14 10:15:33 2008 -0400 1.2 +++ b/src/share/vm/memory/compactingPermGenGen.hpp Wed Oct 22 14:48:08 2008 -0400 1.3 @@ -100,7 +100,7 @@ 1.4 1.5 enum { 1.6 vtbl_list_size = 16, // number of entries in the shared space vtable list. 1.7 - num_virtuals = 100 // number of virtual methods in Klass (or 1.8 + num_virtuals = 200 // number of virtual methods in Klass (or 1.9 // subclass) objects, or greater. 1.10 }; 1.11
2.1 --- a/src/share/vm/memory/dump.cpp Tue Oct 14 10:15:33 2008 -0400 2.2 +++ b/src/share/vm/memory/dump.cpp Wed Oct 22 14:48:08 2008 -0400 2.3 @@ -818,6 +818,40 @@ 2.4 // across the space while doing this, as that causes the vtables to be 2.5 // patched, undoing our useful work. Instead, iterate to make a list, 2.6 // then use the list to do the fixing. 2.7 +// 2.8 +// Our constructed vtables: 2.9 +// Dump time: 2.10 +// 1. init_self_patching_vtbl_list: table of pointers to current virtual method addrs 2.11 +// 2. generate_vtable_methods: create jump table, appended to above vtbl_list 2.12 +// 3. PatchKlassVtables: for Klass list, patch the vtable entry to point to jump table 2.13 +// rather than to current vtbl 2.14 +// Table layout: NOTE FIXED SIZE 2.15 +// 1. vtbl pointers 2.16 +// 2. #Klass X #virtual methods per Klass 2.17 +// 1 entry for each, in the order: 2.18 +// Klass1:method1 entry, Klass1:method2 entry, ... Klass1:method<num_virtuals> entry 2.19 +// Klass2:method1 entry, Klass2:method2 entry, ... Klass2:method<num_virtuals> entry 2.20 +// ... 2.21 +// Klass<vtbl_list_size>:method1 entry, Klass<vtbl_list_size>:method2 entry, 2.22 +// ... Klass<vtbl_list_size>:method<num_virtuals> entry 2.23 +// Sample entry: (Sparc): 2.24 +// save(sp, -256, sp) 2.25 +// ba,pt common_code 2.26 +// mov XXX, %L0 %L0 gets: Klass index <<8 + method index (note: max method index 255) 2.27 +// 2.28 +// Restore time: 2.29 +// 1. initialize_oops: reserve space for table 2.30 +// 2. init_self_patching_vtbl_list: update pointers to NEW virtual method addrs in text 2.31 +// 2.32 +// Execution time: 2.33 +// First virtual method call for any object of these Klass types: 2.34 +// 1. object->klass->klass_part 2.35 +// 2. vtable entry for that klass_part points to the jump table entries 2.36 +// 3. branches to common_code with %O0/klass_part, %L0: Klass index <<8 + method index 2.37 +// 4. common_code: 2.38 +// Get address of new vtbl pointer for this Klass from updated table 2.39 +// Update new vtbl pointer in the Klass: future virtual calls go direct 2.40 +// Jump to method, using new vtbl pointer and method index 2.41 2.42 class PatchKlassVtables: public ObjectClosure { 2.43 private: