src/cpu/sparc/vm/vtableStubs_sparc.cpp

changeset 3969
1d7922586cf6
parent 3310
6729bbc1fcd6
child 4037
da91efe96a93
equal deleted inserted replaced
3944:aba91a731143 3969:1d7922586cf6
68 // get receiver klass 68 // get receiver klass
69 address npe_addr = __ pc(); 69 address npe_addr = __ pc();
70 __ load_klass(O0, G3_scratch); 70 __ load_klass(O0, G3_scratch);
71 71
72 // set methodOop (in case of interpreted method), and destination address 72 // set methodOop (in case of interpreted method), and destination address
73 int entry_offset = instanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
74 #ifndef PRODUCT 73 #ifndef PRODUCT
75 if (DebugVtables) { 74 if (DebugVtables) {
76 Label L; 75 Label L;
77 // check offset vs vtable length 76 // check offset vs vtable length
78 __ ld(G3_scratch, instanceKlass::vtable_length_offset()*wordSize, G5); 77 __ ld(G3_scratch, instanceKlass::vtable_length_offset()*wordSize, G5);
80 __ set(vtable_index, O2); 79 __ set(vtable_index, O2);
81 __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2); 80 __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2);
82 __ bind(L); 81 __ bind(L);
83 } 82 }
84 #endif 83 #endif
85 int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes(); 84
86 if (Assembler::is_simm13(v_off)) { 85 __ lookup_virtual_method(G3_scratch, vtable_index, G5_method);
87 __ ld_ptr(G3, v_off, G5_method);
88 } else {
89 __ set(v_off,G5);
90 __ ld_ptr(G3, G5, G5_method);
91 }
92 86
93 #ifndef PRODUCT 87 #ifndef PRODUCT
94 if (DebugVtables) { 88 if (DebugVtables) {
95 Label L; 89 Label L;
96 __ br_notnull_short(G5_method, Assembler::pt, L); 90 __ br_notnull_short(G5_method, Assembler::pt, L);

mercurial