< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Print this page

  65 
  66   // This is the base routine called by the different versions of call_VM. The interpreter
  67   // may customize this version by overriding it for its purposes (e.g., to save/restore
  68   // additional registers when doing a VM call).
  69   //
  70   // If no java_thread register is specified (noreg) than rthread will be used instead. call_VM_base
  71   // returns the register which contains the thread upon return. If a thread register has been
  72   // specified, the return value will correspond to that register. If no last_java_sp is specified
  73   // (noreg) than rsp will be used instead.
  74   virtual void call_VM_base(           // returns the register containing the thread upon return
  75     Register oop_result,               // where an oop-result ends up if any; use noreg otherwise
  76     Register java_thread,              // the thread if computed before     ; use noreg otherwise
  77     Register last_java_sp,             // to set up last_Java_frame in stubs; use noreg otherwise
  78     address  entry_point,              // the entry point
  79     int      number_of_arguments,      // the number of arguments (w/o thread) to pop after the call
  80     bool     check_exceptions          // whether to check for pending exceptions after return
  81   );
  82 
  83   void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);
  84 


  85   enum KlassDecodeMode {
  86     KlassDecodeNone,
  87     KlassDecodeZero,
  88     KlassDecodeXor,
  89     KlassDecodeMovk
  90   };
  91 
  92   KlassDecodeMode klass_decode_mode();








  93 
  94  private:

  95   static KlassDecodeMode _klass_decode_mode;
  96 
  97  public:
  98   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
  99 
 100  // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
 101  // The implementation is only non-empty for the InterpreterMacroAssembler,
 102  // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
 103  virtual void check_and_handle_popframe(Register java_thread);
 104  virtual void check_and_handle_earlyret(Register java_thread);
 105 
 106   void safepoint_poll(Label& slow_path, bool at_return, bool acquire, bool in_nmethod);
 107 
 108   // Helper functions for statistics gathering.
 109   // Unconditional atomic increment.
 110   void atomic_incw(Register counter_addr, Register tmp, Register tmp2);
 111   void atomic_incw(Address counter_addr, Register tmp1, Register tmp2, Register tmp3) {
 112     lea(tmp1, counter_addr);
 113     atomic_incw(tmp1, tmp2, tmp3);
 114   }

  65 
  66   // This is the base routine called by the different versions of call_VM. The interpreter
  67   // may customize this version by overriding it for its purposes (e.g., to save/restore
  68   // additional registers when doing a VM call).
  69   //
  70   // If no java_thread register is specified (noreg) than rthread will be used instead. call_VM_base
  71   // returns the register which contains the thread upon return. If a thread register has been
  72   // specified, the return value will correspond to that register. If no last_java_sp is specified
  73   // (noreg) than rsp will be used instead.
  74   virtual void call_VM_base(           // returns the register containing the thread upon return
  75     Register oop_result,               // where an oop-result ends up if any; use noreg otherwise
  76     Register java_thread,              // the thread if computed before     ; use noreg otherwise
  77     Register last_java_sp,             // to set up last_Java_frame in stubs; use noreg otherwise
  78     address  entry_point,              // the entry point
  79     int      number_of_arguments,      // the number of arguments (w/o thread) to pop after the call
  80     bool     check_exceptions          // whether to check for pending exceptions after return
  81   );
  82 
  83   void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);
  84 
  85  public:
  86 
  87   enum KlassDecodeMode {
  88     KlassDecodeNone,
  89     KlassDecodeZero,
  90     KlassDecodeXor,
  91     KlassDecodeMovk
  92   };
  93 
  94   // Return the current narrow Klass pointer decode mode. Initialized on first call.
  95   static KlassDecodeMode klass_decode_mode();
  96 
  97   // Given an arbitrary base address, return the KlassDecodeMode that would be used. Return KlassDecodeNone
  98   // if base address is not valid for encoding.
  99   static KlassDecodeMode klass_decode_mode_for_base(address base);
 100 
 101   // Returns a static string
 102   static const char* describe_klass_decode_mode(KlassDecodeMode mode);
 103 
 104  private:
 105 
 106   static KlassDecodeMode _klass_decode_mode;
 107 
 108  public:
 109   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
 110 
 111  // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
 112  // The implementation is only non-empty for the InterpreterMacroAssembler,
 113  // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
 114  virtual void check_and_handle_popframe(Register java_thread);
 115  virtual void check_and_handle_earlyret(Register java_thread);
 116 
 117   void safepoint_poll(Label& slow_path, bool at_return, bool acquire, bool in_nmethod);
 118 
 119   // Helper functions for statistics gathering.
 120   // Unconditional atomic increment.
 121   void atomic_incw(Register counter_addr, Register tmp, Register tmp2);
 122   void atomic_incw(Address counter_addr, Register tmp1, Register tmp2, Register tmp3) {
 123     lea(tmp1, counter_addr);
 124     atomic_incw(tmp1, tmp2, tmp3);
 125   }
< prev index next >