hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
changeset 360 21d113ecbf6a
parent 189 4248c8e21063
child 670 ddf3e9583f2f
equal deleted inserted replaced
357:f4edb0d9f109 360:21d113ecbf6a
    54 
    54 
    55   // Free registers (non-args) are rax, rbx
    55   // Free registers (non-args) are rax, rbx
    56 
    56 
    57   // get receiver klass
    57   // get receiver klass
    58   address npe_addr = __ pc();
    58   address npe_addr = __ pc();
    59   __ movq(rax, Address(j_rarg0, oopDesc::klass_offset_in_bytes()));
    59   __ load_klass(rax, j_rarg0);
    60 
    60 
    61   // compute entry offset (in words)
    61   // compute entry offset (in words)
    62   int entry_offset =
    62   int entry_offset =
    63     instanceKlass::vtable_start_offset() + vtable_index * vtableEntry::size();
    63     instanceKlass::vtable_start_offset() + vtable_index * vtableEntry::size();
    64 
    64 
   129 
   129 
   130   assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");
   130   assert(VtableStub::receiver_location() == j_rarg0->as_VMReg(), "receiver expected in j_rarg0");
   131   // get receiver klass (also an implicit null-check)
   131   // get receiver klass (also an implicit null-check)
   132   address npe_addr = __ pc();
   132   address npe_addr = __ pc();
   133 
   133 
   134   __ movq(rbx, Address(j_rarg0, oopDesc::klass_offset_in_bytes()));
   134   __ load_klass(rbx, j_rarg0);
   135 
   135 
   136   // If we take a trap while this arg is on the stack we will not
   136   // If we take a trap while this arg is on the stack we will not
   137   // be able to walk the stack properly. This is not an issue except
   137   // be able to walk the stack properly. This is not an issue except
   138   // when there are mistakes in this assembly code that could generate
   138   // when there are mistakes in this assembly code that could generate
   139   // a spurious fault. Ask me how I know...
   139   // a spurious fault. Ask me how I know...
   179     itableMethodEntry::method_offset_in_bytes();
   179     itableMethodEntry::method_offset_in_bytes();
   180 
   180 
   181   // Get methodOop and entrypoint for compiler
   181   // Get methodOop and entrypoint for compiler
   182 
   182 
   183   // Get klass pointer again
   183   // Get klass pointer again
   184   __ movq(rax, Address(j_rarg0, oopDesc::klass_offset_in_bytes()));
   184   __ load_klass(rax, j_rarg0);
   185 
   185 
   186   const Register method = rbx;
   186   const Register method = rbx;
   187   __ movq(method, Address(rax, j_rarg1, Address::times_1, method_offset));
   187   __ movq(method, Address(rax, j_rarg1, Address::times_1, method_offset));
   188 
   188 
   189   // Restore saved register, before possible trap.
   189   // Restore saved register, before possible trap.
   224 }
   224 }
   225 
   225 
   226 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
   226 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
   227   if (is_vtable_stub) {
   227   if (is_vtable_stub) {
   228     // Vtable stub size
   228     // Vtable stub size
   229     return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0);
   229     return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
       
   230            (UseCompressedOops ? 16 : 0);  // 1 leaq can be 3 bytes + 1 long
   230   } else {
   231   } else {
   231     // Itable stub size
   232     // Itable stub size
   232     return (DebugVtables ? 636 : 72) + (CountCompiledCalls ? 13 : 0);
   233     return (DebugVtables ? 636 : 72) + (CountCompiledCalls ? 13 : 0) +
       
   234            (UseCompressedOops ? 32 : 0);  // 2 leaqs
   233   }
   235   }
   234 }
   236 }
   235 
   237 
   236 int VtableStub::pd_code_alignment() {
   238 int VtableStub::pd_code_alignment() {
   237   return wordSize;
   239   return wordSize;