src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
changeset 48478 f3907e64eea2
parent 48127 efc459cf351e
child 48487 abf1d797e380
child 48701 48ce4b11bc17
equal deleted inserted replaced
48477:b7af6f568d00 48478:f3907e64eea2
  3740 void  MacroAssembler::decode_klass_not_null(Register r) {
  3740 void  MacroAssembler::decode_klass_not_null(Register r) {
  3741   decode_klass_not_null(r, r);
  3741   decode_klass_not_null(r, r);
  3742 }
  3742 }
  3743 
  3743 
  3744 void  MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
  3744 void  MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
  3745   assert (UseCompressedOops, "should only be used for compressed oops");
  3745 #ifdef ASSERT
  3746   assert (Universe::heap() != NULL, "java heap should be initialized");
  3746   {
  3747   assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
  3747     ThreadInVMfromUnknown tiv;
  3748 
  3748     assert (UseCompressedOops, "should only be used for compressed oops");
       
  3749     assert (Universe::heap() != NULL, "java heap should be initialized");
       
  3750     assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
       
  3751     assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
       
  3752   }
       
  3753 #endif
  3749   int oop_index = oop_recorder()->find_index(obj);
  3754   int oop_index = oop_recorder()->find_index(obj);
  3750   assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
       
  3751 
       
  3752   InstructionMark im(this);
  3755   InstructionMark im(this);
  3753   RelocationHolder rspec = oop_Relocation::spec(oop_index);
  3756   RelocationHolder rspec = oop_Relocation::spec(oop_index);
  3754   code_section()->relocate(inst_mark(), rspec);
  3757   code_section()->relocate(inst_mark(), rspec);
  3755   movz(dst, 0xDEAD, 16);
  3758   movz(dst, 0xDEAD, 16);
  3756   movk(dst, 0xBEEF);
  3759   movk(dst, 0xBEEF);
  4004 void MacroAssembler::movoop(Register dst, jobject obj, bool immediate) {
  4007 void MacroAssembler::movoop(Register dst, jobject obj, bool immediate) {
  4005   int oop_index;
  4008   int oop_index;
  4006   if (obj == NULL) {
  4009   if (obj == NULL) {
  4007     oop_index = oop_recorder()->allocate_oop_index(obj);
  4010     oop_index = oop_recorder()->allocate_oop_index(obj);
  4008   } else {
  4011   } else {
       
  4012 #ifdef ASSERT
       
  4013     {
       
  4014       ThreadInVMfromUnknown tiv;
       
  4015       assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
       
  4016     }
       
  4017 #endif
  4009     oop_index = oop_recorder()->find_index(obj);
  4018     oop_index = oop_recorder()->find_index(obj);
  4010     assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "should be real oop");
       
  4011   }
  4019   }
  4012   RelocationHolder rspec = oop_Relocation::spec(oop_index);
  4020   RelocationHolder rspec = oop_Relocation::spec(oop_index);
  4013   if (! immediate) {
  4021   if (! immediate) {
  4014     address dummy = address(uintptr_t(pc()) & -wordSize); // A nearby aligned address
  4022     address dummy = address(uintptr_t(pc()) & -wordSize); // A nearby aligned address
  4015     ldr_constant(dst, Address(dummy, rspec));
  4023     ldr_constant(dst, Address(dummy, rspec));
  4028   RelocationHolder rspec = metadata_Relocation::spec(oop_index);
  4036   RelocationHolder rspec = metadata_Relocation::spec(oop_index);
  4029   mov(dst, Address((address)obj, rspec));
  4037   mov(dst, Address((address)obj, rspec));
  4030 }
  4038 }
  4031 
  4039 
  4032 Address MacroAssembler::constant_oop_address(jobject obj) {
  4040 Address MacroAssembler::constant_oop_address(jobject obj) {
  4033   assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
  4041 #ifdef ASSERT
  4034   assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
  4042   {
       
  4043     ThreadInVMfromUnknown tiv;
       
  4044     assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
       
  4045     assert(Universe::heap()->is_in_reserved(JNIHandles::resolve(obj)), "not an oop");
       
  4046   }
       
  4047 #endif
  4035   int oop_index = oop_recorder()->find_index(obj);
  4048   int oop_index = oop_recorder()->find_index(obj);
  4036   return Address((address)obj, oop_Relocation::spec(oop_index));
  4049   return Address((address)obj, oop_Relocation::spec(oop_index));
  4037 }
  4050 }
  4038 
  4051 
  4039 // Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes.
  4052 // Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes.