5236 }
5237 }
5238
5239 void MacroAssembler::clear_jweak_tag(Register possibly_jweak) {
5240 const int32_t inverted_jweak_mask = ~static_cast<int32_t>(JNIHandles::weak_tag_mask);
5241 STATIC_ASSERT(inverted_jweak_mask == -2); // otherwise check this code
5242 // The inverted mask is sign-extended
5243 andptr(possibly_jweak, inverted_jweak_mask);
5244 }
5245
5246 void MacroAssembler::resolve_jobject(Register value,
5247 Register thread,
5248 Register tmp) {
5249 assert_different_registers(value, thread, tmp);
5250 Label done, not_weak;
5251 testptr(value, value);
5252 jcc(Assembler::zero, done); // Use NULL as-is.
5253 testptr(value, JNIHandles::weak_tag_mask); // Test for jweak tag.
5254 jcc(Assembler::zero, not_weak);
5255 // Resolve jweak.
5256 access_load_at(T_OBJECT, IN_ROOT | ON_PHANTOM_OOP_REF,
5257 value, Address(value, -JNIHandles::weak_tag_value), tmp, thread);
5258 verify_oop(value);
5259 jmp(done);
5260 bind(not_weak);
5261 // Resolve (untagged) jobject.
5262 access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
5263 value, Address(value, 0), tmp, thread);
5264 verify_oop(value);
5265 bind(done);
5266 }
5267
5268 void MacroAssembler::subptr(Register dst, int32_t imm32) {
5269 LP64_ONLY(subq(dst, imm32)) NOT_LP64(subl(dst, imm32));
5270 }
5271
5272 // Force generation of a 4 byte immediate value even if it fits into 8bit
5273 void MacroAssembler::subptr_imm32(Register dst, int32_t imm32) {
5274 LP64_ONLY(subq_imm32(dst, imm32)) NOT_LP64(subl_imm32(dst, imm32));
5275 }
5276
|
5236 }
5237 }
5238
5239 void MacroAssembler::clear_jweak_tag(Register possibly_jweak) {
5240 const int32_t inverted_jweak_mask = ~static_cast<int32_t>(JNIHandles::weak_tag_mask);
5241 STATIC_ASSERT(inverted_jweak_mask == -2); // otherwise check this code
5242 // The inverted mask is sign-extended
5243 andptr(possibly_jweak, inverted_jweak_mask);
5244 }
5245
5246 void MacroAssembler::resolve_jobject(Register value,
5247 Register thread,
5248 Register tmp) {
5249 assert_different_registers(value, thread, tmp);
5250 Label done, not_weak;
5251 testptr(value, value);
5252 jcc(Assembler::zero, done); // Use NULL as-is.
5253 testptr(value, JNIHandles::weak_tag_mask); // Test for jweak tag.
5254 jcc(Assembler::zero, not_weak);
5255 // Resolve jweak.
5256 access_load_at(T_OBJECT, IN_NATIVE | ON_PHANTOM_OOP_REF,
5257 value, Address(value, -JNIHandles::weak_tag_value), tmp, thread);
5258 verify_oop(value);
5259 jmp(done);
5260 bind(not_weak);
5261 // Resolve (untagged) jobject.
5262 access_load_at(T_OBJECT, IN_CONCURRENT_ROOT,
5263 value, Address(value, 0), tmp, thread);
5264 verify_oop(value);
5265 bind(done);
5266 }
5267
5268 void MacroAssembler::subptr(Register dst, int32_t imm32) {
5269 LP64_ONLY(subq(dst, imm32)) NOT_LP64(subl(dst, imm32));
5270 }
5271
5272 // Force generation of a 4 byte immediate value even if it fits into 8bit
5273 void MacroAssembler::subptr_imm32(Register dst, int32_t imm32) {
5274 LP64_ONLY(subq_imm32(dst, imm32)) NOT_LP64(subl_imm32(dst, imm32));
5275 }
5276
|