src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 51756 4bd35a5ec694
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
    28 #include "c1/c1_Runtime1.hpp"
    28 #include "c1/c1_Runtime1.hpp"
    29 #include "classfile/systemDictionary.hpp"
    29 #include "classfile/systemDictionary.hpp"
    30 #include "gc/shared/collectedHeap.hpp"
    30 #include "gc/shared/collectedHeap.hpp"
    31 #include "interpreter/interpreter.hpp"
    31 #include "interpreter/interpreter.hpp"
    32 #include "oops/arrayOop.hpp"
    32 #include "oops/arrayOop.hpp"
    33 #include "oops/markOop.hpp"
    33 #include "oops/markWord.hpp"
    34 #include "runtime/basicLock.hpp"
    34 #include "runtime/basicLock.hpp"
    35 #include "runtime/biasedLocking.hpp"
    35 #include "runtime/biasedLocking.hpp"
    36 #include "runtime/os.hpp"
    36 #include "runtime/os.hpp"
    37 #include "runtime/sharedRuntime.hpp"
    37 #include "runtime/sharedRuntime.hpp"
    38 #include "runtime/stubRoutines.hpp"
    38 #include "runtime/stubRoutines.hpp"
    80   }
    80   }
    81 
    81 
    82   // Load object header
    82   // Load object header
    83   ldr(hdr, Address(obj, hdr_offset));
    83   ldr(hdr, Address(obj, hdr_offset));
    84   // and mark it as unlocked
    84   // and mark it as unlocked
    85   orr(hdr, hdr, markOopDesc::unlocked_value);
    85   orr(hdr, hdr, markWord::unlocked_value);
    86   // save unlocked object header into the displaced header location on the stack
    86   // save unlocked object header into the displaced header location on the stack
    87   str(hdr, Address(disp_hdr, 0));
    87   str(hdr, Address(disp_hdr, 0));
    88   // test if object header is still the same (i.e. unlocked), and if so, store the
    88   // test if object header is still the same (i.e. unlocked), and if so, store the
    89   // displaced header address in the object header - if it is not the same, get the
    89   // displaced header address in the object header - if it is not the same, get the
    90   // object header instead
    90   // object header instead
   174   if (UseBiasedLocking && !len->is_valid()) {
   174   if (UseBiasedLocking && !len->is_valid()) {
   175     assert_different_registers(obj, klass, len, t1, t2);
   175     assert_different_registers(obj, klass, len, t1, t2);
   176     ldr(t1, Address(klass, Klass::prototype_header_offset()));
   176     ldr(t1, Address(klass, Klass::prototype_header_offset()));
   177   } else {
   177   } else {
   178     // This assumes that all prototype bits fit in an int32_t
   178     // This assumes that all prototype bits fit in an int32_t
   179     mov(t1, (int32_t)(intptr_t)markOopDesc::prototype());
   179     mov(t1, (int32_t)(intptr_t)markWord::prototype().value());
   180   }
   180   }
   181   str(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
   181   str(t1, Address(obj, oopDesc::mark_offset_in_bytes()));
   182 
   182 
   183   if (UseCompressedClassPointers) { // Take care not to kill klass
   183   if (UseCompressedClassPointers) { // Take care not to kill klass
   184     encode_klass_not_null(t1, klass);
   184     encode_klass_not_null(t1, klass);
   329   cmp_klass(receiver, iCache, rscratch1);
   329   cmp_klass(receiver, iCache, rscratch1);
   330 }
   330 }
   331 
   331 
   332 
   332 
   333 void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
   333 void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
       
   334   assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
       
   335   // Make sure there is enough stack space for this method's activation.
       
   336   // Note that we do this before doing an enter().
       
   337   generate_stack_overflow_check(bang_size_in_bytes);
       
   338   MacroAssembler::build_frame(framesize + 2 * wordSize);
       
   339 }
       
   340 
       
   341 void C1_MacroAssembler::remove_frame(int framesize) {
       
   342   MacroAssembler::remove_frame(framesize + 2 * wordSize);
       
   343 }
       
   344 
       
   345 
       
   346 void C1_MacroAssembler::verified_entry() {
   334   // If we have to make this method not-entrant we'll overwrite its
   347   // If we have to make this method not-entrant we'll overwrite its
   335   // first instruction with a jump.  For this action to be legal we
   348   // first instruction with a jump.  For this action to be legal we
   336   // must ensure that this first instruction is a B, BL, NOP, BKPT,
   349   // must ensure that this first instruction is a B, BL, NOP, BKPT,
   337   // SVC, HVC, or SMC.  Make it a NOP.
   350   // SVC, HVC, or SMC.  Make it a NOP.
   338   nop();
   351   nop();
   339   assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
       
   340   // Make sure there is enough stack space for this method's activation.
       
   341   // Note that we do this before doing an enter().
       
   342   generate_stack_overflow_check(bang_size_in_bytes);
       
   343   MacroAssembler::build_frame(framesize + 2 * wordSize);
       
   344   if (NotifySimulator) {
       
   345     notify(Assembler::method_entry);
       
   346   }
       
   347 }
       
   348 
       
   349 void C1_MacroAssembler::remove_frame(int framesize) {
       
   350   MacroAssembler::remove_frame(framesize + 2 * wordSize);
       
   351   if (NotifySimulator) {
       
   352     notify(Assembler::method_reentry);
       
   353   }
       
   354 }
       
   355 
       
   356 
       
   357 void C1_MacroAssembler::verified_entry() {
       
   358 }
   352 }
   359 
   353 
   360 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
   354 void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
   361   // rbp, + 0: link
   355   // rbp, + 0: link
   362   //     + 1: return address
   356   //     + 1: return address