< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Print this page




4431     // Also, the condition codes are properly set Z/NZ on succeed/failure.
4432   }
4433 
4434   if (L_failure == &L_fallthrough)
4435         jccb(Assembler::notEqual, *L_failure);
4436   else  jcc(Assembler::notEqual, *L_failure);
4437 
4438   // Success.  Cache the super we found and proceed in triumph.
4439   movptr(super_cache_addr, super_klass);
4440 
4441   if (L_success != &L_fallthrough) {
4442     jmp(*L_success);
4443   }
4444 
4445 #undef IS_A_TEMP
4446 
4447   bind(L_fallthrough);
4448 }
4449 
4450 























4451 void MacroAssembler::cmov32(Condition cc, Register dst, Address src) {
4452   if (VM_Version::supports_cmov()) {
4453     cmovl(cc, dst, src);
4454   } else {
4455     Label L;
4456     jccb(negate_condition(cc), L);
4457     movl(dst, src);
4458     bind(L);
4459   }
4460 }
4461 
4462 void MacroAssembler::cmov32(Condition cc, Register dst, Register src) {
4463   if (VM_Version::supports_cmov()) {
4464     cmovl(cc, dst, src);
4465   } else {
4466     Label L;
4467     jccb(negate_condition(cc), L);
4468     movl(dst, src);
4469     bind(L);
4470   }


5004   // Either restore the x87 floating pointer control word after returning
5005   // from the JNI call or verify that it wasn't changed.
5006   if (CheckJNICalls) {
5007     call(RuntimeAddress(StubRoutines::x86::verify_fpu_cntrl_wrd_entry()));
5008   }
5009 #endif // _LP64
5010 }
5011 
5012 // ((OopHandle)result).resolve();
5013 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
5014   assert_different_registers(result, tmp);
5015 
5016   // Only 64 bit platforms support GCs that require a tmp register
5017   // Only IN_HEAP loads require a thread_tmp register
5018   // OopHandle::resolve is an indirection like jobject.
5019   access_load_at(T_OBJECT, IN_NATIVE,
5020                  result, Address(result, 0), tmp, /*tmp_thread*/noreg);
5021 }
5022 
5023 void MacroAssembler::load_mirror(Register mirror, Register method, Register tmp) {

5024   // get mirror
5025   const int mirror_offset = in_bytes(Klass::java_mirror_offset());
5026   movptr(mirror, Address(method, Method::const_offset()));
5027   movptr(mirror, Address(mirror, ConstMethod::constants_offset()));
5028   movptr(mirror, Address(mirror, ConstantPool::pool_holder_offset_in_bytes()));
5029   movptr(mirror, Address(mirror, mirror_offset));
5030   resolve_oop_handle(mirror, tmp);
5031 }
5032 






