src/cpu/sparc/vm/assembler_sparc.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/sparc/vm/assembler_sparc.hpp Thu Jun 2 14:56:56 2011
--- new/src/cpu/sparc/vm/assembler_sparc.hpp Thu Jun 2 14:56:56 2011
*** 314,323 ****
--- 314,325 ----
int disp() const { return _index_or_disp.as_constant(); }
bool has_index() const { return _index_or_disp.is_register(); }
bool has_disp() const { return _index_or_disp.is_constant(); }
+ bool uses(Register reg) const { return base() == reg || (has_index() && index() == reg); }
+
const relocInfo::relocType rtype() { return _rspec.type(); }
const RelocationHolder& rspec() { return _rspec; }
RelocationHolder rspec(int offset) const {
return offset == 0 ? _rspec : _rspec.plus(offset);
*** 328,337 ****
--- 330,343 ----
Address plus_disp(int plusdisp) const { // bump disp by a small amount
assert(_index_or_disp.is_constant(), "must have a displacement");
Address a(base(), disp() + plusdisp);
return a;
}
+ bool is_same_address(Address a) const {
+ // disregard _rspec
+ return base() == a.base() && (has_index() ? index() == a.index() : disp() == a.disp());
+ }
Address after_save() const {
Address a = (*this);
a._base = a._base->after_save();
return a;
*** 434,443 ****
--- 440,453 ----
AddressLiteral(oop addr, relocInfo::relocType rtype = relocInfo::none)
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}
+ AddressLiteral(oop* addr, relocInfo::relocType rtype = relocInfo::none)
+ : _address((address) addr),
+ _rspec(rspec_from_rtype(rtype, (address) addr)) {}
+
AddressLiteral(float* addr, relocInfo::relocType rtype = relocInfo::none)
: _address((address) addr),
_rspec(rspec_from_rtype(rtype, (address) addr)) {}
AddressLiteral(double* addr, relocInfo::relocType rtype = relocInfo::none)
*** 453,463 ****
--- 463,488 ----
RelocationHolder rspec(int offset) const {
return offset == 0 ? _rspec : _rspec.plus(offset);
}
};
+ // Convenience classes
+ class ExternalAddress: public AddressLiteral {
+ private:
+ static relocInfo::relocType reloc_for_target(address target) {
+ // Sometimes ExternalAddress is used for values which aren't
+ // exactly addresses, like the card table base.
+ // external_word_type can't be used for values in the first page
+ // so just skip the reloc in that case.
+ return external_word_Relocation::can_be_relocated(target) ? relocInfo::external_word_type : relocInfo::none;
+ }
+ public:
+ ExternalAddress(address target) : AddressLiteral(target, reloc_for_target( target)) {}
+ ExternalAddress(oop* target) : AddressLiteral(target, reloc_for_target((address) target)) {}
+ };
+
inline Address RegisterImpl::address_in_saved_window() const {
return (Address(SP, (sp_offset_in_saved_window() * wordSize) + STACK_BIAS));
}
*** 853,865 ****
--- 878,889 ----
// x is supposed to fit in a field "nbits" wide
// and be sign-extended. Check the range.
static void assert_signed_range(intptr_t x, int nbits) {
! assert( nbits == 32
|| -(1 << nbits-1) <= x && x < ( 1 << nbits-1),
"value out of range");
! assert(nbits == 32 || (-(1 << nbits-1) <= x && x < ( 1 << nbits-1)),
+ err_msg("value out of range: x=" INTPTR_FORMAT ", nbits=%d", x, nbits));
}
static void assert_signed_word_disp_range(intptr_t x, int nbits) {
assert( (x & 3) == 0, "not word aligned");
assert_signed_range(x, nbits + 2);
*** 2285,2295 ****
--- 2309,2319 ----
void set_varargs( Argument a, Register d );
int total_frame_size_in_bytes(int extraWords);
// used when extraWords known statically
! void save_frame(int extraWords = 0);
void save_frame_c1(int size_in_bytes);
// make a frame, and simultaneously pass up one or two register value
// into the new register window
void save_frame_and_mov(int extraWords, Register s1, Register d1, Register s2 = Register(), Register d2 = Register());
*** 2454,2466 ****
--- 2478,2492 ----
Register temp_reg);
void jump_to_method_handle_entry(Register mh_reg, Register temp_reg, bool emit_delayed_nop = true);
// offset relative to Gargs of argument at tos[arg_slot].
// (arg_slot == 0 means the last argument, not the first).
RegisterOrConstant argument_offset(RegisterOrConstant arg_slot,
+ Register temp_reg,
int extra_slot_offset = 0);
// Address of Gargs and argument_offset.
Address argument_address(RegisterOrConstant arg_slot,
+ Register temp_reg,
int extra_slot_offset = 0);
// Stack overflow checking
// Note: this clobbers G3_scratch
src/cpu/sparc/vm/assembler_sparc.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File