< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Print this page




3437   testl(temp_reg, temp_reg);
3438   jcc(Assembler::notZero, is_flattenable);
3439 }
3440 
3441 void MacroAssembler::test_field_is_not_flattenable(Register flags, Register temp_reg, Label& notFlattenable) {
3442   movl(temp_reg, flags);
3443   shrl(temp_reg, ConstantPoolCacheEntry::is_flattenable_field_shift);
3444   andl(temp_reg, 0x1);
3445   testl(temp_reg, temp_reg);
3446   jcc(Assembler::zero, notFlattenable);
3447 }
3448 
3449 void MacroAssembler::test_field_is_flattened(Register flags, Register temp_reg, Label& is_flattened) {
3450   movl(temp_reg, flags);
3451   shrl(temp_reg, ConstantPoolCacheEntry::is_flattened_field_shift);
3452   andl(temp_reg, 0x1);
3453   testl(temp_reg, temp_reg);
3454   jcc(Assembler::notZero, is_flattened);
3455 }
3456 
3457 void MacroAssembler::test_flat_array_klass(Register klass, Register temp_reg,
3458                                            Label& is_flat_array) {
3459   movl(temp_reg, Address(klass, Klass::layout_helper_offset()));
3460   sarl(temp_reg, Klass::_lh_array_tag_shift);
3461   cmpl(temp_reg, Klass::_lh_array_tag_vt_value);
3462   jcc(Assembler::equal, is_flat_array);
3463 }
3464 
3465 
3466 void MacroAssembler::test_flat_array_oop(Register oop, Register temp_reg,
3467                                          Label& is_flat_array) {
3468   load_klass(temp_reg, oop);
3469   test_flat_array_klass(temp_reg, temp_reg, is_flat_array);
3470 }
3471 
3472 void MacroAssembler::os_breakpoint() {
3473   // instead of directly emitting a breakpoint, call os:breakpoint for better debugability
3474   // (e.g., MSVC can't call ps() otherwise)
3475   call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
3476 }
3477 
3478 void MacroAssembler::unimplemented(const char* what) {
3479   const char* buf = NULL;
3480   {
3481     ResourceMark rm;
3482     stringStream ss;
3483     ss.print("unimplemented: %s", what);
3484     buf = code_string(ss.as_string());
3485   }
3486   stop(buf);
3487 }
3488 
3489 #ifdef _LP64


5071 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
5072   assert_different_registers(result, tmp);
5073 
5074   // Only 64 bit platforms support GCs that require a tmp register
5075   // Only IN_HEAP loads require a thread_tmp register
5076   // OopHandle::resolve is an indirection like jobject.
5077   access_load_at(T_OBJECT, IN_NATIVE,
5078                  result, Address(result, 0), tmp, /*tmp_thread*/noreg);
5079 }
5080 
5081 void MacroAssembler::load_mirror(Register mirror, Register method, Register tmp) {
5082   // get mirror
5083   const int mirror_offset = in_bytes(Klass::java_mirror_offset());
5084   movptr(mirror, Address(method, Method::const_offset()));
5085   movptr(mirror, Address(mirror, ConstMethod::constants_offset()));
5086   movptr(mirror, Address(mirror, ConstantPool::pool_holder_offset_in_bytes()));
5087   movptr(mirror, Address(mirror, mirror_offset));
5088   resolve_oop_handle(mirror, tmp);
5089 }
5090 

















5091 void MacroAssembler::load_klass(Register dst, Register src) {

5092 #ifdef _LP64
5093   if (UseCompressedClassPointers) {
5094     movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5095     decode_klass_not_null(dst);
5096   } else
5097 #endif
5098     movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));







