< prev index next >

src/cpu/sparc/vm/vtableStubs_sparc.cpp

Print this page




  61   CodeBuffer cb(s->entry_point(), sparc_code_length);
  62   MacroAssembler* masm = new MacroAssembler(&cb);
  63 
  64 #ifndef PRODUCT
  65   if (CountCompiledCalls) {
  66     __ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), G5, G3_scratch);
  67   }
  68 #endif /* PRODUCT */
  69 
  70   assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0");
  71 
  72   // get receiver klass
  73   address npe_addr = __ pc();
  74   __ load_klass(O0, G3_scratch);
  75 
  76   // set Method* (in case of interpreted method), and destination address
  77 #ifndef PRODUCT
  78   if (DebugVtables) {
  79     Label L;
  80     // check offset vs vtable length
  81     __ ld(G3_scratch, in_bytes(InstanceKlass::vtable_length_offset()), G5);
  82     __ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L);
  83     __ set(vtable_index, O2);
  84     __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2);
  85     __ bind(L);
  86   }
  87 #endif
  88 
  89   __ lookup_virtual_method(G3_scratch, vtable_index, G5_method);
  90 
  91 #ifndef PRODUCT
  92   if (DebugVtables) {
  93     Label L;
  94     __ br_notnull_short(G5_method, Assembler::pt, L);
  95     __ stop("Vtable entry is ZERO");
  96     __ bind(L);
  97   }
  98 #endif
  99 
 100   address ame_addr = __ pc();  // if the vtable entry is null, the method is abstract
 101                                // NOTE: for vtable dispatches, the vtable entry will never be null.




  61   CodeBuffer cb(s->entry_point(), sparc_code_length);
  62   MacroAssembler* masm = new MacroAssembler(&cb);
  63 
  64 #ifndef PRODUCT
  65   if (CountCompiledCalls) {
  66     __ inc_counter(SharedRuntime::nof_megamorphic_calls_addr(), G5, G3_scratch);
  67   }
  68 #endif /* PRODUCT */
  69 
  70   assert(VtableStub::receiver_location() == O0->as_VMReg(), "receiver expected in O0");
  71 
  72   // get receiver klass
  73   address npe_addr = __ pc();
  74   __ load_klass(O0, G3_scratch);
  75 
  76   // set Method* (in case of interpreted method), and destination address
  77 #ifndef PRODUCT
  78   if (DebugVtables) {
  79     Label L;
  80     // check offset vs vtable length
  81     __ ld(G3_scratch, in_bytes(Klass::vtable_length_offset()), G5);
  82     __ cmp_and_br_short(G5, vtable_index*vtableEntry::size(), Assembler::greaterUnsigned, Assembler::pt, L);
  83     __ set(vtable_index, O2);
  84     __ call_VM(noreg, CAST_FROM_FN_PTR(address, bad_compiled_vtable_index), O0, O2);
  85     __ bind(L);
  86   }
  87 #endif
  88 
  89   __ lookup_virtual_method(G3_scratch, vtable_index, G5_method);
  90 
  91 #ifndef PRODUCT
  92   if (DebugVtables) {
  93     Label L;
  94     __ br_notnull_short(G5_method, Assembler::pt, L);
  95     __ stop("Vtable entry is ZERO");
  96     __ bind(L);
  97   }
  98 #endif
  99 
 100   address ame_addr = __ pc();  // if the vtable entry is null, the method is abstract
 101                                // NOTE: for vtable dispatches, the vtable entry will never be null.


< prev index next >