1 /* |
1 /* |
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
27 #include "code/relocInfo.hpp" |
27 #include "code/relocInfo.hpp" |
28 #include "nativeInst_x86.hpp" |
28 #include "nativeInst_x86.hpp" |
29 #include "oops/klass.inline.hpp" |
29 #include "oops/klass.inline.hpp" |
30 #include "oops/oop.inline.hpp" |
30 #include "oops/oop.inline.hpp" |
31 #include "runtime/safepoint.hpp" |
31 #include "runtime/safepoint.hpp" |
|
32 #include "runtime/safepointMechanism.hpp" |
32 |
33 |
33 |
34 |
34 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { |
35 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { |
35 #ifdef AMD64 |
36 #ifdef AMD64 |
36 x += o; |
37 x += o; |
181 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { |
182 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { |
182 #ifdef _LP64 |
183 #ifdef _LP64 |
183 typedef Assembler::WhichOperand WhichOperand; |
184 typedef Assembler::WhichOperand WhichOperand; |
184 WhichOperand which = (WhichOperand) format(); |
185 WhichOperand which = (WhichOperand) format(); |
185 #if !INCLUDE_JVMCI |
186 #if !INCLUDE_JVMCI |
186 assert((which == Assembler::disp32_operand) == !Assembler::is_polling_page_far(), "format not set correctly"); |
187 if (SafepointMechanism::uses_global_page_poll()) { |
|
188 assert((which == Assembler::disp32_operand) == !Assembler::is_polling_page_far(), "format not set correctly"); |
|
189 } |
187 #endif |
190 #endif |
188 if (which == Assembler::disp32_operand) { |
191 if (which == Assembler::disp32_operand) { |
|
192 assert(SafepointMechanism::uses_global_page_poll(), "should only have generated such a poll if global polling enabled"); |
189 address orig_addr = old_addr_for(addr(), src, dest); |
193 address orig_addr = old_addr_for(addr(), src, dest); |
190 NativeInstruction* oni = nativeInstruction_at(orig_addr); |
194 NativeInstruction* oni = nativeInstruction_at(orig_addr); |
191 int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); |
195 int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); |
192 // This poll_addr is incorrect by the size of the instruction it is irrelevant |
196 // This poll_addr is incorrect by the size of the instruction it is irrelevant |
193 intptr_t poll_addr = (intptr_t)oni + *orig_disp; |
197 intptr_t poll_addr = (intptr_t)oni + *orig_disp; |