5033 void MacroAssembler::load_klass(Register dst, Register src) {
5034 #ifdef _LP64
5035   if (UseCompressedClassPointers) {
5036     movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5037     decode_klass_not_null(dst);
5038   } else
5039 #endif
5040     movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5041 }
5042 
5043 void MacroAssembler::load_prototype_header(Register dst, Register src) {
5044   load_klass(dst, src);
5045   movptr(dst, Address(dst, Klass::prototype_header_offset()));
5046 }
5047 
5048 void MacroAssembler::store_klass(Register dst, Register src) {
5049 #ifdef _LP64
5050   if (UseCompressedClassPointers) {
5051     encode_klass_not_null(src);
5052     movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);




4431     // Also, the condition codes are properly set Z/NZ on succeed/failure.
4432   }
4433 
4434   if (L_failure == &L_fallthrough)
4435         jccb(Assembler::notEqual, *L_failure);
4436   else  jcc(Assembler::notEqual, *L_failure);
4437 
4438   // Success.  Cache the super we found and proceed in triumph.
4439   movptr(super_cache_addr, super_klass);
4440 
4441   if (L_success != &L_fallthrough) {
4442     jmp(*L_success);
4443   }
4444 
4445 #undef IS_A_TEMP
4446 
4447   bind(L_fallthrough);
4448 }
4449 
4450 
4451 void MacroAssembler::clinit_barrier(Register klass, Register thread, Label* L_fast_path, Label* L_slow_path) {
4452   assert(L_fast_path != NULL || L_slow_path != NULL, "at least one is required");
4453 
4454   Label L_fallthrough;
4455   if (L_fast_path == NULL) {
4456     L_fast_path = &L_fallthrough;
4457   }
4458 
4459   // Fast path check: class is fully initialized
4460   cmpb(Address(klass, InstanceKlass::init_state_offset()), InstanceKlass::fully_initialized);
4461   jcc(Assembler::equal, *L_fast_path);
4462 
4463   // Fast path check: current thread is initializer thread
4464   cmpptr(thread, Address(klass, InstanceKlass::init_thread_offset()));
4465   if (L_slow_path != NULL) {
4466     jcc(Assembler::notEqual, *L_slow_path);
4467   } else {
4468     jcc(Assembler::equal, *L_fast_path);
4469   }
4470 
4471   bind(L_fallthrough);
4472 }
4473 
4474 void MacroAssembler::cmov32(Condition cc, Register dst, Address src) {
4475   if (VM_Version::supports_cmov()) {
4476     cmovl(cc, dst, src);
4477   } else {
4478     Label L;
4479     jccb(negate_condition(cc), L);
4480     movl(dst, src);
4481     bind(L);
4482   }
4483 }
4484 
4485 void MacroAssembler::cmov32(Condition cc, Register dst, Register src) {
4486   if (VM_Version::supports_cmov()) {
4487     cmovl(cc, dst, src);
4488   } else {
4489     Label L;
4490     jccb(negate_condition(cc), L);
4491     movl(dst, src);
4492     bind(L);
4493   }


5027   // Either restore the x87 floating pointer control word after returning
5028   // from the JNI call or verify that it wasn't changed.
5029   if (CheckJNICalls) {
5030     call(RuntimeAddress(StubRoutines::x86::verify_fpu_cntrl_wrd_entry()));
5031   }
5032 #endif // _LP64
5033 }
5034 
5035 // ((OopHandle)result).resolve();
5036 void MacroAssembler::resolve_oop_handle(Register result, Register tmp) {
5037   assert_different_registers(result, tmp);
5038 
5039   // Only 64 bit platforms support GCs that require a tmp register
5040   // Only IN_HEAP loads require a thread_tmp register
5041   // OopHandle::resolve is an indirection like jobject.
5042   access_load_at(T_OBJECT, IN_NATIVE,
5043                  result, Address(result, 0), tmp, /*tmp_thread*/noreg);
5044 }
5045 
5046 void MacroAssembler::load_mirror(Register mirror, Register method, Register tmp) {
5047   load_method_holder(mirror, method);
5048   // get mirror
5049   const int mirror_offset = in_bytes(Klass::java_mirror_offset());



5050   movptr(mirror, Address(mirror, mirror_offset));
5051   resolve_oop_handle(mirror, tmp);
5052 }
5053 
5054 void MacroAssembler::load_method_holder(Register holder, Register method) {
5055   movptr(holder, Address(method, Method::const_offset()));                      // ConstMethod*
5056   movptr(holder, Address(holder, ConstMethod::constants_offset()));             // ConstantPool*
5057   movptr(holder, Address(holder, ConstantPool::pool_holder_offset_in_bytes())); // InstanceKlass*
5058 }
5059 
5060 void MacroAssembler::load_klass(Register dst, Register src) {
5061 #ifdef _LP64
5062   if (UseCompressedClassPointers) {
5063     movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5064     decode_klass_not_null(dst);
5065   } else
5066 #endif
5067     movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
5068 }
5069 
5070 void MacroAssembler::load_prototype_header(Register dst, Register src) {
5071   load_klass(dst, src);
5072   movptr(dst, Address(dst, Klass::prototype_header_offset()));
5073 }
5074 
5075 void MacroAssembler::store_klass(Register dst, Register src) {
5076 #ifdef _LP64
5077   if (UseCompressedClassPointers) {
5078     encode_klass_not_null(src);
5079     movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);


< prev index next >