< prev index next >

src/cpu/sparc/vm/interp_masm_sparc.cpp

Print this page


 738               // and from word index to byte offset
 739   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 740               // skip past the header
 741   add(tmp, in_bytes(ConstantPoolCache::base_offset()), tmp);
 742               // construct pointer to cache entry
 743   add(LcpoolCache, tmp, cache);
 744 }
 745 
 746 
 747 // Load object from cpool->resolved_references(index)
 748 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 749                                            Register result, Register index) {
 750   assert_different_registers(result, index);
 751   assert_not_delayed();
 752   // convert from field index to resolved_references() index and from
 753   // word index to byte offset. Since this is a java object, it can be compressed
 754   Register tmp = index;  // reuse
 755   sll(index, LogBytesPerHeapOop, tmp);
 756   get_constant_pool(result);
 757   // load pointer for resolved_references[] objArray
 758   ld_ptr(result, ConstantPool::resolved_references_offset_in_bytes(), result);

 759   // JNIHandles::resolve(result)
 760   ld_ptr(result, 0, result);
 761   // Add in the index
 762   add(result, tmp, result);
 763   load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result);


















 764 }
 765 
 766 
 767 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 768 // a subtype of super_klass.  Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
 769 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 770                                                   Register Rsuper_klass,
 771                                                   Register Rtmp1,
 772                                                   Register Rtmp2,
 773                                                   Register Rtmp3,
 774                                                   Label &ok_is_subtype ) {
 775   Label not_subtype;
 776 
 777   // Profile the not-null value's klass.
 778   profile_typecheck(Rsub_klass, Rtmp1);
 779 
 780   check_klass_subtype_fast_path(Rsub_klass, Rsuper_klass,
 781                                 Rtmp1, Rtmp2,
 782                                 &ok_is_subtype, &not_subtype, NULL);
 783 




 738               // and from word index to byte offset
 739   sll(tmp, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord), tmp);
 740               // skip past the header
 741   add(tmp, in_bytes(ConstantPoolCache::base_offset()), tmp);
 742               // construct pointer to cache entry
 743   add(LcpoolCache, tmp, cache);
 744 }
 745 
 746 
 747 // Load object from cpool->resolved_references(index)
 748 void InterpreterMacroAssembler::load_resolved_reference_at_index(
 749                                            Register result, Register index) {
 750   assert_different_registers(result, index);
 751   assert_not_delayed();
 752   // convert from field index to resolved_references() index and from
 753   // word index to byte offset. Since this is a java object, it can be compressed
 754   Register tmp = index;  // reuse
 755   sll(index, LogBytesPerHeapOop, tmp);
 756   get_constant_pool(result);
 757   // load pointer for resolved_references[] objArray
 758   ld_ptr(result, ConstantPool::cache_offset_in_bytes(), result);
 759   ld_ptr(result, ConstantPoolCache::resolved_references_offset_in_bytes(), result);
 760   // JNIHandles::resolve(result)
 761   ld_ptr(result, 0, result);
 762   // Add in the index
 763   add(result, tmp, result);
 764   load_heap_oop(result, arrayOopDesc::base_offset_in_bytes(T_OBJECT), result);
 765 }
 766 
 767 
 768 // load cpool->resolved_klass_at(index)
 769 void InterpreterMacroAssembler::load_resolved_klass_at_offset(Register Rcpool,
 770                                            Register Roffset, Register Rklass) {
 771   // int value = *this_cp->int_at_addr(which);
 772   // int resolved_klass_index = extract_low_short_from_int(value);
 773   //
 774   // Because SPARC is big-endian, the low_short is at (cpool->int_at_addr(which) + 2 bytes)
 775   add(Roffset, Rcpool, Roffset);
 776   lduh(Roffset, sizeof(ConstantPool) + 2, Roffset);  // Roffset = resolved_klass_index
 777 
 778   Register Rresolved_klasses = Rklass;
 779   ld_ptr(Rcpool, ConstantPool::resolved_klasses_offset_in_bytes(), Rresolved_klasses);
 780   sll(Roffset, LogBytesPerWord, Roffset); 
 781   add(Roffset, Array<Klass*>::base_offset_in_bytes(), Roffset);
 782   ld_ptr(Rresolved_klasses, Roffset, Rklass);
 783 }
 784 
 785 
 786 // Generate a subtype check: branch to ok_is_subtype if sub_klass is
 787 // a subtype of super_klass.  Blows registers Rsuper_klass, Rsub_klass, tmp1, tmp2.
 788 void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
 789                                                   Register Rsuper_klass,
 790                                                   Register Rtmp1,
 791                                                   Register Rtmp2,
 792                                                   Register Rtmp3,
 793                                                   Label &ok_is_subtype ) {
 794   Label not_subtype;
 795 
 796   // Profile the not-null value's klass.
 797   profile_typecheck(Rsub_klass, Rtmp1);
 798 
 799   check_klass_subtype_fast_path(Rsub_klass, Rsuper_klass,
 800                                 Rtmp1, Rtmp2,
 801                                 &ok_is_subtype, &not_subtype, NULL);
 802 


< prev index next >