< prev index next >

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Print this page

  62   // If no java_thread register is specified (noreg) than rdi will be used instead. call_VM_base
  63   // returns the register which contains the thread upon return. If a thread register has been
  64   // specified, the return value will correspond to that register. If no last_java_sp is specified
  65   // (noreg) than rsp will be used instead.
  66   virtual void call_VM_base(           // returns the register containing the thread upon return
  67     Register oop_result,               // where an oop-result ends up if any; use noreg otherwise
  68     Register java_thread,              // the thread if computed before     ; use noreg otherwise
  69     Register last_java_sp,             // to set up last_Java_frame in stubs; use noreg otherwise
  70     address  entry_point,              // the entry point
  71     int      number_of_arguments,      // the number of arguments (w/o thread) to pop after the call
  72     bool     check_exceptions          // whether to check for pending exceptions after return
  73   );
  74 
  75   void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);
  76 
  77   // helpers for FPU flag access
  78   // tmp is a temporary register, if none is available use noreg
  79   void save_rax   (Register tmp);
  80   void restore_rax(Register tmp);
  81 























  82  public:
  83   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
  84 
  85  // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
  86  // The implementation is only non-empty for the InterpreterMacroAssembler,
  87  // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
  88  virtual void check_and_handle_popframe(Register java_thread);
  89  virtual void check_and_handle_earlyret(Register java_thread);
  90 
  91   Address as_Address(AddressLiteral adr);
  92   Address as_Address(ArrayAddress adr);
  93 
  94   // Support for NULL-checks
  95   //
  96   // Generates code that causes a NULL OS exception if the content of reg is NULL.
  97   // If the accessed location is M[reg + offset] and the offset is known, provide the
  98   // offset. No explicit code generation is needed if the offset is within a certain
  99   // range (0 <= offset <= page_size).
 100 
 101   void null_check(Register reg, int offset = -1);

 328   void resolve_jobject(Register value, Register thread, Register tmp);
 329 
 330   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 331   void c2bool(Register x);
 332 
 333   // C++ bool manipulation
 334 
 335   void movbool(Register dst, Address src);
 336   void movbool(Address dst, bool boolconst);
 337   void movbool(Address dst, Register src);
 338   void testbool(Register dst);
 339 
 340   void resolve_oop_handle(Register result, Register tmp = rscratch2);
 341   void resolve_weak_handle(Register result, Register tmp);
 342   void load_mirror(Register mirror, Register method, Register tmp = rscratch2);
 343   void load_method_holder_cld(Register rresult, Register rmethod);
 344 
 345   void load_method_holder(Register holder, Register method);
 346 
 347   // oop manipulations
 348   void load_klass(Register dst, Register src, Register tmp);
 349   void store_klass(Register dst, Register src, Register tmp);




 350 
 351   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 352                       Register tmp1, Register thread_tmp);
 353   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
 354                        Register tmp1, Register tmp2, Register tmp3);
 355 
 356   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 357                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 358   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 359                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 360   void store_heap_oop(Address dst, Register src, Register tmp1 = noreg,
 361                       Register tmp2 = noreg, Register tmp3 = noreg, DecoratorSet decorators = 0);
 362 
 363   // Used for storing NULL. All other oop constants should be
 364   // stored using routines that take a jobject.
 365   void store_heap_oop_null(Address dst);
 366 
 367 #ifdef _LP64
 368   void store_klass_gap(Register dst, Register src);
 369 
 370   // This dummy is to prevent a call to store_heap_oop from
 371   // converting a zero (like NULL) into a Register by giving
 372   // the compiler two choices it can't resolve
 373 
 374   void store_heap_oop(Address dst, void* dummy);
 375 
 376   void encode_heap_oop(Register r);
 377   void decode_heap_oop(Register r);
 378   void encode_heap_oop_not_null(Register r);
 379   void decode_heap_oop_not_null(Register r);
 380   void encode_heap_oop_not_null(Register dst, Register src);
 381   void decode_heap_oop_not_null(Register dst, Register src);
 382 
 383   void set_narrow_oop(Register dst, jobject obj);
 384   void set_narrow_oop(Address dst, jobject obj);
 385   void cmp_narrow_oop(Register dst, jobject obj);
 386   void cmp_narrow_oop(Address dst, jobject obj);
 387 
 388   void encode_klass_not_null(Register r, Register tmp);
 389   void decode_klass_not_null(Register r, Register tmp);

  62   // If no java_thread register is specified (noreg) than rdi will be used instead. call_VM_base
  63   // returns the register which contains the thread upon return. If a thread register has been
  64   // specified, the return value will correspond to that register. If no last_java_sp is specified
  65   // (noreg) than rsp will be used instead.
  66   virtual void call_VM_base(           // returns the register containing the thread upon return
  67     Register oop_result,               // where an oop-result ends up if any; use noreg otherwise
  68     Register java_thread,              // the thread if computed before     ; use noreg otherwise
  69     Register last_java_sp,             // to set up last_Java_frame in stubs; use noreg otherwise
  70     address  entry_point,              // the entry point
  71     int      number_of_arguments,      // the number of arguments (w/o thread) to pop after the call
  72     bool     check_exceptions          // whether to check for pending exceptions after return
  73   );
  74 
  75   void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions = true);
  76 
  77   // helpers for FPU flag access
  78   // tmp is a temporary register, if none is available use noreg
  79   void save_rax   (Register tmp);
  80   void restore_rax(Register tmp);
  81 
  82  public:
  83 
  84   enum KlassDecodeMode {
  85     KlassDecodeNone,
  86     KlassDecodeZero,
  87     KlassDecodeXor,
  88     KlassDecodeAdd
  89   };
  90 
  91   // Return the current narrow Klass pointer decode mode. Initialized on first call.
  92   static KlassDecodeMode klass_decode_mode();
  93 
  94   // Given an arbitrary base address, return the KlassDecodeMode that would be used. Return KlassDecodeNone
  95   // if base address is not valid for encoding.
  96   static KlassDecodeMode klass_decode_mode_for_base(address base);
  97 
  98   // Returns a static string
  99   static const char* describe_klass_decode_mode(KlassDecodeMode mode);
 100 
 101  private:
 102 
 103   static KlassDecodeMode _klass_decode_mode;
 104 
 105  public:
 106   MacroAssembler(CodeBuffer* code) : Assembler(code) {}
 107 
 108  // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
 109  // The implementation is only non-empty for the InterpreterMacroAssembler,
 110  // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
 111  virtual void check_and_handle_popframe(Register java_thread);
 112  virtual void check_and_handle_earlyret(Register java_thread);
 113 
 114   Address as_Address(AddressLiteral adr);
 115   Address as_Address(ArrayAddress adr);
 116 
 117   // Support for NULL-checks
 118   //
 119   // Generates code that causes a NULL OS exception if the content of reg is NULL.
 120   // If the accessed location is M[reg + offset] and the offset is known, provide the
 121   // offset. No explicit code generation is needed if the offset is within a certain
 122   // range (0 <= offset <= page_size).
 123 
 124   void null_check(Register reg, int offset = -1);

 351   void resolve_jobject(Register value, Register thread, Register tmp);
 352 
 353   // C 'boolean' to Java boolean: x == 0 ? 0 : 1
 354   void c2bool(Register x);
 355 
 356   // C++ bool manipulation
 357 
 358   void movbool(Register dst, Address src);
 359   void movbool(Address dst, bool boolconst);
 360   void movbool(Address dst, Register src);
 361   void testbool(Register dst);
 362 
 363   void resolve_oop_handle(Register result, Register tmp = rscratch2);
 364   void resolve_weak_handle(Register result, Register tmp);
 365   void load_mirror(Register mirror, Register method, Register tmp = rscratch2);
 366   void load_method_holder_cld(Register rresult, Register rmethod);
 367 
 368   void load_method_holder(Register holder, Register method);
 369 
 370   // oop manipulations
 371   void load_klass(Register dst, Register src, Register tmp, bool null_check_src = false);
 372 #ifdef _LP64
 373   void load_nklass(Register dst, Register src);
 374 #else
 375   void store_klass(Register dst, Register src);
 376 #endif
 377 
 378   void access_load_at(BasicType type, DecoratorSet decorators, Register dst, Address src,
 379                       Register tmp1, Register thread_tmp);
 380   void access_store_at(BasicType type, DecoratorSet decorators, Address dst, Register src,
 381                        Register tmp1, Register tmp2, Register tmp3);
 382 
 383   void load_heap_oop(Register dst, Address src, Register tmp1 = noreg,
 384                      Register thread_tmp = noreg, DecoratorSet decorators = 0);
 385   void load_heap_oop_not_null(Register dst, Address src, Register tmp1 = noreg,
 386                               Register thread_tmp = noreg, DecoratorSet decorators = 0);
 387   void store_heap_oop(Address dst, Register src, Register tmp1 = noreg,
 388                       Register tmp2 = noreg, Register tmp3 = noreg, DecoratorSet decorators = 0);
 389 
 390   // Used for storing NULL. All other oop constants should be
 391   // stored using routines that take a jobject.
 392   void store_heap_oop_null(Address dst);
 393 
 394 #ifdef _LP64


 395   // This dummy is to prevent a call to store_heap_oop from
 396   // converting a zero (like NULL) into a Register by giving
 397   // the compiler two choices it can't resolve
 398 
 399   void store_heap_oop(Address dst, void* dummy);
 400 
 401   void encode_heap_oop(Register r);
 402   void decode_heap_oop(Register r);
 403   void encode_heap_oop_not_null(Register r);
 404   void decode_heap_oop_not_null(Register r);
 405   void encode_heap_oop_not_null(Register dst, Register src);
 406   void decode_heap_oop_not_null(Register dst, Register src);
 407 
 408   void set_narrow_oop(Register dst, jobject obj);
 409   void set_narrow_oop(Address dst, jobject obj);
 410   void cmp_narrow_oop(Register dst, jobject obj);
 411   void cmp_narrow_oop(Address dst, jobject obj);
 412 
 413   void encode_klass_not_null(Register r, Register tmp);
 414   void decode_klass_not_null(Register r, Register tmp);
< prev index next >