Mercurial > hg > graal-jvmci-8
annotate src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp @ 24118:3ce198ad35a6
check displacement >= 0 (JDK-8177673)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 03 Apr 2017 14:47:25 +0200 |
parents | 59f53c97a38a |
children |
rev | line source |
---|---|
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
1 /* |
23310
e5b5170606a2
8149689: [JVMCI] CodeInstaller::pd_patch_DataSectionReference should be able to throw exceptions
twisti
parents:
22721
diff
changeset
|
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
4 * |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
8 * |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
14 * |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
18 * |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
21 * questions. |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
22 */ |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
23 |
15155
370cb412d027
add precompiled.hpp to graalCodeInstaller_x86.cpp, fixes Windows build
Christian Wirth <christian.wirth@oracle.com>
parents:
15123
diff
changeset
|
24 #include "precompiled.hpp" |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
25 #include "compiler/disassembler.hpp" |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
26 #include "runtime/javaCalls.hpp" |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
27 #include "jvmci/jvmciEnv.hpp" |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
28 #include "jvmci/jvmciCodeInstaller.hpp" |
22548
02fc27dc1da7
Rename jvmciJavaAccess.* to jvmciJavaClasses.*
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
21559
diff
changeset
|
29 #include "jvmci/jvmciJavaClasses.hpp" |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
30 #include "jvmci/jvmciCompilerToVM.hpp" |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
31 #include "jvmci/jvmciRuntime.hpp" |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
32 #include "asm/register.hpp" |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
33 #include "classfile/vmSymbols.hpp" |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
34 #include "code/vmreg.hpp" |
17024
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
35 #include "vmreg_x86.inline.hpp" |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
36 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
37 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, Handle method, TRAPS) { |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
38 if (inst->is_call() || inst->is_jump()) { |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
39 assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size"); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
40 return (pc_offset + NativeCall::instruction_size); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
41 } else if (inst->is_mov_literal64()) { |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
42 // mov+call instruction pair |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
43 jint offset = pc_offset + NativeMovConstReg::instruction_size; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
44 u_char* call = (u_char*) (_instructions->start() + offset); |
18732
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
45 if (call[0] == Assembler::REX_B) { |
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
46 offset += 1; /* prefix byte for extended register R8-R15 */ |
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
47 call++; |
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
48 } |
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
49 assert(call[0] == 0xFF, "expected call"); |
d611982fb10e
Fixed decoding of call instruction
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18262
diff
changeset
|
50 offset += 2; /* opcode byte + modrm byte */ |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
51 return (offset); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
52 } else if (inst->is_call_reg()) { |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
53 // the inlined vtable stub contains a "call register" instruction |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
54 assert(method.not_null(), "only valid for virtual calls"); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
55 return (pc_offset + ((NativeCallReg *) inst)->next_instruction_offset()); |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
56 } else if (inst->is_cond_jump()) { |
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
57 address pc = (address) (inst); |
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
58 return pc_offset + (jint) (Assembler::locate_next_instruction(pc) - pc); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
59 } else { |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
60 JVMCI_ERROR_0("unsupported type of instruction for call site"); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
61 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
62 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
63 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
64 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle constant, TRAPS) { |
10810
4e1db4c9d4c5
Support data patches for values larger than long.
Roland Schatz <roland.schatz@oracle.com>
parents:
10684
diff
changeset
|
65 address pc = _instructions->start() + pc_offset; |
18262
f7d45e2426d4
converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18222
diff
changeset
|
66 Handle obj = HotSpotObjectConstantImpl::object(constant); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
67 jobject value = JNIHandles::make_local(obj()); |
18262
f7d45e2426d4
converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18222
diff
changeset
|
68 if (HotSpotObjectConstantImpl::compressed(constant)) { |
18854
b8d3f84740c7
guarded use of 64-bit only code with #ifdefs
Doug Simon <doug.simon@oracle.com>
parents:
18732
diff
changeset
|
69 #ifdef _LP64 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
70 address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
71 int oop_index = _oop_recorder->find_index(value); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
72 _instructions->relocate(pc, oop_Relocation::spec(oop_index), Assembler::narrow_oop_operand); |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
73 TRACE_jvmci_3("relocating (narrow oop constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand)); |
18854
b8d3f84740c7
guarded use of 64-bit only code with #ifdefs
Doug Simon <doug.simon@oracle.com>
parents:
18732
diff
changeset
|
74 #else |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
75 JVMCI_ERROR("compressed oop on 32bit"); |
18854
b8d3f84740c7
guarded use of 64-bit only code with #ifdefs
Doug Simon <doug.simon@oracle.com>
parents:
18732
diff
changeset
|
76 #endif |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
77 } else { |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
78 address operand = Assembler::locate_operand(pc, Assembler::imm_operand); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
79 *((jobject*) operand) = value; |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
80 _instructions->relocate(pc, oop_Relocation::spec_for_immediate(), Assembler::imm_operand); |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
81 TRACE_jvmci_3("relocating (oop constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand)); |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
82 } |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
83 } |
13520
fb7b39f07232
Embed compressed constants when possible and use more efficient patterns for encoding
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13515
diff
changeset
|
84 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
85 void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) { |
22590
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
86 address pc = _instructions->start() + pc_offset; |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
87 if (HotSpotMetaspaceConstantImpl::compressed(constant)) { |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
88 #ifdef _LP64 |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
89 address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand); |
23767
edf3f2eb3b00
Record metadata_Relocations for metadata references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23330
diff
changeset
|
90 *((narrowKlass*) operand) = record_narrow_metadata_reference(_instructions, operand, constant, CHECK); |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
91 TRACE_jvmci_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand)); |
22590
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
92 #else |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
93 JVMCI_ERROR("compressed Klass* on 32bit"); |
22590
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
94 #endif |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
95 } else { |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
96 address operand = Assembler::locate_operand(pc, Assembler::imm_operand); |
23767
edf3f2eb3b00
Record metadata_Relocations for metadata references
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23330
diff
changeset
|
97 *((void**) operand) = record_metadata_reference(_instructions, operand, constant, CHECK); |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
98 TRACE_jvmci_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand)); |
22590
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
99 } |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
100 } |
3f6488b29c1a
Remove rawValue from HotSpotMetaspaceConstantImpl, patch raw pointer at code installation time.
Roland Schatz <roland.schatz@oracle.com>
parents:
22548
diff
changeset
|
101 |
23310
e5b5170606a2
8149689: [JVMCI] CodeInstaller::pd_patch_DataSectionReference should be able to throw exceptions
twisti
parents:
22721
diff
changeset
|
102 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset, TRAPS) { |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
103 address pc = _instructions->start() + pc_offset; |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
104 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
105 address operand = Assembler::locate_operand(pc, Assembler::disp32_operand); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
106 address next_instruction = Assembler::locate_next_instruction(pc); |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
17024
diff
changeset
|
107 address dest = _constants->start() + data_offset; |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
108 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
109 long disp = dest - next_instruction; |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
110 assert(disp == (jint) disp, "disp doesn't fit in 32 bits"); |
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
111 *((jint*) operand) = (jint) disp; |
13576
4e679d50ba9a
Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents:
13561
diff
changeset
|
112 |
14561
e14198669e5c
Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents:
13726
diff
changeset
|
113 _instructions->relocate(pc, section_word_Relocation::spec((address) dest, CodeBuffer::SECT_CONSTS), Assembler::disp32_operand); |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
114 TRACE_jvmci_3("relocating at " PTR_FORMAT "/" PTR_FORMAT " with destination at " PTR_FORMAT " (%d)", p2i(pc), p2i(operand), p2i(dest), data_offset); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
115 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
116 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
117 void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination, TRAPS) { |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
118 address pc = (address) inst; |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
119 if (inst->is_call()) { |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
120 // NOTE: for call without a mov, the offset must fit a 32-bit immediate |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
121 // see also CompilerToVM.getMaxCallTargetOffset() |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
122 NativeCall* call = nativeCall_at(pc); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
123 call->set_destination((address) foreign_call_destination); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
124 _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
125 } else if (inst->is_mov_literal64()) { |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
126 NativeMovConstReg* mov = nativeMovConstReg_at(pc); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
127 mov->set_data((intptr_t) foreign_call_destination); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
128 _instructions->relocate(mov->instruction_address(), runtime_call_Relocation::spec(), Assembler::imm_operand); |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
129 } else if (inst->is_jump()) { |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
130 NativeJump* jump = nativeJump_at(pc); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
131 jump->set_jump_destination((address) foreign_call_destination); |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
132 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec(), Assembler::call32_operand); |
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
133 } else if (inst->is_cond_jump()) { |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
134 address old_dest = nativeGeneralJump_at(pc)->jump_destination(); |
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
135 address disp = Assembler::locate_operand(pc, Assembler::call32_operand); |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
136 *(jint*) disp += ((address) foreign_call_destination) - old_dest; |
11827
ff1d8605f354
graal code installer: minor style cleanup
Bernhard Urban <bernhard.urban@jku.at>
parents:
11826
diff
changeset
|
137 _instructions->relocate(pc, runtime_call_Relocation::spec(), Assembler::call32_operand); |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
138 } else { |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
139 JVMCI_ERROR("unsupported relocation for foreign call"); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
140 } |
11826
2d3d3d36ab3c
AMD64HotSpot: use conditional jump for IC_MISS_HANDLER
Bernhard Urban <bernhard.urban@jku.at>
parents:
11799
diff
changeset
|
141 |
23772
59f53c97a38a
Synchronize with JDK9 printing differences in jvmciCodeInstaller
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
23767
diff
changeset
|
142 TRACE_jvmci_3("relocating (foreign call) at " PTR_FORMAT, p2i(inst)); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
143 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
144 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
145 void CodeInstaller::pd_relocate_JavaMethod(Handle hotspot_method, jint pc_offset, TRAPS) { |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
146 #ifdef ASSERT |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
147 Method* method = NULL; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
148 // we need to check, this might also be an unresolved method |
18222
a8cff27ca2e1
converted HotSpotResolvedJavaMethod to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18176
diff
changeset
|
149 if (hotspot_method->is_a(HotSpotResolvedJavaMethodImpl::klass())) { |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
150 method = getMethodFromHotSpotMethod(hotspot_method()); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
151 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
152 #endif |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
153 switch (_next_call_type) { |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
154 case INLINE_INVOKE: |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
155 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
156 case INVOKEVIRTUAL: |
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
157 case INVOKEINTERFACE: { |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
158 assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface"); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
159 |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
160 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
161 call->set_destination(SharedRuntime::get_resolve_virtual_call_stub()); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
162 _instructions->relocate(call->instruction_address(), |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
163 virtual_call_Relocation::spec(_invoke_mark_pc), |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
164 Assembler::call32_operand); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
165 break; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
166 } |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
167 case INVOKESTATIC: { |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
168 assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic"); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
169 |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
170 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
171 call->set_destination(SharedRuntime::get_resolve_static_call_stub()); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
172 _instructions->relocate(call->instruction_address(), |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
173 relocInfo::static_call_type, Assembler::call32_operand); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
174 break; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
175 } |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
176 case INVOKESPECIAL: { |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
177 assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial"); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
178 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
179 call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub()); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
180 _instructions->relocate(call->instruction_address(), |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
181 relocInfo::opt_virtual_call_type, Assembler::call32_operand); |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
182 break; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
183 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
184 default: |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
185 JVMCI_ERROR("invalid _next_call_type value"); |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
186 break; |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
187 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
188 } |
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
189 |
13485
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
190 static void relocate_poll_near(address pc) { |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
191 NativeInstruction* ni = nativeInstruction_at(pc); |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
192 int32_t* disp = (int32_t*) Assembler::locate_operand(pc, Assembler::disp32_operand); |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
193 int32_t offset = *disp; // The Java code installed the polling page offset into the disp32 operand |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
194 intptr_t new_disp = (intptr_t) (os::get_polling_page() + offset) - (intptr_t) ni; |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
195 *disp = (int32_t)new_disp; |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
196 } |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
197 |
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
198 |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
199 void CodeInstaller::pd_relocate_poll(address pc, jint mark, TRAPS) { |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
200 switch (mark) { |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
201 case POLL_NEAR: { |
13485
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
202 relocate_poll_near(pc); |
13553
d49f00604347
removed poll_Relocation::pollingForm type and associated data field and rely solely on format field of safepoint relocation entries when deciding whether or not to relocate the operand of a safepoint poll instruction
Doug Simon <doug.simon@oracle.com>
parents:
13520
diff
changeset
|
203 _instructions->relocate(pc, relocInfo::poll_type, Assembler::disp32_operand); |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
13485
diff
changeset
|
204 break; |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
205 } |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
206 case POLL_FAR: |
13561
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
207 // This is a load from a register so there is no relocatable operand. |
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
208 // We just have to ensure that the format is not disp32_operand |
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
209 // so that poll_Relocation::fix_relocation_after_move does the right |
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
210 // thing (i.e. ignores this relocation record) |
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
211 _instructions->relocate(pc, relocInfo::poll_type, Assembler::imm_operand); |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
212 break; |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
213 case POLL_RETURN_NEAR: { |
13485
04a87dc2cfca
refactored common code into a separate function
Doug Simon <doug.simon@oracle.com>
parents:
11827
diff
changeset
|
214 relocate_poll_near(pc); |
13553
d49f00604347
removed poll_Relocation::pollingForm type and associated data field and rely solely on format field of safepoint relocation entries when deciding whether or not to relocate the operand of a safepoint poll instruction
Doug Simon <doug.simon@oracle.com>
parents:
13520
diff
changeset
|
215 _instructions->relocate(pc, relocInfo::poll_return_type, Assembler::disp32_operand); |
13512
8085ce95b6f5
reloc info for safepoint polls includes whether the poison page is far or near
Doug Simon <doug.simon@oracle.com>
parents:
13485
diff
changeset
|
216 break; |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
217 } |
14574
6bab029d6e3a
removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents:
14561
diff
changeset
|
218 case POLL_RETURN_FAR: |
15123
7ccd2a1df0fa
made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents:
14574
diff
changeset
|
219 // see comment above for POLL_FAR |
13561
4fc8c8bb4c32
removed Assembler::no_operand alias
Doug Simon <doug.simon@oracle.com>
parents:
13553
diff
changeset
|
220 _instructions->relocate(pc, relocInfo::poll_return_type, Assembler::imm_operand); |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
221 break; |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
222 default: |
22721
510846133438
8139589: [JVMCI] Using fthrow when throwing JVMCIError.
Roland Schatz <roland.schatz@oracle.com>
parents:
22711
diff
changeset
|
223 JVMCI_ERROR("invalid mark value: %d", mark); |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
224 break; |
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
10810
diff
changeset
|
225 } |
9934
0f7ca53be929
CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff
changeset
|
226 } |
17024
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
227 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
228 // convert JVMCI register indices (as used in oop maps) to HotSpot registers |
22711
316e768645c0
8139589: [JVMCI] throw exceptions in faulty code installation operations
Roland Schatz <roland.schatz@oracle.com>
parents:
22684
diff
changeset
|
229 VMReg CodeInstaller::get_hotspot_reg(jint jvmci_reg, TRAPS) { |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
230 if (jvmci_reg < RegisterImpl::number_of_registers) { |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
231 return as_Register(jvmci_reg)->as_VMReg(); |
17024
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
232 } else { |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
18854
diff
changeset
|
233 jint floatRegisterNumber = jvmci_reg - RegisterImpl::number_of_registers; |
17024
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
234 if (floatRegisterNumber < XMMRegisterImpl::number_of_registers) { |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
235 return as_XMMRegister(floatRegisterNumber)->as_VMReg(); |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
236 } |
22721
510846133438
8139589: [JVMCI] Using fthrow when throwing JVMCIError.
Roland Schatz <roland.schatz@oracle.com>
parents:
22711
diff
changeset
|
237 JVMCI_ERROR_NULL("invalid register number: %d", jvmci_reg); |
17024
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
238 } |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
239 } |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
240 |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
241 bool CodeInstaller::is_general_purpose_reg(VMReg hotspotRegister) { |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
242 return !(hotspotRegister->is_FloatRegister() || hotspotRegister->is_XMMRegister()); |
4e2d34d7715b
[SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
15582
diff
changeset
|
243 } |