< prev index next >

src/hotspot/cpu/aarch64/interp_masm_aarch64.cpp

Print this page
rev 50098 : 8202714: Create a MacroAssembler::access_load/store_at wrapper for AArch64
rev 50100 : 8203172: Primitive heap access for interpreter BarrierSetAssembler/aarch64


 250   add(cache, cache, in_bytes(ConstantPoolCache::base_offset()));
 251   add(cache, cache, tmp, Assembler::LSL, 2 + LogBytesPerWord);  // construct pointer to cache entry
 252 }
 253 
 254 void InterpreterMacroAssembler::get_method_counters(Register method,
 255                                                     Register mcs, Label& skip) {
 256   Label has_counters;
 257   ldr(mcs, Address(method, Method::method_counters_offset()));
 258   cbnz(mcs, has_counters);
 259   call_VM(noreg, CAST_FROM_FN_PTR(address,
 260           InterpreterRuntime::build_method_counters), method);
 261   ldr(mcs, Address(method, Method::method_counters_offset()));
 262   cbz(mcs, skip); // No MethodCounters allocated, OutOfMemory
 263   bind(has_counters);
 264 }
 265 
 266 // Load object from cpool->resolved_references(index)
 267 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 268                                            Register result, Register index, Register tmp) {
 269   assert_different_registers(result, index);
 270   // convert from field index to resolved_references() index and from
 271   // word index to byte offset. Since this is a java object, it can be compressed
 272   lslw(index, index, LogBytesPerHeapOop);
 273 
 274   get_constant_pool(result);
 275   // load pointer for resolved_references[] objArray
 276   ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 277   ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 278   resolve_oop_handle(result, tmp);
 279   // Add in the index
 280   add(result, result, index);
 281   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
 282 }
 283 
 284 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
 285                              Register cpool, Register index, Register klass, Register temp) {
 286   add(temp, cpool, index, LSL, LogBytesPerWord);
 287   ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
 288   ldr(klass, Address(cpool,  ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
 289   add(klass, klass, temp, LSL, LogBytesPerWord);
 290   ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
 291 }
 292 
 293 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 294 // subtype of super_klass.
 295 //
 296 // Args:
 297 //      r0: superklass
 298 //      Rsub_klass: subklass
 299 //
 300 // Kills:
 301 //      r2, r5




 250   add(cache, cache, in_bytes(ConstantPoolCache::base_offset()));
 251   add(cache, cache, tmp, Assembler::LSL, 2 + LogBytesPerWord);  // construct pointer to cache entry
 252 }
 253 
 254 void InterpreterMacroAssembler::get_method_counters(Register method,
 255                                                     Register mcs, Label& skip) {
 256   Label has_counters;
 257   ldr(mcs, Address(method, Method::method_counters_offset()));
 258   cbnz(mcs, has_counters);
 259   call_VM(noreg, CAST_FROM_FN_PTR(address,
 260           InterpreterRuntime::build_method_counters), method);
 261   ldr(mcs, Address(method, Method::method_counters_offset()));
 262   cbz(mcs, skip); // No MethodCounters allocated, OutOfMemory
 263   bind(has_counters);
 264 }
 265 
 266 // Load object from cpool->resolved_references(index)
 267 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 268                                            Register result, Register index, Register tmp) {
 269   assert_different_registers(result, index);



 270 
 271   get_constant_pool(result);
 272   // load pointer for resolved_references[] objArray
 273   ldr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 274   ldr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 275   resolve_oop_handle(result, tmp);
 276   // Add in the index
 277   add(index, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT) >> LogBytesPerHeapOop);
 278   load_heap_oop(result, Address(result, index, Address::uxtw(LogBytesPerHeapOop)));
 279 }
 280 
 281 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
 282                              Register cpool, Register index, Register klass, Register temp) {
 283   add(temp, cpool, index, LSL, LogBytesPerWord);
 284   ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
 285   ldr(klass, Address(cpool,  ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
 286   add(klass, klass, temp, LSL, LogBytesPerWord);
 287   ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
 288 }
 289 
 290 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 291 // subtype of super_klass.
 292 //
 293 // Args:
 294 //      r0: superklass
 295 //      Rsub_klass: subklass
 296 //
 297 // Kills:
 298 //      r2, r5


< prev index next >