# HG changeset patch # User Chris Seaton # Date 1389203096 0 # Node ID b63357fbe40c2ac9208758f212378424c503fe9c # Parent 44288fe54352620923b4bf29a91d26982179e8bb# Parent d49f006043473a7151420eeea0143792c073b449 Merge. diff -r 44288fe54352 -r b63357fbe40c src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp --- a/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Wed Jan 08 17:44:56 2014 +0000 @@ -1601,7 +1601,7 @@ } #endif // TIERED __ set((intptr_t)os::get_polling_page(), L0); - __ relocate(poll_return_Relocation::spec(poll_Relocation::absolute)); + __ relocate(relocInfo::poll_return_type); __ ld_ptr(L0, 0, G0); __ ret(); __ delayed()->restore(); @@ -1613,7 +1613,7 @@ if (info != NULL) { add_debug_info_for_branch(info); } else { - __ relocate(poll_Relocation::spec(poll_Relocation::absolute)); + __ relocate(relocInfo::poll_type); } int offset = __ offset(); diff -r 44288fe54352 -r b63357fbe40c src/cpu/sparc/vm/graalCodeInstaller_sparc.hpp --- a/src/cpu/sparc/vm/graalCodeInstaller_sparc.hpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/sparc/vm/graalCodeInstaller_sparc.hpp Wed Jan 08 17:44:56 2014 +0000 @@ -188,13 +188,13 @@ fatal("unimplemented"); } case MARK_POLL_FAR: - _instructions->relocate(pc, poll_Relocation::spec(poll_Relocation::absolute)); + _instructions->relocate(pc, relocInfo::poll_type); break; case MARK_POLL_RETURN_NEAR: { fatal("unimplemented"); } case MARK_POLL_RETURN_FAR: - _instructions->relocate(pc, poll_return_Relocation::spec(poll_Relocation::absolute)); + _instructions->relocate(pc, relocInfo::poll_return_type); break; default: fatal("invalid mark value"); diff -r 44288fe54352 -r b63357fbe40c src/cpu/x86/vm/assembler_x86.cpp --- a/src/cpu/x86/vm/assembler_x86.cpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/x86/vm/assembler_x86.cpp Wed Jan 08 17:44:56 2014 +0000 @@ -81,10 +81,8 @@ _rspec = runtime_call_Relocation::spec(); break; case relocInfo::poll_type: - _rspec = poll_Relocation::spec(Assembler::is_polling_page_far() ? poll_Relocation::absolute : poll_Relocation::pc_relative); - break; case relocInfo::poll_return_type: - _rspec = poll_return_Relocation::spec(Assembler::is_polling_page_far() ? poll_Relocation::absolute : poll_Relocation::pc_relative); + _rspec = Relocation::spec_simple(rtype); break; case relocInfo::none: break; diff -r 44288fe54352 -r b63357fbe40c src/cpu/x86/vm/assembler_x86.hpp --- a/src/cpu/x86/vm/assembler_x86.hpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/x86/vm/assembler_x86.hpp Wed Jan 08 17:44:56 2014 +0000 @@ -527,6 +527,9 @@ enum WhichOperand { // input to locate_operand, and format code for relocations imm_operand = 0, // embedded 32-bit|64-bit immediate operand +#ifdef GRAAL + no_operand = imm_operand, // format value for relocations at instructions with no operand +#endif disp32_operand = 1, // embedded 32-bit displacement or address call32_operand = 2, // embedded 32-bit self-relative displacement #ifndef _LP64 diff -r 44288fe54352 -r b63357fbe40c src/cpu/x86/vm/graalCodeInstaller_x86.hpp --- a/src/cpu/x86/vm/graalCodeInstaller_x86.hpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/x86/vm/graalCodeInstaller_x86.hpp Wed Jan 08 17:44:56 2014 +0000 @@ -243,19 +243,21 @@ switch (mark) { case MARK_POLL_NEAR: { relocate_poll_near(pc); - _instructions->relocate(pc, poll_Relocation::spec(poll_Relocation::pc_relative)); + _instructions->relocate(pc, relocInfo::poll_type, Assembler::disp32_operand); break; } case MARK_POLL_FAR: - _instructions->relocate(pc, poll_Relocation::spec(poll_Relocation::absolute)); + // This is a load from a register so there is no relocatable operand + _instructions->relocate(pc, relocInfo::poll_type, Assembler::no_operand); break; case MARK_POLL_RETURN_NEAR: { relocate_poll_near(pc); - _instructions->relocate(pc, poll_return_Relocation::spec(poll_Relocation::pc_relative)); + _instructions->relocate(pc, relocInfo::poll_return_type, Assembler::disp32_operand); break; } case MARK_POLL_RETURN_FAR: - _instructions->relocate(pc, poll_return_Relocation::spec(poll_Relocation::absolute)); + // This is a load from a register so there is no relocatable operand + _instructions->relocate(pc, relocInfo::poll_return_type, Assembler::no_operand); break; default: fatal("invalid mark value"); diff -r 44288fe54352 -r b63357fbe40c src/cpu/x86/vm/relocInfo_x86.cpp --- a/src/cpu/x86/vm/relocInfo_x86.cpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/cpu/x86/vm/relocInfo_x86.cpp Wed Jan 08 17:44:56 2014 +0000 @@ -179,17 +179,14 @@ void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { #ifdef _LP64 - if (_form == pc_relative) { - typedef Assembler::WhichOperand WhichOperand; - WhichOperand which = (WhichOperand) format(); - // This format is imm but it is really disp32 - which = Assembler::disp32_operand; + typedef Assembler::WhichOperand WhichOperand; + WhichOperand which = (WhichOperand) format(); + if (which == Assembler::disp32_operand) { address orig_addr = old_addr_for(addr(), src, dest); NativeInstruction* oni = nativeInstruction_at(orig_addr); int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); // This poll_addr is incorrect by the size of the instruction it is irrelevant intptr_t poll_addr = (intptr_t)oni + *orig_disp; - NativeInstruction* ni = nativeInstruction_at(addr()); intptr_t new_disp = poll_addr - (intptr_t) ni; diff -r 44288fe54352 -r b63357fbe40c src/share/vm/c1/c1_LIRAssembler.cpp --- a/src/share/vm/c1/c1_LIRAssembler.cpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/share/vm/c1/c1_LIRAssembler.cpp Wed Jan 08 17:44:56 2014 +0000 @@ -334,7 +334,6 @@ void LIR_Assembler::add_debug_info_for_branch(CodeEmitInfo* info) { - _masm->code_section()->relocate(pc(), relocInfo::poll_type); int pc_offset = code_offset(); flush_debug_info(pc_offset); info->record_debug_info(compilation()->debug_info_recorder(), pc_offset); diff -r 44288fe54352 -r b63357fbe40c src/share/vm/code/relocInfo.cpp --- a/src/share/vm/code/relocInfo.cpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/share/vm/code/relocInfo.cpp Wed Jan 08 17:44:56 2014 +0000 @@ -679,16 +679,6 @@ _target = address_from_scaled_offset(offset, base); } -void poll_Relocation::pack_data_to(CodeSection* dest) { - short* p = (short*) dest->locs_end(); - p = pack_1_int_to(p, _form); - dest->set_locs_end((relocInfo*) p); -} - -void poll_Relocation::unpack_data() { - _form = (poll_Relocation::pollingForm) unpack_1_int(); -} - //// miscellaneous methods oop* oop_Relocation::oop_addr() { int n = _oop_index; @@ -985,22 +975,6 @@ tty->print(" | [static_call=" INTPTR_FORMAT "]", r->static_call()); break; } - case relocInfo::poll_type: - case relocInfo::poll_return_type: - { - poll_Relocation* r = (poll_Relocation*) reloc(); - const char *formName = "unknown"; - switch (r->form()) { - case poll_Relocation::pc_relative: - formName = "pc_relative"; - break; - case poll_Relocation::absolute: - formName = "absolute"; - break; - } - tty->print(" | [form=%d(%s)]", r->form(), formName); - break; - } } tty->cr(); } diff -r 44288fe54352 -r b63357fbe40c src/share/vm/code/relocInfo.hpp --- a/src/share/vm/code/relocInfo.hpp Wed Jan 08 17:42:10 2014 +0000 +++ b/src/share/vm/code/relocInfo.hpp Wed Jan 08 17:44:56 2014 +0000 @@ -213,8 +213,7 @@ // relocInfo::poll_[return_]type -- a safepoint poll // Value: none // Instruction types: memory load or test -// Data: [] the associated set-oops are adjacent to the call -// [n] n is a poll_Relocation::pollingForm value +// Data: none // // For example: // @@ -1277,53 +1276,15 @@ section_word_Relocation() { } }; + class poll_Relocation : public Relocation { - public: - enum pollingForm { - pc_relative, - absolute - }; + bool is_data() { return true; } relocInfo::relocType type() { return relocInfo::poll_type; } - bool is_data() { return true; } void fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest); - private: - pollingForm _form; - public: - - static RelocationHolder spec(poll_Relocation::pollingForm form) { - RelocationHolder rh = newHolder(); - new(rh) poll_Relocation(form); - return rh; - } - - poll_Relocation(poll_Relocation::pollingForm form) { - _form = form; - } - poll_Relocation::pollingForm form() { return _form; } - - void pack_data_to(CodeSection* dest); - void unpack_data(); - - protected: - friend class RelocIterator; - poll_Relocation() { } }; class poll_return_Relocation : public poll_Relocation { - public: relocInfo::relocType type() { return relocInfo::poll_return_type; } - - static RelocationHolder spec(poll_Relocation::pollingForm distance) { - RelocationHolder rh = newHolder(); - new(rh) poll_return_Relocation(distance); - return rh; - } - - poll_return_Relocation(poll_Relocation::pollingForm distance) : poll_Relocation(distance) { } - - private: - friend class RelocIterator; - poll_return_Relocation() { } }; // We know all the xxx_Relocation classes, so now we can define these: