< prev index next >

src/cpu/aarch64/vm/interp_masm_aarch64.cpp

Print this page


 262 // Load object from cpool->resolved_references(index)
 263 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 264                                            Register result, Register index) {
 265   assert_different_registers(result, index);
 266   // convert from field index to resolved_references() index and from
 267   // word index to byte offset. Since this is a java object, it can be compressed
 268   Register tmp = index;  // reuse
 269   lslw(tmp, tmp, LogBytesPerHeapOop);
 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   // JNIHandles::resolve(obj);
 276   ldr(result, Address(result, 0));
 277   // Add in the index
 278   add(result, result, tmp);
 279   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
 280 }
 281 









 282 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 283 // subtype of super_klass.
 284 //
 285 // Args:
 286 //      r0: superklass
 287 //      Rsub_klass: subklass
 288 //
 289 // Kills:
 290 //      r2, r5
 291 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 292                                                   Label& ok_is_subtype) {
 293   assert(Rsub_klass != r0, "r0 holds superklass");
 294   assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
 295   assert(Rsub_klass != r5, "r5 holds 2ndary super array scan ptr");
 296 
 297   // Profile the not-null value's klass.
 298   profile_typecheck(r2, Rsub_klass, r5); // blows r2, reloads r5
 299 
 300   // Do the check.
 301   check_klass_subtype(Rsub_klass, r0, r2, ok_is_subtype); // blows r2




 262 // Load object from cpool->resolved_references(index)
 263 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 264                                            Register result, Register index) {
 265   assert_different_registers(result, index);
 266   // convert from field index to resolved_references() index and from
 267   // word index to byte offset. Since this is a java object, it can be compressed
 268   Register tmp = index;  // reuse
 269   lslw(tmp, tmp, LogBytesPerHeapOop);
 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   // JNIHandles::resolve(obj);
 276   ldr(result, Address(result, 0));
 277   // Add in the index
 278   add(result, result, tmp);
 279   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
 280 }
 281 
 282 void InterpreterMacroAssembler::load_resolved_klass_at_offset(
 283                              Register cpool, Register index, Register klass, Register temp) {
 284   add(temp, cpool, index, LSL, LogBytesPerWord);
 285   ldrh(temp, Address(temp, sizeof(ConstantPool))); // temp = resolved_klass_index
 286   ldr(klass, Address(cpool,  ConstantPool::resolved_klasses_offset_in_bytes())); // klass = cpool->_resolved_klasses
 287   add(klass, klass, temp, LSL, LogBytesPerWord);
 288   ldr(klass, Address(klass, Array<Klass*>::base_offset_in_bytes()));
 289 }
 290 
 291 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 292 // subtype of super_klass.
 293 //
 294 // Args:
 295 //      r0: superklass
 296 //      Rsub_klass: subklass
 297 //
 298 // Kills:
 299 //      r2, r5
 300 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 301                                                   Label& ok_is_subtype) {
 302   assert(Rsub_klass != r0, "r0 holds superklass");
 303   assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
 304   assert(Rsub_klass != r5, "r5 holds 2ndary super array scan ptr");
 305 
 306   // Profile the not-null value's klass.
 307   profile_typecheck(r2, Rsub_klass, r5); // blows r2, reloads r5
 308 
 309   // Do the check.
 310   check_klass_subtype(Rsub_klass, r0, r2, ok_is_subtype); // blows r2


< prev index next >