8031389: On x86 C1 emits two relocations for polls
Summary: C1 emits two poll_type relocations at safepoint polls because LIR_Assembler::safepoint_poll(..) adds a relocation and calls LIR_Assembler::add_debug_info_for_branch(..) which adds a relocation as well. The implementation of add_debug_info_for_branch(..) is changed to not emit a poll relocation.
Reviewed-by: kvn, roland
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Thu May 22 13:42:44 2014 +0200
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp Thu Jun 05 10:43:16 2014 +0200
@@ -1612,13 +1612,10 @@
__ set((intptr_t)os::get_polling_page(), tmp->as_register());
if (info != NULL) {
add_debug_info_for_branch(info);
- } else {
- __ relocate(relocInfo::poll_type);
}
-
int offset = __ offset();
+ __ relocate(relocInfo::poll_type);
__ ld_ptr(tmp->as_register(), 0, G0);
-
return offset;
}
--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Thu May 22 13:42:44 2014 +0200
+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp Thu Jun 05 10:43:16 2014 +0200
@@ -336,7 +336,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);