< prev index next >

src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp

Print this page
rev 54670 : Port of valuetypes to aarch64


  99     const ptrdiff_t codesize = __ pc() - start_pc;
 100     slop_delta  = estimate - codesize;  // call_VM varies in length, depending on data
 101     slop_bytes += slop_delta;
 102     assert(slop_delta >= 0, "vtable #%d: Code size estimate (%d) for DebugVtables too small, required: %d", vtable_index, (int)estimate, (int)codesize);
 103 
 104     __ leave();
 105     __ bind(L);
 106   }
 107 #endif // PRODUCT
 108 
 109   start_pc = __ pc();
 110   __ lookup_virtual_method(r16, vtable_index, rmethod);
 111   slop_delta  = 8 - (int)(__ pc() - start_pc);
 112   slop_bytes += slop_delta;
 113   assert(slop_delta >= 0, "negative slop(%d) encountered, adjust code size estimate!", slop_delta);
 114 
 115 #ifndef PRODUCT
 116   if (DebugVtables) {
 117     Label L;
 118     __ cbz(rmethod, L);
 119     __ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
 120     __ cbnz(rscratch1, L);
 121     __ stop("Vtable entry is NULL");
 122     __ bind(L);
 123   }
 124 #endif // PRODUCT
 125 
 126   // r0: receiver klass
 127   // rmethod: Method*
 128   // r2: receiver
 129   address ame_addr = __ pc();
 130   __ ldr(rscratch1, Address(rmethod, Method::from_compiled_offset()));
 131   __ br(rscratch1);
 132 
 133   masm->flush();
 134   bookkeeping(masm, tty, s, npe_addr, ame_addr, true, vtable_index, slop_bytes, 0);
 135 
 136   return s;
 137 }
 138 
 139 
 140 VtableStub* VtableStubs::create_itable_stub(int itable_index) {
 141   // Read "A word on VtableStub sizing" in share/code/vtableStubs.hpp for details on stub sizing.
 142   const int stub_code_length = code_size_limit(false);
 143   VtableStub* s = new(stub_code_length) VtableStub(false, itable_index);
 144   // Can be NULL if there is no free space in the code cache.
 145   if (s == NULL) {
 146     return NULL;
 147   }
 148   // Count unused bytes in instruction sequences of variable size.
 149   // We add them to the computed buffer size in order to avoid
 150   // overflow in subsequently generated stubs.




  99     const ptrdiff_t codesize = __ pc() - start_pc;
 100     slop_delta  = estimate - codesize;  // call_VM varies in length, depending on data
 101     slop_bytes += slop_delta;
 102     assert(slop_delta >= 0, "vtable #%d: Code size estimate (%d) for DebugVtables too small, required: %d", vtable_index, (int)estimate, (int)codesize);
 103 
 104     __ leave();
 105     __ bind(L);
 106   }
 107 #endif // PRODUCT
 108 
 109   start_pc = __ pc();
 110   __ lookup_virtual_method(r16, vtable_index, rmethod);
 111   slop_delta  = 8 - (int)(__ pc() - start_pc);
 112   slop_bytes += slop_delta;
 113   assert(slop_delta >= 0, "negative slop(%d) encountered, adjust code size estimate!", slop_delta);
 114 
 115 #ifndef PRODUCT
 116   if (DebugVtables) {
 117     Label L;
 118     __ cbz(rmethod, L);
 119     __ ldr(rscratch1, Address(rmethod, Method::from_compiled_value_ro_offset()));
 120     __ cbnz(rscratch1, L);
 121     __ stop("Vtable entry is NULL");
 122     __ bind(L);
 123   }
 124 #endif // PRODUCT
 125 
 126   // r0: receiver klass
 127   // rmethod: Method*
 128   // r2: receiver
 129   address ame_addr = __ pc();
 130   __ ldr(rscratch1, Address(rmethod, Method::from_compiled_value_ro_offset()));
 131   __ br(rscratch1);
 132 
 133   masm->flush();
 134   bookkeeping(masm, tty, s, npe_addr, ame_addr, true, vtable_index, slop_bytes, 0);
 135 
 136   return s;
 137 }
 138 
 139 
 140 VtableStub* VtableStubs::create_itable_stub(int itable_index) {
 141   // Read "A word on VtableStub sizing" in share/code/vtableStubs.hpp for details on stub sizing.
 142   const int stub_code_length = code_size_limit(false);
 143   VtableStub* s = new(stub_code_length) VtableStub(false, itable_index);
 144   // Can be NULL if there is no free space in the code cache.
 145   if (s == NULL) {
 146     return NULL;
 147   }
 148   // Count unused bytes in instruction sequences of variable size.
 149   // We add them to the computed buffer size in order to avoid
 150   // overflow in subsequently generated stubs.


< prev index next >