56 MacroAssembler* masm = new MacroAssembler(&cb);
57
58 #ifndef PRODUCT
59 if (CountCompiledCalls) {
60 __ lea(r19, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
61 __ incrementw(Address(r19));
62 }
63 #endif
64
65 // get receiver (need to skip return address on top of stack)
66 assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");
67
68 // get receiver klass
69 address npe_addr = __ pc();
70 __ load_klass(r19, j_rarg0);
71
72 #ifndef PRODUCT
73 if (DebugVtables) {
74 Label L;
75 // check offset vs vtable length
76 __ ldrw(rscratch1, Address(r19, InstanceKlass::vtable_length_offset()));
77 __ cmpw(rscratch1, vtable_index * vtableEntry::size());
78 __ br(Assembler::GT, L);
79 __ enter();
80 __ mov(r2, vtable_index);
81 __ call_VM(noreg,
82 CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), j_rarg0, r2);
83 __ leave();
84 __ bind(L);
85 }
86 #endif // PRODUCT
87
88 __ lookup_virtual_method(r19, vtable_index, rmethod);
89
90 if (DebugVtables) {
91 Label L;
92 __ cbz(rmethod, L);
93 __ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
94 __ cbnz(rscratch1, L);
95 __ stop("Vtable entry is NULL");
96 __ bind(L);
|
56 MacroAssembler* masm = new MacroAssembler(&cb);
57
58 #ifndef PRODUCT
59 if (CountCompiledCalls) {
60 __ lea(r19, ExternalAddress((address) SharedRuntime::nof_megamorphic_calls_addr()));
61 __ incrementw(Address(r19));
62 }
63 #endif
64
65 // get receiver (need to skip return address on top of stack)
66 assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");
67
68 // get receiver klass
69 address npe_addr = __ pc();
70 __ load_klass(r19, j_rarg0);
71
72 #ifndef PRODUCT
73 if (DebugVtables) {
74 Label L;
75 // check offset vs vtable length
76 __ ldrw(rscratch1, Address(r19, Klass::vtable_length_offset()));
77 __ cmpw(rscratch1, vtable_index * vtableEntry::size());
78 __ br(Assembler::GT, L);
79 __ enter();
80 __ mov(r2, vtable_index);
81 __ call_VM(noreg,
82 CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), j_rarg0, r2);
83 __ leave();
84 __ bind(L);
85 }
86 #endif // PRODUCT
87
88 __ lookup_virtual_method(r19, vtable_index, rmethod);
89
90 if (DebugVtables) {
91 Label L;
92 __ cbz(rmethod, L);
93 __ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
94 __ cbnz(rscratch1, L);
95 __ stop("Vtable entry is NULL");
96 __ bind(L);
|