Mercurial > hg > truffle
comparison src/cpu/x86/vm/assembler_x86.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 006050192a5a |
children | 137868b7aa6f |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
55 AddressLiteral::AddressLiteral(address target, relocInfo::relocType rtype) { | 55 AddressLiteral::AddressLiteral(address target, relocInfo::relocType rtype) { |
56 _is_lval = false; | 56 _is_lval = false; |
57 _target = target; | 57 _target = target; |
58 switch (rtype) { | 58 switch (rtype) { |
59 case relocInfo::oop_type: | 59 case relocInfo::oop_type: |
60 case relocInfo::metadata_type: | |
60 // Oops are a special case. Normally they would be their own section | 61 // Oops are a special case. Normally they would be their own section |
61 // but in cases like icBuffer they are literals in the code stream that | 62 // but in cases like icBuffer they are literals in the code stream that |
62 // we don't have a section for. We use none so that we get a literal address | 63 // we don't have a section for. We use none so that we get a literal address |
63 // which is always patchable. | 64 // which is always patchable. |
64 break; | 65 break; |
152 | 153 |
153 | 154 |
154 // Convert the raw encoding form into the form expected by the constructor for | 155 // Convert the raw encoding form into the form expected by the constructor for |
155 // Address. An index of 4 (rsp) corresponds to having no index, so convert | 156 // Address. An index of 4 (rsp) corresponds to having no index, so convert |
156 // that to noreg for the Address constructor. | 157 // that to noreg for the Address constructor. |
157 Address Address::make_raw(int base, int index, int scale, int disp, bool disp_is_oop) { | 158 Address Address::make_raw(int base, int index, int scale, int disp, relocInfo::relocType disp_reloc) { |
158 RelocationHolder rspec; | 159 RelocationHolder rspec; |
159 if (disp_is_oop) { | 160 if (disp_reloc != relocInfo::none) { |
160 rspec = Relocation::spec_simple(relocInfo::oop_type); | 161 rspec = Relocation::spec_simple(disp_reloc); |
161 } | 162 } |
162 bool valid_index = index != rsp->encoding(); | 163 bool valid_index = index != rsp->encoding(); |
163 if (valid_index) { | 164 if (valid_index) { |
164 Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp)); | 165 Address madr(as_Register(base), as_Register(index), (Address::ScaleFactor)scale, in_ByteSize(disp)); |
165 madr._rspec = rspec; | 166 madr._rspec = rspec; |
266 } else { | 267 } else { |
267 emit_byte(op1); | 268 emit_byte(op1); |
268 emit_operand(rm, adr, 4); | 269 emit_operand(rm, adr, 4); |
269 emit_long(imm32); | 270 emit_long(imm32); |
270 } | 271 } |
271 } | |
272 | |
273 void Assembler::emit_arith(int op1, int op2, Register dst, jobject obj) { | |
274 LP64_ONLY(ShouldNotReachHere()); | |
275 assert(isByte(op1) && isByte(op2), "wrong opcode"); | |
276 assert((op1 & 0x01) == 1, "should be 32bit operation"); | |
277 assert((op1 & 0x02) == 0, "sign-extension bit should not be set"); | |
278 InstructionMark im(this); | |
279 emit_byte(op1); | |
280 emit_byte(op2 | encode(dst)); | |
281 emit_data((intptr_t)obj, relocInfo::oop_type, 0); | |
282 } | 272 } |
283 | 273 |
284 | 274 |
285 void Assembler::emit_arith(int op1, int op2, Register dst, Register src) { | 275 void Assembler::emit_arith(int op1, int op2, Register dst, Register src) { |
286 assert(isByte(op1) && isByte(op2), "wrong opcode"); | 276 assert(isByte(op1) && isByte(op2), "wrong opcode"); |
5570 int number_of_arguments) { | 5560 int number_of_arguments) { |
5571 call(RuntimeAddress(entry_point)); | 5561 call(RuntimeAddress(entry_point)); |
5572 increment(rsp, number_of_arguments * wordSize); | 5562 increment(rsp, number_of_arguments * wordSize); |
5573 } | 5563 } |
5574 | 5564 |
5565 void MacroAssembler::cmpklass(Address src1, Metadata* obj) { | |
5566 cmp_literal32(src1, (int32_t)obj, metadata_Relocation::spec_for_immediate()); | |
5567 } | |
5568 | |
5569 void MacroAssembler::cmpklass(Register src1, Metadata* obj) { | |
5570 cmp_literal32(src1, (int32_t)obj, metadata_Relocation::spec_for_immediate()); | |
5571 } | |
5572 | |
5575 void MacroAssembler::cmpoop(Address src1, jobject obj) { | 5573 void MacroAssembler::cmpoop(Address src1, jobject obj) { |
5576 cmp_literal32(src1, (int32_t)obj, oop_Relocation::spec_for_immediate()); | 5574 cmp_literal32(src1, (int32_t)obj, oop_Relocation::spec_for_immediate()); |
5577 } | 5575 } |
5578 | 5576 |
5579 void MacroAssembler::cmpoop(Register src1, jobject obj) { | 5577 void MacroAssembler::cmpoop(Register src1, jobject obj) { |
5751 | 5749 |
5752 void MacroAssembler::movoop(Address dst, jobject obj) { | 5750 void MacroAssembler::movoop(Address dst, jobject obj) { |
5753 mov_literal32(dst, (int32_t)obj, oop_Relocation::spec_for_immediate()); | 5751 mov_literal32(dst, (int32_t)obj, oop_Relocation::spec_for_immediate()); |
5754 } | 5752 } |
5755 | 5753 |
5754 void MacroAssembler::mov_metadata(Register dst, Metadata* obj) { | |
5755 mov_literal32(dst, (int32_t)obj, metadata_Relocation::spec_for_immediate()); | |
5756 } | |
5757 | |
5758 void MacroAssembler::mov_metadata(Address dst, Metadata* obj) { | |
5759 mov_literal32(dst, (int32_t)obj, metadata_Relocation::spec_for_immediate()); | |
5760 } | |
5761 | |
5756 void MacroAssembler::movptr(Register dst, AddressLiteral src) { | 5762 void MacroAssembler::movptr(Register dst, AddressLiteral src) { |
5757 if (src.is_lval()) { | 5763 if (src.is_lval()) { |
5758 mov_literal32(dst, (intptr_t)src.target(), src.rspec()); | 5764 mov_literal32(dst, (intptr_t)src.target(), src.rspec()); |
5759 } else { | 5765 } else { |
5760 movl(dst, as_Address(src)); | 5766 movl(dst, as_Address(src)); |
5802 | 5808 |
5803 void MacroAssembler::pushoop(jobject obj) { | 5809 void MacroAssembler::pushoop(jobject obj) { |
5804 push_literal32((int32_t)obj, oop_Relocation::spec_for_immediate()); | 5810 push_literal32((int32_t)obj, oop_Relocation::spec_for_immediate()); |
5805 } | 5811 } |
5806 | 5812 |
5813 void MacroAssembler::pushklass(Metadata* obj) { | |
5814 push_literal32((int32_t)obj, metadata_Relocation::spec_for_immediate()); | |
5815 } | |
5807 | 5816 |
5808 void MacroAssembler::pushptr(AddressLiteral src) { | 5817 void MacroAssembler::pushptr(AddressLiteral src) { |
5809 if (src.is_lval()) { | 5818 if (src.is_lval()) { |
5810 push_literal32((int32_t)src.target(), src.rspec()); | 5819 push_literal32((int32_t)src.target(), src.rspec()); |
5811 } else { | 5820 } else { |
5854 // To see where a verify_oop failed, get $ebx+40/X for this frame. | 5863 // To see where a verify_oop failed, get $ebx+40/X for this frame. |
5855 // This is the value of eip which points to where verify_oop will return. | 5864 // This is the value of eip which points to where verify_oop will return. |
5856 if (os::message_box(msg, "Execution stopped, print registers?")) { | 5865 if (os::message_box(msg, "Execution stopped, print registers?")) { |
5857 print_state32(rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax, eip); | 5866 print_state32(rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax, eip); |
5858 BREAKPOINT; | 5867 BREAKPOINT; |
5859 assert(false, "start up GDB"); | |
5860 } | 5868 } |
5861 } else { | 5869 } else { |
5862 ttyLocker ttyl; | 5870 ttyLocker ttyl; |
5863 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg); | 5871 ::tty->print_cr("=============== DEBUG MESSAGE: %s ================\n", msg); |
5872 } | |
5873 // Don't assert holding the ttyLock | |
5864 assert(false, err_msg("DEBUG MESSAGE: %s", msg)); | 5874 assert(false, err_msg("DEBUG MESSAGE: %s", msg)); |
5865 } | |
5866 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state); | 5875 ThreadStateTransition::transition(thread, _thread_in_vm, saved_state); |
5867 } | 5876 } |
5868 | 5877 |
5869 void MacroAssembler::print_state32(int rdi, int rsi, int rbp, int rsp, int rbx, int rdx, int rcx, int rax, int eip) { | 5878 void MacroAssembler::print_state32(int rdi, int rsi, int rbp, int rsp, int rbx, int rdx, int rcx, int rax, int eip) { |
5870 ttyLocker ttyl; | 5879 ttyLocker ttyl; |
6278 void MacroAssembler::movoop(Address dst, jobject obj) { | 6287 void MacroAssembler::movoop(Address dst, jobject obj) { |
6279 mov_literal64(rscratch1, (intptr_t)obj, oop_Relocation::spec_for_immediate()); | 6288 mov_literal64(rscratch1, (intptr_t)obj, oop_Relocation::spec_for_immediate()); |
6280 movq(dst, rscratch1); | 6289 movq(dst, rscratch1); |
6281 } | 6290 } |
6282 | 6291 |
6292 void MacroAssembler::mov_metadata(Register dst, Metadata* obj) { | |
6293 mov_literal64(dst, (intptr_t)obj, metadata_Relocation::spec_for_immediate()); | |
6294 } | |
6295 | |
6296 void MacroAssembler::mov_metadata(Address dst, Metadata* obj) { | |
6297 mov_literal64(rscratch1, (intptr_t)obj, metadata_Relocation::spec_for_immediate()); | |
6298 movq(dst, rscratch1); | |
6299 } | |
6300 | |
6283 void MacroAssembler::movptr(Register dst, AddressLiteral src) { | 6301 void MacroAssembler::movptr(Register dst, AddressLiteral src) { |
6284 if (src.is_lval()) { | 6302 if (src.is_lval()) { |
6285 mov_literal64(dst, (intptr_t)src.target(), src.rspec()); | 6303 mov_literal64(dst, (intptr_t)src.target(), src.rspec()); |
6286 } else { | 6304 } else { |
6287 if (reachable(src)) { | 6305 if (reachable(src)) { |
6316 mov64(dst, (intptr_t)src); | 6334 mov64(dst, (intptr_t)src); |
6317 } | 6335 } |
6318 | 6336 |
6319 void MacroAssembler::pushoop(jobject obj) { | 6337 void MacroAssembler::pushoop(jobject obj) { |
6320 movoop(rscratch1, obj); | 6338 movoop(rscratch1, obj); |
6339 push(rscratch1); | |
6340 } | |
6341 | |
6342 void MacroAssembler::pushklass(Metadata* obj) { | |
6343 mov_metadata(rscratch1, obj); | |
6321 push(rscratch1); | 6344 push(rscratch1); |
6322 } | 6345 } |
6323 | 6346 |
6324 void MacroAssembler::pushptr(AddressLiteral src) { | 6347 void MacroAssembler::pushptr(AddressLiteral src) { |
6325 lea(rscratch1, src); | 6348 lea(rscratch1, src); |
6653 lea(rscratch1, entry); | 6676 lea(rscratch1, entry); |
6654 Assembler::call(rscratch1); | 6677 Assembler::call(rscratch1); |
6655 } | 6678 } |
6656 } | 6679 } |
6657 | 6680 |
6681 void MacroAssembler::ic_call(address entry) { | |
6682 RelocationHolder rh = virtual_call_Relocation::spec(pc()); | |
6683 movptr(rax, (intptr_t)Universe::non_oop_word()); | |
6684 call(AddressLiteral(entry, rh)); | |
6685 } | |
6686 | |
6658 // Implementation of call_VM versions | 6687 // Implementation of call_VM versions |
6659 | 6688 |
6660 void MacroAssembler::call_VM(Register oop_result, | 6689 void MacroAssembler::call_VM(Register oop_result, |
6661 address entry_point, | 6690 address entry_point, |
6662 bool check_exceptions) { | 6691 bool check_exceptions) { |
6921 #endif // LP64 | 6950 #endif // LP64 |
6922 } | 6951 } |
6923 | 6952 |
6924 // get oop result if there is one and reset the value in the thread | 6953 // get oop result if there is one and reset the value in the thread |
6925 if (oop_result->is_valid()) { | 6954 if (oop_result->is_valid()) { |
6926 movptr(oop_result, Address(java_thread, JavaThread::vm_result_offset())); | 6955 get_vm_result(oop_result, java_thread); |
6927 movptr(Address(java_thread, JavaThread::vm_result_offset()), NULL_WORD); | |
6928 verify_oop(oop_result, "broken oop in call_VM_base"); | |
6929 } | 6956 } |
6930 } | 6957 } |
6931 | 6958 |
6932 void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions) { | 6959 void MacroAssembler::call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions) { |
6933 | 6960 |
7012 pass_arg2(this, arg_2); | 7039 pass_arg2(this, arg_2); |
7013 LP64_ONLY(assert(arg_0 != c_rarg1, "smashed arg")); | 7040 LP64_ONLY(assert(arg_0 != c_rarg1, "smashed arg")); |
7014 pass_arg1(this, arg_1); | 7041 pass_arg1(this, arg_1); |
7015 pass_arg0(this, arg_0); | 7042 pass_arg0(this, arg_0); |
7016 MacroAssembler::call_VM_leaf_base(entry_point, 4); | 7043 MacroAssembler::call_VM_leaf_base(entry_point, 4); |
7044 } | |
7045 | |
7046 void MacroAssembler::get_vm_result(Register oop_result, Register java_thread) { | |
7047 movptr(oop_result, Address(java_thread, JavaThread::vm_result_offset())); | |
7048 movptr(Address(java_thread, JavaThread::vm_result_offset()), NULL_WORD); | |
7049 verify_oop(oop_result, "broken oop in call_VM_base"); | |
7050 } | |
7051 | |
7052 void MacroAssembler::get_vm_result_2(Register metadata_result, Register java_thread) { | |
7053 movptr(metadata_result, Address(java_thread, JavaThread::vm_result_2_offset())); | |
7054 movptr(Address(java_thread, JavaThread::vm_result_2_offset()), NULL_WORD); | |
7017 } | 7055 } |
7018 | 7056 |
7019 void MacroAssembler::check_and_handle_earlyret(Register java_thread) { | 7057 void MacroAssembler::check_and_handle_earlyret(Register java_thread) { |
7020 } | 7058 } |
7021 | 7059 |
9095 assert_different_registers(recv_klass, intf_klass, method_result, scan_temp); | 9133 assert_different_registers(recv_klass, intf_klass, method_result, scan_temp); |
9096 assert(itable_index.is_constant() || itable_index.as_register() == method_result, | 9134 assert(itable_index.is_constant() || itable_index.as_register() == method_result, |
9097 "caller must use same register for non-constant itable index as for method"); | 9135 "caller must use same register for non-constant itable index as for method"); |
9098 | 9136 |
9099 // Compute start of first itableOffsetEntry (which is at the end of the vtable) | 9137 // Compute start of first itableOffsetEntry (which is at the end of the vtable) |
9100 int vtable_base = instanceKlass::vtable_start_offset() * wordSize; | 9138 int vtable_base = InstanceKlass::vtable_start_offset() * wordSize; |
9101 int itentry_off = itableMethodEntry::method_offset_in_bytes(); | 9139 int itentry_off = itableMethodEntry::method_offset_in_bytes(); |
9102 int scan_step = itableOffsetEntry::size() * wordSize; | 9140 int scan_step = itableOffsetEntry::size() * wordSize; |
9103 int vte_size = vtableEntry::size() * wordSize; | 9141 int vte_size = vtableEntry::size() * wordSize; |
9104 Address::ScaleFactor times_vte_scale = Address::times_ptr; | 9142 Address::ScaleFactor times_vte_scale = Address::times_ptr; |
9105 assert(vte_size == wordSize, "else adjust times_vte_scale"); | 9143 assert(vte_size == wordSize, "else adjust times_vte_scale"); |
9106 | 9144 |
9107 movl(scan_temp, Address(recv_klass, instanceKlass::vtable_length_offset() * wordSize)); | 9145 movl(scan_temp, Address(recv_klass, InstanceKlass::vtable_length_offset() * wordSize)); |
9108 | 9146 |
9109 // %%% Could store the aligned, prescaled offset in the klassoop. | 9147 // %%% Could store the aligned, prescaled offset in the klassoop. |
9110 lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); | 9148 lea(scan_temp, Address(recv_klass, scan_temp, times_vte_scale, vtable_base)); |
9111 if (HeapWordsPerLong > 1) { | 9149 if (HeapWordsPerLong > 1) { |
9112 // Round up to align_object_offset boundary | 9150 // Round up to align_object_offset boundary |
9113 // see code for instanceKlass::start_of_itable! | 9151 // see code for InstanceKlass::start_of_itable! |
9114 round_to(scan_temp, BytesPerLong); | 9152 round_to(scan_temp, BytesPerLong); |
9115 } | 9153 } |
9116 | 9154 |
9117 // Adjust recv_klass by scaled itable_index, so we can free itable_index. | 9155 // Adjust recv_klass by scaled itable_index, so we can free itable_index. |
9118 assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); | 9156 assert(itableMethodEntry::size() * wordSize == wordSize, "adjust the scaling in the code below"); |
9158 | 9196 |
9159 // virtual method calling | 9197 // virtual method calling |
9160 void MacroAssembler::lookup_virtual_method(Register recv_klass, | 9198 void MacroAssembler::lookup_virtual_method(Register recv_klass, |
9161 RegisterOrConstant vtable_index, | 9199 RegisterOrConstant vtable_index, |
9162 Register method_result) { | 9200 Register method_result) { |
9163 const int base = instanceKlass::vtable_start_offset() * wordSize; | 9201 const int base = InstanceKlass::vtable_start_offset() * wordSize; |
9164 assert(vtableEntry::size() * wordSize == wordSize, "else adjust the scaling in the code below"); | 9202 assert(vtableEntry::size() * wordSize == wordSize, "else adjust the scaling in the code below"); |
9165 Address vtable_entry_addr(recv_klass, | 9203 Address vtable_entry_addr(recv_klass, |
9166 vtable_index, Address::times_ptr, | 9204 vtable_index, Address::times_ptr, |
9167 base + vtableEntry::method_offset_in_bytes()); | 9205 base + vtableEntry::method_offset_in_bytes()); |
9168 movptr(method_result, vtable_entry_addr); | 9206 movptr(method_result, vtable_entry_addr); |
9333 #endif //PRODUCT | 9371 #endif //PRODUCT |
9334 | 9372 |
9335 // We will consult the secondary-super array. | 9373 // We will consult the secondary-super array. |
9336 movptr(rdi, secondary_supers_addr); | 9374 movptr(rdi, secondary_supers_addr); |
9337 // Load the array length. (Positive movl does right thing on LP64.) | 9375 // Load the array length. (Positive movl does right thing on LP64.) |
9338 movl(rcx, Address(rdi, arrayOopDesc::length_offset_in_bytes())); | 9376 movl(rcx, Address(rdi, Array<Klass*>::length_offset_in_bytes())); |
9339 // Skip to start of data. | 9377 // Skip to start of data. |
9340 addptr(rdi, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); | 9378 addptr(rdi, Array<Klass*>::base_offset_in_bytes()); |
9341 | 9379 |
9342 // Scan RCX words at [RDI] for an occurrence of RAX. | 9380 // Scan RCX words at [RDI] for an occurrence of RAX. |
9343 // Set NZ/Z based on last compare. | 9381 // Set NZ/Z based on last compare. |
9344 // Z flag value will not be set by 'repne' if RCX == 0 since 'repne' does | 9382 // Z flag value will not be set by 'repne' if RCX == 0 since 'repne' does |
9345 // not change flags (only scas instruction which is repeated sets flags). | 9383 // not change flags (only scas instruction which is repeated sets flags). |
9346 // Set Z = 0 (not equal) before 'repne' to indicate that class was not found. | 9384 // Set Z = 0 (not equal) before 'repne' to indicate that class was not found. |
9347 #ifdef _LP64 | 9385 |
9348 // This part is tricky, as values in supers array could be 32 or 64 bit wide | |
9349 // and we store values in objArrays always encoded, thus we need to encode | |
9350 // the value of rax before repne. Note that rax is dead after the repne. | |
9351 if (UseCompressedOops) { | |
9352 encode_heap_oop_not_null(rax); // Changes flags. | |
9353 // The superclass is never null; it would be a basic system error if a null | |
9354 // pointer were to sneak in here. Note that we have already loaded the | |
9355 // Klass::super_check_offset from the super_klass in the fast path, | |
9356 // so if there is a null in that register, we are already in the afterlife. | |
9357 testl(rax,rax); // Set Z = 0 | |
9358 repne_scanl(); | |
9359 } else | |
9360 #endif // _LP64 | |
9361 { | |
9362 testptr(rax,rax); // Set Z = 0 | 9386 testptr(rax,rax); // Set Z = 0 |
9363 repne_scan(); | 9387 repne_scan(); |
9364 } | 9388 |
9365 // Unspill the temp. registers: | 9389 // Unspill the temp. registers: |
9366 if (pushed_rdi) pop(rdi); | 9390 if (pushed_rdi) pop(rdi); |
9367 if (pushed_rcx) pop(rcx); | 9391 if (pushed_rcx) pop(rcx); |
9368 if (pushed_rax) pop(rax); | 9392 if (pushed_rax) pop(rax); |
9369 | 9393 |
9905 pop_CPU_state(); | 9929 pop_CPU_state(); |
9906 } | 9930 } |
9907 | 9931 |
9908 void MacroAssembler::load_klass(Register dst, Register src) { | 9932 void MacroAssembler::load_klass(Register dst, Register src) { |
9909 #ifdef _LP64 | 9933 #ifdef _LP64 |
9910 if (UseCompressedOops) { | 9934 if (UseCompressedKlassPointers) { |
9911 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 9935 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
9912 decode_heap_oop_not_null(dst); | 9936 decode_heap_oop_not_null(dst); |
9913 } else | 9937 } else |
9914 #endif | 9938 #endif |
9915 movptr(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 9939 movptr(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
9916 } | 9940 } |
9917 | 9941 |
9918 void MacroAssembler::load_prototype_header(Register dst, Register src) { | 9942 void MacroAssembler::load_prototype_header(Register dst, Register src) { |
9919 #ifdef _LP64 | 9943 #ifdef _LP64 |
9920 if (UseCompressedOops) { | 9944 if (UseCompressedKlassPointers) { |
9921 assert (Universe::heap() != NULL, "java heap should be initialized"); | 9945 assert (Universe::heap() != NULL, "java heap should be initialized"); |
9922 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); | 9946 movl(dst, Address(src, oopDesc::klass_offset_in_bytes())); |
9923 if (Universe::narrow_oop_shift() != 0) { | 9947 if (Universe::narrow_oop_shift() != 0) { |
9924 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); | 9948 assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong"); |
9925 if (LogMinObjAlignmentInBytes == Address::times_8) { | 9949 if (LogMinObjAlignmentInBytes == Address::times_8) { |
9940 } | 9964 } |
9941 } | 9965 } |
9942 | 9966 |
9943 void MacroAssembler::store_klass(Register dst, Register src) { | 9967 void MacroAssembler::store_klass(Register dst, Register src) { |
9944 #ifdef _LP64 | 9968 #ifdef _LP64 |
9945 if (UseCompressedOops) { | 9969 if (UseCompressedKlassPointers) { |
9946 encode_heap_oop_not_null(src); | 9970 encode_heap_oop_not_null(src); |
9947 movl(Address(dst, oopDesc::klass_offset_in_bytes()), src); | 9971 movl(Address(dst, oopDesc::klass_offset_in_bytes()), src); |
9948 } else | 9972 } else |
9949 #endif | 9973 #endif |
9950 movptr(Address(dst, oopDesc::klass_offset_in_bytes()), src); | 9974 movptr(Address(dst, oopDesc::klass_offset_in_bytes()), src); |
9951 } | 9975 } |
9952 | 9976 |
9953 void MacroAssembler::load_heap_oop(Register dst, Address src) { | 9977 void MacroAssembler::load_heap_oop(Register dst, Address src) { |
9954 #ifdef _LP64 | 9978 #ifdef _LP64 |
9979 // FIXME: Must change all places where we try to load the klass. | |
9955 if (UseCompressedOops) { | 9980 if (UseCompressedOops) { |
9956 movl(dst, src); | 9981 movl(dst, src); |
9957 decode_heap_oop(dst); | 9982 decode_heap_oop(dst); |
9958 } else | 9983 } else |
9959 #endif | 9984 #endif |
10014 #endif | 10039 #endif |
10015 } | 10040 } |
10016 | 10041 |
10017 #ifdef _LP64 | 10042 #ifdef _LP64 |
10018 void MacroAssembler::store_klass_gap(Register dst, Register src) { | 10043 void MacroAssembler::store_klass_gap(Register dst, Register src) { |
10019 if (UseCompressedOops) { | 10044 if (UseCompressedKlassPointers) { |
10020 // Store to klass gap in destination | 10045 // Store to klass gap in destination |
10021 movl(Address(dst, oopDesc::klass_gap_offset_in_bytes()), src); | 10046 movl(Address(dst, oopDesc::klass_gap_offset_in_bytes()), src); |
10022 } | 10047 } |
10023 } | 10048 } |
10024 | 10049 |