annotate src/cpu/sparc/vm/graalCodeInstaller_sparc.cpp @ 18176:c2270ad35f57

Better construction of data section and data patches.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 27 Oct 2014 14:07:49 +0100
parents 4e2d34d7715b
children a8cff27ca2e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
1 /*
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
2 * Copyright (c) 2013, 2014, 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 */
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
23
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
24 #include "graal/graalCodeInstaller.hpp"
15582
063ec2920d21 made Graal runtime initialization in hosted mode lazy
Doug Simon <doug.simon@oracle.com>
parents: 15123
diff changeset
25 #include "graal/graalRuntime.hpp"
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
26 #include "graal/graalCompilerToVM.hpp"
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
27 #include "graal/graalJavaAccess.hpp"
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
28 #include "vmreg_sparc.inline.hpp"
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
29
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
30 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, oop method) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
31 if (inst->is_call() || inst->is_jump()) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
32 return pc_offset + NativeCall::instruction_size;
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
33 } else if (inst->is_call_reg()) {
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
34 return pc_offset + NativeCallReg::instruction_size;
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
35 } else if (inst->is_sethi()) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
36 return pc_offset + NativeFarCall::instruction_size;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
37 } else {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
38 fatal("unsupported type of instruction for call site");
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
39 return 0;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
40 }
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
41 }
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
42
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
43 void CodeInstaller::pd_patch_OopConstant(int pc_offset, Handle& constant) {
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
44 address pc = _instructions->start() + pc_offset;
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
45 Handle obj = HotSpotObjectConstant::object(constant);
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
46 jobject value = JNIHandles::make_local(obj());
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
47 if (HotSpotObjectConstant::compressed(constant)) {
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
48 fatal("unimplemented: narrow oop relocation");
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
49 } else {
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
50 NativeMovConstReg* move = nativeMovConstReg_at(pc);
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
51 move->set_data((intptr_t) value);
13576
4e679d50ba9a Move data section building code to Java.
Roland Schatz <roland.schatz@oracle.com>
parents: 13553
diff changeset
52
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
53 // We need two relocations: one on the sethi and one on the add.
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
54 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: 13576
diff changeset
55 RelocationHolder rspec = oop_Relocation::spec(oop_index);
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
56 _instructions->relocate(pc + NativeMovConstReg::sethi_offset, rspec);
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
57 _instructions->relocate(pc + NativeMovConstReg::add_offset, rspec);
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
58 }
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
59 }
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
60
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
61 void CodeInstaller::pd_patch_DataSectionReference(int pc_offset, int data_offset) {
14561
e14198669e5c Make data patch system use vm specific NarrowOop kind.
Roland Schatz <roland.schatz@oracle.com>
parents: 13576
diff changeset
62 address pc = _instructions->start() + pc_offset;
16316
989ab80382c1 Using absolute addressing instead of pc relative in fixup.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 15582
diff changeset
63 address const_start = _constants->start();
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
64 address dest = _constants->start() + data_offset;
11233
5a9d68c3a7d7 SPARC: a lot of fixes and more
twisti
parents: 10871
diff changeset
65
16631
0e34c7fbd288 [SPARC] Add relocation info for constant reference to constant section
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16316
diff changeset
66 _instructions->relocate(pc + NativeMovConstReg::sethi_offset, internal_word_Relocation::spec((address) dest));
0e34c7fbd288 [SPARC] Add relocation info for constant reference to constant section
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16316
diff changeset
67 _instructions->relocate(pc + NativeMovConstReg::add_offset, internal_word_Relocation::spec((address) dest));
18176
c2270ad35f57 Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents: 17024
diff changeset
68 TRACE_graal_3("relocating at %p with destination at %p (%d)", pc, dest, data_offset);
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
69 }
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
70
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
71 void CodeInstaller::pd_relocate_CodeBlob(CodeBlob* cb, NativeInstruction* inst) {
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
72 fatal("CodeInstaller::pd_relocate_CodeBlob - sparc unimp");
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
73 }
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
74
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
75 void CodeInstaller::pd_relocate_ForeignCall(NativeInstruction* inst, jlong foreign_call_destination) {
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
76 address pc = (address) inst;
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
77 if (inst->is_call()) {
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
78 NativeCall* call = nativeCall_at(pc);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
79 call->set_destination((address) foreign_call_destination);
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
80 _instructions->relocate(call->instruction_address(), runtime_call_Relocation::spec());
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
81 } else if (inst->is_sethi()) {
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10854
diff changeset
82 NativeJump* jump = nativeJump_at(pc);
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10854
diff changeset
83 jump->set_jump_destination((address) foreign_call_destination);
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10854
diff changeset
84 _instructions->relocate(jump->instruction_address(), runtime_call_Relocation::spec());
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
85 } else {
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents: 10854
diff changeset
86 fatal(err_msg("unknown call or jump instruction at %p", pc));
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
87 }
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
88 TRACE_graal_3("relocating (foreign call) at %p", inst);
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
89 }
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
90
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
91 void CodeInstaller::pd_relocate_JavaMethod(oop hotspot_method, jint pc_offset) {
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
92 #ifdef ASSERT
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
93 Method* method = NULL;
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
94 // we need to check, this might also be an unresolved method
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
95 if (hotspot_method->is_a(HotSpotResolvedJavaMethod::klass())) {
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
96 method = getMethodFromHotSpotMethod(hotspot_method);
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
97 }
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
98 #endif
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
99 switch (_next_call_type) {
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
100 case INLINE_INVOKE:
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
101 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
102 case INVOKEVIRTUAL:
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
103 case INVOKEINTERFACE: {
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
104 assert(method == NULL || !method->is_static(), "cannot call static method with invokeinterface");
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
105 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
106 call->set_destination(SharedRuntime::get_resolve_virtual_call_stub());
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10684
diff changeset
107 _instructions->relocate(call->instruction_address(), virtual_call_Relocation::spec(_invoke_mark_pc));
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
108 break;
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
109 }
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
110 case INVOKESTATIC: {
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
111 assert(method == NULL || method->is_static(), "cannot call non-static method with invokestatic");
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
112 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
113 call->set_destination(SharedRuntime::get_resolve_static_call_stub());
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents: 10684
diff changeset
114 _instructions->relocate(call->instruction_address(), relocInfo::static_call_type);
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
115 break;
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
116 }
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
117 case INVOKESPECIAL: {
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
118 assert(method == NULL || !method->is_static(), "cannot call static method with invokespecial");
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
119 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
120 call->set_destination(SharedRuntime::get_resolve_opt_virtual_call_stub());
10854
e1fcdda22831 SPARC: can compile some stubs now but they don't work yet
twisti
parents: 10792
diff changeset
121 _instructions->relocate(call->instruction_address(), relocInfo::opt_virtual_call_type);
10684
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
122 break;
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
123 }
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
124 default:
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
125 fatal("invalid _next_call_type value");
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
126 break;
6ff467cdb105 Code installer changes for SPARC.
twisti
parents: 10411
diff changeset
127 }
9934
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
128 }
0f7ca53be929 CR-806: Changes to build Graal for SPARC
Morris Meyer <morris.meyer@oracle.com>
parents:
diff changeset
129
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
130 void CodeInstaller::pd_relocate_poll(address pc, jint mark) {
11799
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
131 switch (mark) {
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
132 case POLL_NEAR:
11799
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
133 fatal("unimplemented");
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
134 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
135 case POLL_FAR:
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: 13515
diff changeset
136 _instructions->relocate(pc, relocInfo::poll_type);
11799
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
137 break;
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
138 case POLL_RETURN_NEAR:
11799
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
139 fatal("unimplemented");
15123
7ccd2a1df0fa made SPARC compile again; moved graalCodeInstaller_<arch>.hpp to .cpp files
twisti
parents: 14574
diff changeset
140 break;
14574
6bab029d6e3a removed com/oracle/graal/hotspot/bridge/Marks.java and replaced with enum
twisti
parents: 14561
diff changeset
141 case POLL_RETURN_FAR:
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: 13515
diff changeset
142 _instructions->relocate(pc, relocInfo::poll_return_type);
11799
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
143 break;
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
144 default:
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
145 fatal("invalid mark value");
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
146 break;
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
147 }
4c96ccce3772 SPARC: added CodeInstaller::pd_relocate_poll
twisti
parents: 11760
diff changeset
148 }
17024
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
149
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
150 // convert Graal register indices (as used in oop maps) to HotSpot registers
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
151 VMReg CodeInstaller::get_hotspot_reg(jint graal_reg) {
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
152 if (graal_reg < RegisterImpl::number_of_registers) {
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
153 return as_Register(graal_reg)->as_VMReg();
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
154 } else {
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
155 jint floatRegisterNumber = graal_reg - RegisterImpl::number_of_registers;
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
156 floatRegisterNumber += MAX2(0, floatRegisterNumber-32); // Beginning with f32, only every second register is going to be addressed
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
157 if (floatRegisterNumber < FloatRegisterImpl::number_of_registers) {
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
158 return as_FloatRegister(floatRegisterNumber)->as_VMReg();
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
159 }
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
160 ShouldNotReachHere();
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
161 return NULL;
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
162 }
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
163 }
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
164
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
165 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: 16631
diff changeset
166 return !hotspotRegister->is_FloatRegister();
4e2d34d7715b [SPARC/AMD64] Splitting up oopmap generation for Intel XMM and SPARC Floatingpoint registers
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16631
diff changeset
167 }