1.1 --- a/src/share/vm/memory/dump.cpp Tue Oct 14 10:15:33 2008 -0400 1.2 +++ b/src/share/vm/memory/dump.cpp Wed Oct 22 14:48:08 2008 -0400 1.3 @@ -818,6 +818,40 @@ 1.4 // across the space while doing this, as that causes the vtables to be 1.5 // patched, undoing our useful work. Instead, iterate to make a list, 1.6 // then use the list to do the fixing. 1.7 +// 1.8 +// Our constructed vtables: 1.9 +// Dump time: 1.10 +// 1. init_self_patching_vtbl_list: table of pointers to current virtual method addrs 1.11 +// 2. generate_vtable_methods: create jump table, appended to above vtbl_list 1.12 +// 3. PatchKlassVtables: for Klass list, patch the vtable entry to point to jump table 1.13 +// rather than to current vtbl 1.14 +// Table layout: NOTE FIXED SIZE 1.15 +// 1. vtbl pointers 1.16 +// 2. #Klass X #virtual methods per Klass 1.17 +// 1 entry for each, in the order: 1.18 +// Klass1:method1 entry, Klass1:method2 entry, ... Klass1:method<num_virtuals> entry 1.19 +// Klass2:method1 entry, Klass2:method2 entry, ... Klass2:method<num_virtuals> entry 1.20 +// ... 1.21 +// Klass<vtbl_list_size>:method1 entry, Klass<vtbl_list_size>:method2 entry, 1.22 +// ... Klass<vtbl_list_size>:method<num_virtuals> entry 1.23 +// Sample entry: (Sparc): 1.24 +// save(sp, -256, sp) 1.25 +// ba,pt common_code 1.26 +// mov XXX, %L0 %L0 gets: Klass index <<8 + method index (note: max method index 255) 1.27 +// 1.28 +// Restore time: 1.29 +// 1. initialize_oops: reserve space for table 1.30 +// 2. init_self_patching_vtbl_list: update pointers to NEW virtual method addrs in text 1.31 +// 1.32 +// Execution time: 1.33 +// First virtual method call for any object of these Klass types: 1.34 +// 1. object->klass->klass_part 1.35 +// 2. vtable entry for that klass_part points to the jump table entries 1.36 +// 3. branches to common_code with %O0/klass_part, %L0: Klass index <<8 + method index 1.37 +// 4. common_code: 1.38 +// Get address of new vtbl pointer for this Klass from updated table 1.39 +// Update new vtbl pointer in the Klass: future virtual calls go direct 1.40 +// Jump to method, using new vtbl pointer and method index 1.41 1.42 class PatchKlassVtables: public ObjectClosure { 1.43 private: