< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Print this page

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


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








  94 
  95  private:

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

 794                            Register scratch);
 795 
 796   void reset_last_Java_frame(Register thread);
 797 
 798   // thread in the default location (rthread)
 799   void reset_last_Java_frame(bool clear_fp);
 800 
 801   // Stores
 802   void store_check(Register obj);                // store check for obj - register is destroyed afterwards
 803   void store_check(Register obj, Address dst);   // same as above, dst is exact store location (reg. is destroyed)
 804 
 805   void resolve_jobject(Register value, Register thread, Register tmp);
 806 
 807   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 808   void c2bool(Register x);
 809 
 810   void load_method_holder_cld(Register rresult, Register rmethod);
 811   void load_method_holder(Register holder, Register method);
 812 
 813   // oop manipulations

 814   void load_klass(Register dst, Register src);
 815   void store_klass(Register dst, Register src);
 816   void cmp_klass(Register oop, Register trial_klass, Register tmp);
 817 
 818   void resolve_weak_handle(Register result, Register tmp);
 819   void resolve_oop_handle(Register result, Register tmp = r5);
 820   void load_mirror(Register dst, Register method, Register tmp = r5);
 821 
 822   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 823                       Register tmp1, Register tmp_thread);
 824 
 825   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
 826                        Register tmp1, Register tmp_thread);
 827 
 828   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 829                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 830 
 831   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 832                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 833   void store_heap_oop(Address dst, Register src, Register tmp1 = noreg,
 834                       Register tmp_thread = noreg, DecoratorSet decorators = 0);
 835 
 836   // currently unimplemented
 837   // Used for storing NULL. All other oop constants should be
 838   // stored using routines that take a jobject.
 839   void store_heap_oop_null(Address dst);
 840 
 841   void store_klass_gap(Register dst, Register src);
 842 
 843   // This dummy is to prevent a call to store_heap_oop from
 844   // converting a zero (like NULL) into a Register by giving
 845   // the compiler two choices it can't resolve
 846 
 847   void store_heap_oop(Address dst, void* dummy);
 848 
 849   void encode_heap_oop(Register d, Register s);
 850   void encode_heap_oop(Register r) { encode_heap_oop(r, r); }
 851   void decode_heap_oop(Register d, Register s);
 852   void decode_heap_oop(Register r) { decode_heap_oop(r, r); }
 853   void encode_heap_oop_not_null(Register r);
 854   void decode_heap_oop_not_null(Register r);
 855   void encode_heap_oop_not_null(Register dst, Register src);
 856   void decode_heap_oop_not_null(Register dst, Register src);
 857 
 858   void set_narrow_oop(Register dst, jobject obj);
 859 
 860   void encode_klass_not_null(Register r);
 861   void decode_klass_not_null(Register r);
 862   void encode_klass_not_null(Register dst, Register src);

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

 805                            Register scratch);
 806 
 807   void reset_last_Java_frame(Register thread);
 808 
 809   // thread in the default location (rthread)
 810   void reset_last_Java_frame(bool clear_fp);
 811 
 812   // Stores
 813   void store_check(Register obj);                // store check for obj - register is destroyed afterwards
 814   void store_check(Register obj, Address dst);   // same as above, dst is exact store location (reg. is destroyed)
 815 
 816   void resolve_jobject(Register value, Register thread, Register tmp);
 817 
 818   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 819   void c2bool(Register x);
 820 
 821   void load_method_holder_cld(Register rresult, Register rmethod);
 822   void load_method_holder(Register holder, Register method);
 823 
 824   // oop manipulations
 825   void load_nklass(Register dst, Register src);
 826   void load_klass(Register dst, Register src);

 827   void cmp_klass(Register oop, Register trial_klass, Register tmp);
 828 
 829   void resolve_weak_handle(Register result, Register tmp);
 830   void resolve_oop_handle(Register result, Register tmp = r5);
 831   void load_mirror(Register dst, Register method, Register tmp = r5);
 832 
 833   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 834                       Register tmp1, Register tmp_thread);
 835 
 836   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
 837                        Register tmp1, Register tmp_thread);
 838 
 839   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 840                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 841 
 842   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 843                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 844   void store_heap_oop(Address dst, Register src, Register tmp1 = noreg,
 845                       Register tmp_thread = noreg, DecoratorSet decorators = 0);
 846 
 847   // currently unimplemented
 848   // Used for storing NULL. All other oop constants should be
 849   // stored using routines that take a jobject.
 850   void store_heap_oop_null(Address dst);
 851 


 852   // This dummy is to prevent a call to store_heap_oop from
 853   // converting a zero (like NULL) into a Register by giving
 854   // the compiler two choices it can't resolve
 855 
 856   void store_heap_oop(Address dst, void* dummy);
 857 
 858   void encode_heap_oop(Register d, Register s);
 859   void encode_heap_oop(Register r) { encode_heap_oop(r, r); }
 860   void decode_heap_oop(Register d, Register s);
 861   void decode_heap_oop(Register r) { decode_heap_oop(r, r); }
 862   void encode_heap_oop_not_null(Register r);
 863   void decode_heap_oop_not_null(Register r);
 864   void encode_heap_oop_not_null(Register dst, Register src);
 865   void decode_heap_oop_not_null(Register dst, Register src);
 866 
 867   void set_narrow_oop(Register dst, jobject obj);
 868 
 869   void encode_klass_not_null(Register r);
 870   void decode_klass_not_null(Register r);
 871   void encode_klass_not_null(Register dst, Register src);
< prev index next >