src/cpu/sparc/vm/assembler_sparc.hpp

changeset 1162
6b2273dd6fa9
parent 1145
e5b0439ef4ae
child 1421
62001a362ce9
     1.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp	Mon Apr 20 14:48:03 2009 -0700
     1.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp	Tue Apr 21 11:16:30 2009 -0700
     1.3 @@ -274,21 +274,90 @@
     1.4  
     1.5  class Address VALUE_OBJ_CLASS_SPEC {
     1.6   private:
     1.7 -  Register              _base;
     1.8 -#ifdef _LP64
     1.9 -  int                   _hi32;          // bits 63::32
    1.10 -  int                   _low32;         // bits 31::0
    1.11 +  Register           _base;           // Base register.
    1.12 +  RegisterOrConstant _index_or_disp;  // Index register or constant displacement.
    1.13 +  RelocationHolder   _rspec;
    1.14 +
    1.15 + public:
    1.16 +  Address() : _base(noreg), _index_or_disp(noreg) {}
    1.17 +
    1.18 +  Address(Register base, RegisterOrConstant index_or_disp)
    1.19 +    : _base(base),
    1.20 +      _index_or_disp(index_or_disp) {
    1.21 +  }
    1.22 +
    1.23 +  Address(Register base, Register index)
    1.24 +    : _base(base),
    1.25 +      _index_or_disp(index) {
    1.26 +  }
    1.27 +
    1.28 +  Address(Register base, int disp)
    1.29 +    : _base(base),
    1.30 +      _index_or_disp(disp) {
    1.31 +  }
    1.32 +
    1.33 +#ifdef ASSERT
    1.34 +  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
    1.35 +  Address(Register base, ByteSize disp)
    1.36 +    : _base(base),
    1.37 +      _index_or_disp(in_bytes(disp)) {
    1.38 +  }
    1.39  #endif
    1.40 -  int                   _hi;
    1.41 -  int                   _disp;
    1.42 -  RelocationHolder      _rspec;
    1.43 -
    1.44 -  RelocationHolder rspec_from_rtype(relocInfo::relocType rt, address a = NULL) {
    1.45 -    switch (rt) {
    1.46 +
    1.47 +  // accessors
    1.48 +  Register base()      const { return _base; }
    1.49 +  Register index()     const { return _index_or_disp.as_register(); }
    1.50 +  int      disp()      const { return _index_or_disp.as_constant(); }
    1.51 +
    1.52 +  bool     has_index() const { return _index_or_disp.is_register(); }
    1.53 +  bool     has_disp()  const { return _index_or_disp.is_constant(); }
    1.54 +
    1.55 +  const relocInfo::relocType rtype() { return _rspec.type(); }
    1.56 +  const RelocationHolder&    rspec() { return _rspec; }
    1.57 +
    1.58 +  RelocationHolder rspec(int offset) const {
    1.59 +    return offset == 0 ? _rspec : _rspec.plus(offset);
    1.60 +  }
    1.61 +
    1.62 +  inline bool is_simm13(int offset = 0);  // check disp+offset for overflow
    1.63 +
    1.64 +  Address plus_disp(int plusdisp) const {     // bump disp by a small amount
    1.65 +    assert(_index_or_disp.is_constant(), "must have a displacement");
    1.66 +    Address a(base(), disp() + plusdisp);
    1.67 +    return a;
    1.68 +  }
    1.69 +
    1.70 +  Address after_save() const {
    1.71 +    Address a = (*this);
    1.72 +    a._base = a._base->after_save();
    1.73 +    return a;
    1.74 +  }
    1.75 +
    1.76 +  Address after_restore() const {
    1.77 +    Address a = (*this);
    1.78 +    a._base = a._base->after_restore();
    1.79 +    return a;
    1.80 +  }
    1.81 +
    1.82 +  // Convert the raw encoding form into the form expected by the
    1.83 +  // constructor for Address.
    1.84 +  static Address make_raw(int base, int index, int scale, int disp, bool disp_is_oop);
    1.85 +
    1.86 +  friend class Assembler;
    1.87 +};
    1.88 +
    1.89 +
    1.90 +class AddressLiteral VALUE_OBJ_CLASS_SPEC {
    1.91 + private:
    1.92 +  address          _address;
    1.93 +  RelocationHolder _rspec;
    1.94 +
    1.95 +  RelocationHolder rspec_from_rtype(relocInfo::relocType rtype, address addr) {
    1.96 +    switch (rtype) {
    1.97      case relocInfo::external_word_type:
    1.98 -      return external_word_Relocation::spec(a);
    1.99 +      return external_word_Relocation::spec(addr);
   1.100      case relocInfo::internal_word_type:
   1.101 -      return internal_word_Relocation::spec(a);
   1.102 +      return internal_word_Relocation::spec(addr);
   1.103  #ifdef _LP64
   1.104      case relocInfo::opt_virtual_call_type:
   1.105        return opt_virtual_call_Relocation::spec();
   1.106 @@ -305,127 +374,86 @@
   1.107      }
   1.108    }
   1.109  
   1.110 + protected:
   1.111 +  // creation
   1.112 +  AddressLiteral() : _address(NULL), _rspec(NULL) {}
   1.113 +
   1.114   public:
   1.115 -  Address(Register b, address a, relocInfo::relocType rt = relocInfo::none)
   1.116 -    : _rspec(rspec_from_rtype(rt, a))
   1.117 -  {
   1.118 -    _base  = b;
   1.119 +  AddressLiteral(address addr, RelocationHolder const& rspec)
   1.120 +    : _address(addr),
   1.121 +      _rspec(rspec) {}
   1.122 +
   1.123 +  // Some constructors to avoid casting at the call site.
   1.124 +  AddressLiteral(jobject obj, RelocationHolder const& rspec)
   1.125 +    : _address((address) obj),
   1.126 +      _rspec(rspec) {}
   1.127 +
   1.128 +  AddressLiteral(intptr_t value, RelocationHolder const& rspec)
   1.129 +    : _address((address) value),
   1.130 +      _rspec(rspec) {}
   1.131 +
   1.132 +  AddressLiteral(address addr, relocInfo::relocType rtype = relocInfo::none)
   1.133 +    : _address((address) addr),
   1.134 +    _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.135 +
   1.136 +  // Some constructors to avoid casting at the call site.
   1.137 +  AddressLiteral(address* addr, relocInfo::relocType rtype = relocInfo::none)
   1.138 +    : _address((address) addr),
   1.139 +    _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.140 +
   1.141 +  AddressLiteral(bool* addr, relocInfo::relocType rtype = relocInfo::none)
   1.142 +    : _address((address) addr),
   1.143 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.144 +
   1.145 +  AddressLiteral(const bool* addr, relocInfo::relocType rtype = relocInfo::none)
   1.146 +    : _address((address) addr),
   1.147 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.148 +
   1.149 +  AddressLiteral(signed char* addr, relocInfo::relocType rtype = relocInfo::none)
   1.150 +    : _address((address) addr),
   1.151 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.152 +
   1.153 +  AddressLiteral(int* addr, relocInfo::relocType rtype = relocInfo::none)
   1.154 +    : _address((address) addr),
   1.155 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.156 +
   1.157 +  AddressLiteral(intptr_t addr, relocInfo::relocType rtype = relocInfo::none)
   1.158 +    : _address((address) addr),
   1.159 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.160 +
   1.161  #ifdef _LP64
   1.162 -    _hi32  = (intptr_t)a >> 32;    // top 32 bits in 64 bit word
   1.163 -    _low32 = (intptr_t)a & ~0;     // low 32 bits in 64 bit word
   1.164 +  // 32-bit complains about a multiple declaration for int*.
   1.165 +  AddressLiteral(intptr_t* addr, relocInfo::relocType rtype = relocInfo::none)
   1.166 +    : _address((address) addr),
   1.167 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.168  #endif
   1.169 -    _hi    = (intptr_t)a & ~0x3ff; // top    22 bits in low word
   1.170 -    _disp  = (intptr_t)a &  0x3ff; // bottom 10 bits
   1.171 -  }
   1.172 -
   1.173 -  Address(Register b, address a, RelocationHolder const& rspec)
   1.174 -    : _rspec(rspec)
   1.175 -  {
   1.176 -    _base  = b;
   1.177 -#ifdef _LP64
   1.178 -    _hi32  = (intptr_t)a >> 32;    // top 32 bits in 64 bit word
   1.179 -    _low32 = (intptr_t)a & ~0;     // low 32 bits in 64 bit word
   1.180 -#endif
   1.181 -    _hi    = (intptr_t)a & ~0x3ff; // top    22 bits
   1.182 -    _disp  = (intptr_t)a &  0x3ff; // bottom 10 bits
   1.183 -  }
   1.184 -
   1.185 -  Address(Register b, intptr_t h, intptr_t d, RelocationHolder const& rspec = RelocationHolder())
   1.186 -    : _rspec(rspec)
   1.187 -  {
   1.188 -    _base  = b;
   1.189 -#ifdef _LP64
   1.190 -// [RGV] Put in Assert to force me to check usage of this constructor
   1.191 -     assert( h == 0, "Check usage of this constructor" );
   1.192 -    _hi32  = h;
   1.193 -    _low32 = d;
   1.194 -    _hi    = h;
   1.195 -    _disp  = d;
   1.196 -#else
   1.197 -    _hi    = h;
   1.198 -    _disp  = d;
   1.199 -#endif
   1.200 -  }
   1.201 -
   1.202 -  Address()
   1.203 -    : _rspec(RelocationHolder())
   1.204 -  {
   1.205 -    _base  = G0;
   1.206 -#ifdef _LP64
   1.207 -    _hi32  = 0;
   1.208 -    _low32 = 0;
   1.209 -#endif
   1.210 -    _hi    = 0;
   1.211 -    _disp  = 0;
   1.212 -  }
   1.213 -
   1.214 -  // fancier constructors
   1.215 -
   1.216 -  enum addr_type {
   1.217 -    extra_in_argument,  // in the In registers
   1.218 -    extra_out_argument  // in the Outs
   1.219 -  };
   1.220 -
   1.221 -  Address( addr_type, int );
   1.222 -
   1.223 -  // accessors
   1.224 -
   1.225 -  Register               base() const { return _base; }
   1.226 -#ifdef _LP64
   1.227 -  int                   hi32()  const { return _hi32; }
   1.228 -  int                   low32() const { return _low32; }
   1.229 -#endif
   1.230 -  int                      hi() const { return _hi;  }
   1.231 -  int                    disp() const { return _disp; }
   1.232 -#ifdef _LP64
   1.233 -  intptr_t              value() const { return ((intptr_t)_hi32 << 32) |
   1.234 -                                                (intptr_t)(uint32_t)_low32; }
   1.235 -#else
   1.236 -  int                   value() const { return _hi | _disp; }
   1.237 -#endif
   1.238 -  const relocInfo::relocType  rtype() { return _rspec.type(); }
   1.239 -  const RelocationHolder&     rspec() { return _rspec; }
   1.240 -
   1.241 -  RelocationHolder      rspec(int offset) const {
   1.242 +
   1.243 +  AddressLiteral(oop addr, relocInfo::relocType rtype = relocInfo::none)
   1.244 +    : _address((address) addr),
   1.245 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.246 +
   1.247 +  AddressLiteral(float* addr, relocInfo::relocType rtype = relocInfo::none)
   1.248 +    : _address((address) addr),
   1.249 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.250 +
   1.251 +  AddressLiteral(double* addr, relocInfo::relocType rtype = relocInfo::none)
   1.252 +    : _address((address) addr),
   1.253 +      _rspec(rspec_from_rtype(rtype, (address) addr)) {}
   1.254 +
   1.255 +  intptr_t value() const { return (intptr_t) _address; }
   1.256 +  int      low10() const;
   1.257 +
   1.258 +  const relocInfo::relocType rtype() const { return _rspec.type(); }
   1.259 +  const RelocationHolder&    rspec() const { return _rspec; }
   1.260 +
   1.261 +  RelocationHolder rspec(int offset) const {
   1.262      return offset == 0 ? _rspec : _rspec.plus(offset);
   1.263    }
   1.264 -
   1.265 -  inline bool is_simm13(int offset = 0);  // check disp+offset for overflow
   1.266 -
   1.267 -  Address plus_disp(int disp) const {     // bump disp by a small amount
   1.268 -    Address a = (*this);
   1.269 -    a._disp += disp;
   1.270 -    return a;
   1.271 -  }
   1.272 -
   1.273 -  Address split_disp() const {            // deal with disp overflow
   1.274 -    Address a = (*this);
   1.275 -    int hi_disp = _disp & ~0x3ff;
   1.276 -    if (hi_disp != 0) {
   1.277 -      a._disp -= hi_disp;
   1.278 -      a._hi   += hi_disp;
   1.279 -    }
   1.280 -    return a;
   1.281 -  }
   1.282 -
   1.283 -  Address after_save() const {
   1.284 -    Address a = (*this);
   1.285 -    a._base = a._base->after_save();
   1.286 -    return a;
   1.287 -  }
   1.288 -
   1.289 -  Address after_restore() const {
   1.290 -    Address a = (*this);
   1.291 -    a._base = a._base->after_restore();
   1.292 -    return a;
   1.293 -  }
   1.294 -
   1.295 -  friend class Assembler;
   1.296  };
   1.297  
   1.298  
   1.299  inline Address RegisterImpl::address_in_saved_window() const {
   1.300 -   return (Address(SP, 0, (sp_offset_in_saved_window() * wordSize) + STACK_BIAS));
   1.301 +   return (Address(SP, (sp_offset_in_saved_window() * wordSize) + STACK_BIAS));
   1.302  }
   1.303  
   1.304  
   1.305 @@ -495,11 +523,7 @@
   1.306    // When applied to a register-based argument, give the corresponding address
   1.307    // into the 6-word area "into which callee may store register arguments"
   1.308    // (This is a different place than the corresponding register-save area location.)
   1.309 -  Address address_in_frame() const {
   1.310 -    return Address( is_in()   ? Address::extra_in_argument
   1.311 -                              : Address::extra_out_argument,
   1.312 -                    _number );
   1.313 -  }
   1.314 +  Address address_in_frame() const;
   1.315  
   1.316    // debugging
   1.317    const char* name() const;
   1.318 @@ -521,6 +545,7 @@
   1.319  
   1.320  
   1.321    friend class AbstractAssembler;
   1.322 +  friend class AddressLiteral;
   1.323  
   1.324    // code patchers need various routines like inv_wdisp()
   1.325    friend class NativeInstruction;
   1.326 @@ -1093,11 +1118,11 @@
   1.327  
   1.328    // pp 135 (addc was addx in v8)
   1.329  
   1.330 -  inline void add(    Register s1, Register s2, Register d );
   1.331 -  inline void add(    Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none);
   1.332 -  inline void add(    Register s1, int simm13a, Register d, RelocationHolder const& rspec);
   1.333 -  inline void add(    Register s1, RegisterOrConstant s2, Register d, int offset = 0);
   1.334 -  inline void add(    const Address&  a,                  Register d, int offset = 0);
   1.335 +  inline void add(Register s1, Register s2, Register d );
   1.336 +  inline void add(Register s1, int simm13a, Register d, relocInfo::relocType rtype = relocInfo::none);
   1.337 +  inline void add(Register s1, int simm13a, Register d, RelocationHolder const& rspec);
   1.338 +  inline void add(Register s1, RegisterOrConstant s2, Register d, int offset = 0);
   1.339 +  inline void add(const Address& a, Register d, int offset = 0) { add( a.base(), a.disp() + offset, d, a.rspec(offset)); }
   1.340  
   1.341    void addcc(  Register s1, Register s2, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | rs2(s2) ); }
   1.342    void addcc(  Register s1, int simm13a, Register d ) { emit_long( op(arith_op) | rd(d) | op3(add_op3  | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); }
   1.343 @@ -1252,14 +1277,12 @@
   1.344    void jmpl( Register s1, Register s2, Register d );
   1.345    void jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec = RelocationHolder() );
   1.346  
   1.347 -  inline void jmpl( Address& a, Register d, int offset = 0);
   1.348 -
   1.349    // 171
   1.350  
   1.351 -  inline void ldf(    FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d );
   1.352 -  inline void ldf(    FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d );
   1.353 -
   1.354 -  inline void ldf(    FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0);
   1.355 +  inline void ldf(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d);
   1.356 +  inline void ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d, RelocationHolder const& rspec = RelocationHolder());
   1.357 +
   1.358 +  inline void ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0);
   1.359  
   1.360  
   1.361    inline void ldfsr(  Register s1, Register s2 );
   1.362 @@ -1303,15 +1326,20 @@
   1.363    inline void ldd(   Register s1, Register s2, Register d );
   1.364    inline void ldd(   Register s1, int simm13a, Register d);
   1.365  
   1.366 -  inline void ldsb( const Address& a, Register d, int offset = 0 );
   1.367 -  inline void ldsh( const Address& a, Register d, int offset = 0 );
   1.368 -  inline void ldsw( const Address& a, Register d, int offset = 0 );
   1.369 -  inline void ldub( const Address& a, Register d, int offset = 0 );
   1.370 -  inline void lduh( const Address& a, Register d, int offset = 0 );
   1.371 -  inline void lduw( const Address& a, Register d, int offset = 0 );
   1.372 -  inline void ldx(  const Address& a, Register d, int offset = 0 );
   1.373 -  inline void ld(   const Address& a, Register d, int offset = 0 );
   1.374 -  inline void ldd(  const Address& a, Register d, int offset = 0 );
   1.375 +#ifdef ASSERT
   1.376 +  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
   1.377 +  inline void ld(    Register s1, ByteSize simm13a, Register d);
   1.378 +#endif
   1.379 +
   1.380 +  inline void ldsb(const Address& a, Register d, int offset = 0);
   1.381 +  inline void ldsh(const Address& a, Register d, int offset = 0);
   1.382 +  inline void ldsw(const Address& a, Register d, int offset = 0);
   1.383 +  inline void ldub(const Address& a, Register d, int offset = 0);
   1.384 +  inline void lduh(const Address& a, Register d, int offset = 0);
   1.385 +  inline void lduw(const Address& a, Register d, int offset = 0);
   1.386 +  inline void ldx( const Address& a, Register d, int offset = 0);
   1.387 +  inline void ld(  const Address& a, Register d, int offset = 0);
   1.388 +  inline void ldd( const Address& a, Register d, int offset = 0);
   1.389  
   1.390    inline void ldub(  Register s1, RegisterOrConstant s2, Register d );
   1.391    inline void ldsb(  Register s1, RegisterOrConstant s2, Register d );
   1.392 @@ -1536,6 +1564,11 @@
   1.393    inline void std(  Register d, Register s1, Register s2 );
   1.394    inline void std(  Register d, Register s1, int simm13a);
   1.395  
   1.396 +#ifdef ASSERT
   1.397 +  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
   1.398 +  inline void st(   Register d, Register s1, ByteSize simm13a);
   1.399 +#endif
   1.400 +
   1.401    inline void stb(  Register d, const Address& a, int offset = 0 );
   1.402    inline void sth(  Register d, const Address& a, int offset = 0 );
   1.403    inline void stw(  Register d, const Address& a, int offset = 0 );
   1.404 @@ -1684,8 +1717,8 @@
   1.405  
   1.406  #define JMP2(r1, r2) jmp(r1, r2, __FILE__, __LINE__)
   1.407  #define JMP(r1, off) jmp(r1, off, __FILE__, __LINE__)
   1.408 -#define JUMP(a, off)     jump(a, off, __FILE__, __LINE__)
   1.409 -#define JUMPL(a, d, off) jumpl(a, d, off, __FILE__, __LINE__)
   1.410 +#define JUMP(a, temp, off)     jump(a, temp, off, __FILE__, __LINE__)
   1.411 +#define JUMPL(a, temp, d, off) jumpl(a, temp, d, off, __FILE__, __LINE__)
   1.412  
   1.413  
   1.414  class MacroAssembler: public Assembler {
   1.415 @@ -1830,17 +1863,26 @@
   1.416  #endif
   1.417  
   1.418    // sethi Macro handles optimizations and relocations
   1.419 -  void sethi( Address& a, bool ForceRelocatable = false );
   1.420 -  void sethi( intptr_t imm22a, Register d, bool ForceRelocatable = false, RelocationHolder const& rspec = RelocationHolder());
   1.421 +private:
   1.422 +  void internal_sethi(const AddressLiteral& addrlit, Register d, bool ForceRelocatable);
   1.423 +public:
   1.424 +  void sethi(const AddressLiteral& addrlit, Register d);
   1.425 +  void patchable_sethi(const AddressLiteral& addrlit, Register d);
   1.426  
   1.427    // compute the size of a sethi/set
   1.428    static int  size_of_sethi( address a, bool worst_case = false );
   1.429    static int  worst_case_size_of_set();
   1.430  
   1.431    // set may be either setsw or setuw (high 32 bits may be zero or sign)
   1.432 -  void set(    intptr_t value, Register d, RelocationHolder const& rspec = RelocationHolder() );
   1.433 -  void setsw(  int value, Register d, RelocationHolder const& rspec = RelocationHolder() );
   1.434 -  void set64(  jlong value, Register d, Register tmp);
   1.435 +private:
   1.436 +  void internal_set(const AddressLiteral& al, Register d, bool ForceRelocatable);
   1.437 +public:
   1.438 +  void set(const AddressLiteral& addrlit, Register d);
   1.439 +  void set(intptr_t value, Register d);
   1.440 +  void set(address addr, Register d, RelocationHolder const& rspec);
   1.441 +  void patchable_set(const AddressLiteral& addrlit, Register d);
   1.442 +  void patchable_set(intptr_t value, Register d);
   1.443 +  void set64(jlong value, Register d, Register tmp);
   1.444  
   1.445    // sign-extend 32 to 64
   1.446    inline void signx( Register s, Register d ) { sra( s, G0, d); }
   1.447 @@ -1930,24 +1972,22 @@
   1.448    inline void mov( int simm13a, Register d) { or3( G0, simm13a, d); }
   1.449  
   1.450    // address pseudos: make these names unlike instruction names to avoid confusion
   1.451 -  inline void split_disp(    Address& a, Register temp );
   1.452    inline intptr_t load_pc_address( Register reg, int bytes_to_skip );
   1.453 -  inline void load_address(  Address& a, int offset = 0 );
   1.454 -  inline void load_contents( Address& a, Register d, int offset = 0 );
   1.455 -  inline void load_ptr_contents( Address& a, Register d, int offset = 0 );
   1.456 -  inline void store_contents( Register s, Address& a, int offset = 0 );
   1.457 -  inline void store_ptr_contents( Register s, Address& a, int offset = 0 );
   1.458 -  inline void jumpl_to( Address& a, Register d, int offset = 0 );
   1.459 -  inline void jump_to(  Address& a,             int offset = 0 );
   1.460 -  inline void jump_indirect_to(  Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0 );
   1.461 +  inline void load_contents(AddressLiteral& addrlit, Register d, int offset = 0);
   1.462 +  inline void load_ptr_contents(AddressLiteral& addrlit, Register d, int offset = 0);
   1.463 +  inline void store_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
   1.464 +  inline void store_ptr_contents(Register s, AddressLiteral& addrlit, Register temp, int offset = 0);
   1.465 +  inline void jumpl_to(AddressLiteral& addrlit, Register temp, Register d, int offset = 0);
   1.466 +  inline void jump_to(AddressLiteral& addrlit, Register temp, int offset = 0);
   1.467 +  inline void jump_indirect_to(Address& a, Register temp, int ld_offset = 0, int jmp_offset = 0);
   1.468  
   1.469    // ring buffer traceable jumps
   1.470  
   1.471    void jmp2( Register r1, Register r2, const char* file, int line );
   1.472    void jmp ( Register r1, int offset,  const char* file, int line );
   1.473  
   1.474 -  void jumpl( Address& a, Register d, int offset, const char* file, int line );
   1.475 -  void jump ( Address& a,             int offset, const char* file, int line );
   1.476 +  void jumpl(AddressLiteral& addrlit, Register temp, Register d, int offset, const char* file, int line);
   1.477 +  void jump (AddressLiteral& addrlit, Register temp,             int offset, const char* file, int line);
   1.478  
   1.479  
   1.480    // argument pseudos:
   1.481 @@ -1972,29 +2012,31 @@
   1.482    // Functions for isolating 64 bit loads for LP64
   1.483    // ld_ptr will perform ld for 32 bit VM's and ldx for 64 bit VM's
   1.484    // st_ptr will perform st for 32 bit VM's and stx for 64 bit VM's
   1.485 -  inline void ld_ptr(   Register s1, Register s2, Register d );
   1.486 -  inline void ld_ptr(   Register s1, int simm13a, Register d);
   1.487 -  inline void ld_ptr(   Register s1, RegisterOrConstant s2, Register d );
   1.488 -  inline void ld_ptr(  const Address& a, Register d, int offset = 0 );
   1.489 -  inline void st_ptr(  Register d, Register s1, Register s2 );
   1.490 -  inline void st_ptr(  Register d, Register s1, int simm13a);
   1.491 -  inline void st_ptr(  Register d, Register s1, RegisterOrConstant s2 );
   1.492 -  inline void st_ptr(  Register d, const Address& a, int offset = 0 );
   1.493 +  inline void ld_ptr(Register s1, Register s2, Register d);
   1.494 +  inline void ld_ptr(Register s1, int simm13a, Register d);
   1.495 +  inline void ld_ptr(Register s1, RegisterOrConstant s2, Register d);
   1.496 +  inline void ld_ptr(const Address& a, Register d, int offset = 0);
   1.497 +  inline void st_ptr(Register d, Register s1, Register s2);
   1.498 +  inline void st_ptr(Register d, Register s1, int simm13a);
   1.499 +  inline void st_ptr(Register d, Register s1, RegisterOrConstant s2);
   1.500 +  inline void st_ptr(Register d, const Address& a, int offset = 0);
   1.501 +
   1.502 +#ifdef ASSERT
   1.503 +  // ByteSize is only a class when ASSERT is defined, otherwise it's an int.
   1.504 +  inline void ld_ptr(Register s1, ByteSize simm13a, Register d);
   1.505 +  inline void st_ptr(Register d, Register s1, ByteSize simm13a);
   1.506 +#endif
   1.507  
   1.508    // ld_long will perform ld for 32 bit VM's and ldx for 64 bit VM's
   1.509    // st_long will perform st for 32 bit VM's and stx for 64 bit VM's
   1.510 -  inline void ld_long( Register s1, Register s2, Register d );
   1.511 -  inline void ld_long( Register s1, int simm13a, Register d );
   1.512 -  inline void ld_long( Register s1, RegisterOrConstant s2, Register d );
   1.513 -  inline void ld_long( const Address& a, Register d, int offset = 0 );
   1.514 -  inline void st_long( Register d, Register s1, Register s2 );
   1.515 -  inline void st_long( Register d, Register s1, int simm13a );
   1.516 -  inline void st_long( Register d, Register s1, RegisterOrConstant s2 );
   1.517 -  inline void st_long( Register d, const Address& a, int offset = 0 );
   1.518 -
   1.519 -  // Loading values by size and signed-ness
   1.520 -  void load_sized_value(Register s1, RegisterOrConstant s2, Register d,
   1.521 -                        int size_in_bytes, bool is_signed);
   1.522 +  inline void ld_long(Register s1, Register s2, Register d);
   1.523 +  inline void ld_long(Register s1, int simm13a, Register d);
   1.524 +  inline void ld_long(Register s1, RegisterOrConstant s2, Register d);
   1.525 +  inline void ld_long(const Address& a, Register d, int offset = 0);
   1.526 +  inline void st_long(Register d, Register s1, Register s2);
   1.527 +  inline void st_long(Register d, Register s1, int simm13a);
   1.528 +  inline void st_long(Register d, Register s1, RegisterOrConstant s2);
   1.529 +  inline void st_long(Register d, const Address& a, int offset = 0);
   1.530  
   1.531    // Helpers for address formation.
   1.532    // They update the dest in place, whether it is a register or constant.
   1.533 @@ -2049,8 +2091,8 @@
   1.534    // These are idioms to flag the need for care with accessing bools but on
   1.535    // this platform we assume byte size
   1.536  
   1.537 -  inline void stbool( Register d, const Address& a, int offset = 0 ) { stb(d, a, offset); }
   1.538 -  inline void ldbool( const Address& a, Register d, int offset = 0 ) { ldsb( a, d, offset ); }
   1.539 +  inline void stbool(Register d, const Address& a) { stb(d, a); }
   1.540 +  inline void ldbool(const Address& a, Register d) { ldsb(a, d); }
   1.541    inline void tstbool( Register s ) { tst(s); }
   1.542    inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); }
   1.543  
   1.544 @@ -2060,7 +2102,7 @@
   1.545    void store_klass_gap(Register s, Register dst_oop);
   1.546  
   1.547     // oop manipulations
   1.548 -  void load_heap_oop(const Address& s, Register d, int offset = 0);
   1.549 +  void load_heap_oop(const Address& s, Register d);
   1.550    void load_heap_oop(Register s1, Register s2, Register d);
   1.551    void load_heap_oop(Register s1, int simm13a, Register d);
   1.552    void store_heap_oop(Register d, Register s1, Register s2);
   1.553 @@ -2190,11 +2232,11 @@
   1.554    void print_CPU_state();
   1.555  
   1.556    // oops in code
   1.557 -  Address allocate_oop_address( jobject obj, Register d ); // allocate_index
   1.558 -  Address constant_oop_address( jobject obj, Register d ); // find_index
   1.559 -  inline void set_oop         ( jobject obj, Register d ); // uses allocate_oop_address
   1.560 -  inline void set_oop_constant( jobject obj, Register d ); // uses constant_oop_address
   1.561 -  inline void set_oop         ( Address obj_addr );        // same as load_address
   1.562 +  AddressLiteral allocate_oop_address(jobject obj);                          // allocate_index
   1.563 +  AddressLiteral constant_oop_address(jobject obj);                          // find_index
   1.564 +  inline void    set_oop             (jobject obj, Register d);              // uses allocate_oop_address
   1.565 +  inline void    set_oop_constant    (jobject obj, Register d);              // uses constant_oop_address
   1.566 +  inline void    set_oop             (AddressLiteral& obj_addr, Register d); // same as load_address
   1.567  
   1.568    void set_narrow_oop( jobject obj, Register d );
   1.569  
   1.570 @@ -2410,7 +2452,8 @@
   1.571    // Conditionally (non-atomically) increments passed counter address, preserving condition codes.
   1.572    void cond_inc(Condition cond, address counter_addr, Register Rtemp1, Register Rtemp2);
   1.573    // Unconditional increment.
   1.574 -  void inc_counter(address counter_addr, Register Rtemp1, Register Rtemp2);
   1.575 +  void inc_counter(address counter_addr, Register Rtmp1, Register Rtmp2);
   1.576 +  void inc_counter(int*    counter_addr, Register Rtmp1, Register Rtmp2);
   1.577  
   1.578  #undef VIRTUAL
   1.579  

mercurial