5099 }
5100 
5101 void MacroAssembler::load_prototype_header(Register dst, Register src) {
5102   load_klass(dst, src);
5103   movptr(dst, Address(dst, Klass::prototype_header_offset()));
5104 }
5105 
5106 void MacroAssembler::store_klass(Register dst, Register src) {
5107 #ifdef _LP64
5108   if (UseCompressedClassPointers) {
5109     encode_klass_not_null(src);
5110     movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
5111   } else
5112 #endif
5113     movptr(Address(dst, oopDesc::klass_offset_in_bytes()), src);
5114 }
5115 
5116 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
5117                                     Register tmp1, Register thread_tmp) {
5118   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();




3437   testl(temp_reg, temp_reg);
3438   jcc(Assembler::notZero, is_flattenable);
3439 }
3440 
3441 void MacroAssembler::test_field_is_not_flattenable(Register flags, Register temp_reg, Label& notFlattenable) {
3442   movl(temp_reg, flags);
3443   shrl(temp_reg, ConstantPoolCacheEntry::is_flattenable_field_shift);
3444   andl(temp_reg, 0x1);
3445   testl(temp_reg, temp_reg);
3446   jcc(Assembler::zero, notFlattenable);
3447 }
3448 
3449 void MacroAssembler::test_field_is_flattened(Register flags, Register temp_reg, Label& is_flattened) {
3450   movl(temp_reg, flags);
3451   shrl(temp_reg, ConstantPoolCacheEntry::is_flattened_field_shift);
3452   andl(temp_reg, 0x1);
3453   testl(temp_reg, temp_reg);
3454   jcc(Assembler::notZero, is_flattened);
3455 }
3456 
3457 void MacroAssembler::test_flattened_array_oop(Register oop, Register temp_reg,
3458                                               Label&is_flattened_array) {
3459   load_storage_props(temp_reg, oop);
3460   testb(temp_reg, ArrayStorageProperties::flattened_value);
3461   jcc(Assembler::notZero, is_flattened_array);

3462 }
3463 
3464 void MacroAssembler::test_null_free_array_oop(Register oop, Register temp_reg, Label&is_null_free_array) {
3465   load_storage_props(temp_reg, oop);
3466   testb(temp_reg, ArrayStorageProperties::null_free_value);
3467   jcc(Assembler::notZero, is_null_free_array);

3468 }
3469 
3470 void MacroAssembler::os_breakpoint() {
3471   // instead of directly emitting a breakpoint, call os:breakpoint for better debugability
3472   // (e.g., MSVC can't call ps() otherwise)
3473   call(RuntimeAddress(CAST_FROM_FN_PTR(address, os::breakpoint)));
3474 }
3475 
3476 void MacroAssembler::unimplemented(const char* what) {
3477   const char* buf = NULL;
3478   {
3479     ResourceMark rm;
3480     stringStream ss;
3481     ss.print("unimplemented: %s", what);
3482     buf = code_string(ss.as_string());
3483   }
3484   stop(buf);
3485 }
3486 
3487 #ifdef _LP64


5069 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
5070   assert_different_registers(result, tmp);
5071 
5072   // Only 64 bit platforms support GCs that require a tmp register
5073   // Only IN_HEAP loads require a thread_tmp register
5074   // OopHandle::resolve is an indirection like jobject.
5075   access_load_at(T_OBJECT, IN_NATIVE,
5076                  result, Address(result, 0), tmp, /*tmp_thread*/noreg);
5077 }
5078 
5079 void MacroAssembler::load_mirror(Register mirror, Register method, Register tmp) {
5080   // get mirror
5081   const int mirror_offset = in_bytes(Klass::java_mirror_offset());
5082   movptr(mirror, Address(method, Method::const_offset()));
5083   movptr(mirror, Address(mirror, ConstMethod::constants_offset()));
5084   movptr(mirror, Address(mirror, ConstantPool::pool_holder_offset_in_bytes()));
5085   movptr(mirror, Address(mirror, mirror_offset));
5086   resolve_oop_handle(mirror, tmp);
5087 }
5088 
5089 void MacroAssembler::load_metadata(Register dst, Register src) {
5090   if (UseCompressedClassPointers) {
5091     movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5092   } else {
5093     movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5094   }
5095 }
5096 
5097 void MacroAssembler::load_storage_props(Register dst, Register src) {
5098   load_metadata(dst, src);
5099   if (UseCompressedClassPointers) {
5100     shrl(dst, oopDesc::narrow_storage_props_shift);
5101   } else {
5102     shrq(dst, oopDesc::wide_storage_props_shift);
5103   }
5104 }
5105 
5106 void MacroAssembler::load_klass(Register dst, Register src) {
5107   load_metadata(dst, src);
5108 #ifdef _LP64
5109   if (UseCompressedClassPointers) {
5110     andl(dst, oopDesc::compressed_klass_mask());
5111     decode_klass_not_null(dst);
5112   } else
5113 #endif
5114   {
5115 #ifdef _LP64
5116     shlq(dst, oopDesc::storage_props_nof_bits);
5117     shrq(dst, oopDesc::storage_props_nof_bits);
5118 #else
5119     andl(dst, oopDesc::wide_klass_mask());
5120 #endif
5121   }
5122 }
5123 
5124 void MacroAssembler::load_prototype_header(Register dst, Register src) {
5125   load_klass(dst, src);
5126   movptr(dst, Address(dst, Klass::prototype_header_offset()));
5127 }
5128 
5129 void MacroAssembler::store_klass(Register dst, Register src) {
5130 #ifdef _LP64
5131   if (UseCompressedClassPointers) {
5132     encode_klass_not_null(src);
5133     movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
5134   } else
5135 #endif
5136     movptr(Address(dst, oopDesc::klass_offset_in_bytes()), src);
5137 }
5138 
5139 void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
5140                                     Register tmp1, Register thread_tmp) {
5141   BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();


< prev index next >