12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "asm/assembler.inline.hpp"
27 #include "assembler_arm.inline.hpp"
28 #include "code/relocInfo.hpp"
29 #include "nativeInst_arm.hpp"
30 #include "oops/compressedOops.inline.hpp"
31 #include "oops/oop.hpp"
32 #include "runtime/orderAccess.hpp"
33 #include "runtime/safepoint.hpp"
34
35 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
36
37 NativeMovConstReg* ni = nativeMovConstReg_at(addr());
38 if (verify_only) {
39 guarantee(ni->data() == (intptr_t)(x + o), "instructions must match");
40 } else {
41 ni->set_data((intptr_t)(x + o));
42 }
43 }
44
45 address Relocation::pd_call_destination(address orig_addr) {
46 address pc = addr();
47
48 int adj = 0;
49 if (orig_addr != NULL) {
50 // We just moved this call instruction from orig_addr to addr().
51 // This means that, when relative, its target will appear to have grown by addr() - orig_addr.
52 adj = orig_addr - pc;
|
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "asm/assembler.inline.hpp"
27 #include "assembler_arm.inline.hpp"
28 #include "code/relocInfo.hpp"
29 #include "nativeInst_arm.hpp"
30 #include "oops/compressedOops.inline.hpp"
31 #include "oops/oop.hpp"
32 #include "runtime/safepoint.hpp"
33
34 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
35
36 NativeMovConstReg* ni = nativeMovConstReg_at(addr());
37 if (verify_only) {
38 guarantee(ni->data() == (intptr_t)(x + o), "instructions must match");
39 } else {
40 ni->set_data((intptr_t)(x + o));
41 }
42 }
43
44 address Relocation::pd_call_destination(address orig_addr) {
45 address pc = addr();
46
47 int adj = 0;
48 if (orig_addr != NULL) {
49 // We just moved this call instruction from orig_addr to addr().
50 // This means that, when relative, its target will appear to have grown by addr() - orig_addr.
51 adj = orig_addr - pc;
|