< prev index next >

src/hotspot/cpu/x86/interp_masm_x86.cpp

Print this page
rev 50081 : [mq]: primitives2.patch


 490   assert(cache != tmp, "must use different register");
 491   get_cache_index_at_bcp(tmp, bcp_offset, index_size);
 492   assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below");
 493   // convert from field index to ConstantPoolCacheEntry index
 494   // and from word offset to byte offset
 495   assert(exact_log2(in_bytes(ConstantPoolCacheEntry::size_in_bytes())) == 2 + LogBytesPerWord, "else change next line");
 496   shll(tmp, 2 + LogBytesPerWord);
 497   movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
 498   // skip past the header
 499   addptr(cache, in_bytes(ConstantPoolCache::base_offset()));
 500   addptr(cache, tmp);  // construct pointer to cache entry
 501 }
 502 
 503 // Load object from cpool->resolved_references(index)
 504 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 505                                            Register result, Register index) {
 506   assert_different_registers(result, index);
 507   // convert from field index to resolved_references() index and from
 508   // word index to byte offset. Since this is a java object, it can be compressed
 509   Register tmp = index;  // reuse
 510   shll(tmp, LogBytesPerHeapOop);
 511 
 512   get_constant_pool(result);
 513   // load pointer for resolved_references[] objArray
 514   movptr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 515   movptr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 516   resolve_oop_handle(result);
 517   // Add in the index
 518   addptr(result, tmp);
 519   load_heap_oop(result, Address(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
 520   // The resulting oop is null if the reference is not yet resolved.
 521   // It is Universe::the_null_sentinel() if the reference resolved to NULL via condy.
 522 }
 523 
 524 // load cpool->resolved_klass_at(index)
 525 void InterpreterMacroAssembler::load_resolved_klass_at_index(Register cpool,
 526                                            Register index, Register klass) {
 527   movw(index, Address(cpool, index, Address::times_ptr, sizeof(ConstantPool)));
 528   Register resolved_klasses = cpool;
 529   movptr(resolved_klasses, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes()));
 530   movptr(klass, Address(resolved_klasses, index, Address::times_ptr, Array<Klass*>::base_offset_in_bytes()));
 531 }
 532 
 533 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 534 // subtype of super_klass.
 535 //
 536 // Args:
 537 //      rax: superklass
 538 //      Rsub_klass: subklass
 539 //




 490   assert(cache != tmp, "must use different register");
 491   get_cache_index_at_bcp(tmp, bcp_offset, index_size);
 492   assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below");
 493   // convert from field index to ConstantPoolCacheEntry index
 494   // and from word offset to byte offset
 495   assert(exact_log2(in_bytes(ConstantPoolCacheEntry::size_in_bytes())) == 2 + LogBytesPerWord, "else change next line");
 496   shll(tmp, 2 + LogBytesPerWord);
 497   movptr(cache, Address(rbp, frame::interpreter_frame_cache_offset * wordSize));
 498   // skip past the header
 499   addptr(cache, in_bytes(ConstantPoolCache::base_offset()));
 500   addptr(cache, tmp);  // construct pointer to cache entry
 501 }
 502 
 503 // Load object from cpool->resolved_references(index)
 504 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 505                                            Register result, Register index) {
 506   assert_different_registers(result, index);
 507   // convert from field index to resolved_references() index and from
 508   // word index to byte offset. Since this is a java object, it can be compressed
 509   Register tmp = index;  // reuse

 510 
 511   get_constant_pool(result);
 512   // load pointer for resolved_references[] objArray
 513   movptr(result, Address(result, ConstantPool::cache_offset_in_bytes()));
 514   movptr(result, Address(result, ConstantPoolCache::resolved_references_offset_in_bytes()));
 515   resolve_oop_handle(result);
 516   load_heap_oop(result, Address(result, index,
 517                                 UseCompressedOops ? Address::times_4 : Address::times_ptr,
 518                                 arrayOopDesc::base_offset_in_bytes(T_OBJECT)));
 519   // The resulting oop is null if the reference is not yet resolved.
 520   // It is Universe::the_null_sentinel() if the reference resolved to NULL via condy.
 521 }
 522 
 523 // load cpool->resolved_klass_at(index)
 524 void InterpreterMacroAssembler::load_resolved_klass_at_index(Register cpool,
 525                                            Register index, Register klass) {
 526   movw(index, Address(cpool, index, Address::times_ptr, sizeof(ConstantPool)));
 527   Register resolved_klasses = cpool;
 528   movptr(resolved_klasses, Address(cpool, ConstantPool::resolved_klasses_offset_in_bytes()));
 529   movptr(klass, Address(resolved_klasses, index, Address::times_ptr, Array<Klass*>::base_offset_in_bytes()));
 530 }
 531 
 532 // Generate a subtype check: branch to ok_is_subtype if sub_klass is a
 533 // subtype of super_klass.
 534 //
 535 // Args:
 536 //      rax: superklass
 537 //      Rsub_klass: subklass
 538 //


< prev index next >