author | stefank |
Thu, 09 May 2019 14:28:30 +0200 | |
changeset 54786 | ebf733a324d4 |
parent 53244 | 9807daeb47c4 |
permissions | -rw-r--r-- |
4013 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49621
diff
changeset
|
2 |
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. |
4013 | 3 |
* Copyright 2007 Red Hat, Inc. |
4 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
5 |
* |
|
6 |
* This code is free software; you can redistribute it and/or modify it |
|
7 |
* under the terms of the GNU General Public License version 2 only, as |
|
8 |
* published by the Free Software Foundation. |
|
9 |
* |
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
14 |
* accompanied this code). |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License version |
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
21 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4013
diff
changeset
|
22 |
* questions. |
4013 | 23 |
* |
24 |
*/ |
|
25 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49621
diff
changeset
|
26 |
#ifndef CPU_ZERO_NATIVEINST_ZERO_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49621
diff
changeset
|
27 |
#define CPU_ZERO_NATIVEINST_ZERO_HPP |
7397 | 28 |
|
29 |
#include "asm/assembler.hpp" |
|
30 |
#include "runtime/icache.hpp" |
|
31 |
#include "runtime/os.hpp" |
|
32 |
||
4013 | 33 |
// We have interfaces for the following instructions: |
34 |
// - NativeInstruction |
|
35 |
// - - NativeCall |
|
36 |
// - - NativeMovConstReg |
|
37 |
// - - NativeMovConstRegPatching |
|
38 |
// - - NativeJump |
|
39 |
// - - NativeIllegalOpCode |
|
40 |
// - - NativeReturn |
|
41 |
// - - NativeReturnX (return with argument) |
|
42 |
// - - NativePushConst |
|
43 |
// - - NativeTstRegMem |
|
44 |
||
45 |
// The base class for different kinds of native instruction abstractions. |
|
46 |
// Provides the primitive operations to manipulate code relative to this. |
|
47 |
||
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
47216
diff
changeset
|
48 |
class NativeInstruction { |
4013 | 49 |
public: |
50 |
bool is_jump() { |
|
51 |
ShouldNotCallThis(); |
|
19336 | 52 |
return false; |
4013 | 53 |
} |
54 |
||
55 |
bool is_safepoint_poll() { |
|
56 |
ShouldNotCallThis(); |
|
19336 | 57 |
return false; |
4013 | 58 |
} |
59 |
}; |
|
60 |
||
61 |
inline NativeInstruction* nativeInstruction_at(address address) { |
|
62 |
ShouldNotCallThis(); |
|
19336 | 63 |
return NULL; |
4013 | 64 |
} |
65 |
||
66 |
class NativeCall : public NativeInstruction { |
|
67 |
public: |
|
68 |
enum zero_specific_constants { |
|
69 |
instruction_size = 0 // not used within the interpreter |
|
70 |
}; |
|
71 |
||
72 |
address instruction_address() const { |
|
73 |
ShouldNotCallThis(); |
|
19336 | 74 |
return NULL; |
4013 | 75 |
} |
76 |
||
77 |
address next_instruction_address() const { |
|
78 |
ShouldNotCallThis(); |
|
19336 | 79 |
return NULL; |
4013 | 80 |
} |
81 |
||
82 |
address return_address() const { |
|
83 |
ShouldNotCallThis(); |
|
19336 | 84 |
return NULL; |
4013 | 85 |
} |
86 |
||
87 |
address destination() const { |
|
88 |
ShouldNotCallThis(); |
|
19336 | 89 |
return NULL; |
4013 | 90 |
} |
91 |
||
92 |
void set_destination_mt_safe(address dest) { |
|
93 |
ShouldNotCallThis(); |
|
94 |
} |
|
95 |
||
96 |
void verify_alignment() { |
|
97 |
ShouldNotCallThis(); |
|
98 |
} |
|
99 |
||
100 |
void verify() { |
|
101 |
ShouldNotCallThis(); |
|
102 |
} |
|
103 |
||
104 |
static bool is_call_before(address return_address) { |
|
105 |
ShouldNotCallThis(); |
|
19336 | 106 |
return false; |
4013 | 107 |
} |
108 |
}; |
|
109 |
||
110 |
inline NativeCall* nativeCall_before(address return_address) { |
|
111 |
ShouldNotCallThis(); |
|
19336 | 112 |
return NULL; |
4013 | 113 |
} |
114 |
||
115 |
inline NativeCall* nativeCall_at(address address) { |
|
116 |
ShouldNotCallThis(); |
|
19336 | 117 |
return NULL; |
4013 | 118 |
} |
119 |
||
120 |
class NativeMovConstReg : public NativeInstruction { |
|
121 |
public: |
|
122 |
address next_instruction_address() const { |
|
123 |
ShouldNotCallThis(); |
|
19336 | 124 |
return NULL; |
4013 | 125 |
} |
126 |
||
127 |
intptr_t data() const { |
|
128 |
ShouldNotCallThis(); |
|
19336 | 129 |
return 0; |
4013 | 130 |
} |
131 |
||
132 |
void set_data(intptr_t x) { |
|
133 |
ShouldNotCallThis(); |
|
134 |
} |
|
135 |
}; |
|
136 |
||
137 |
inline NativeMovConstReg* nativeMovConstReg_at(address address) { |
|
138 |
ShouldNotCallThis(); |
|
19336 | 139 |
return NULL; |
4013 | 140 |
} |
141 |
||
142 |
class NativeMovRegMem : public NativeInstruction { |
|
143 |
public: |
|
144 |
int offset() const { |
|
145 |
ShouldNotCallThis(); |
|
19336 | 146 |
return 0; |
4013 | 147 |
} |
148 |
||
149 |
void set_offset(intptr_t x) { |
|
150 |
ShouldNotCallThis(); |
|
151 |
} |
|
152 |
||
153 |
void add_offset_in_bytes(int add_offset) { |
|
154 |
ShouldNotCallThis(); |
|
155 |
} |
|
156 |
}; |
|
157 |
||
158 |
inline NativeMovRegMem* nativeMovRegMem_at(address address) { |
|
159 |
ShouldNotCallThis(); |
|
19336 | 160 |
return NULL; |
4013 | 161 |
} |
162 |
||
163 |
class NativeJump : public NativeInstruction { |
|
164 |
public: |
|
165 |
enum zero_specific_constants { |
|
166 |
instruction_size = 0 // not used within the interpreter |
|
167 |
}; |
|
168 |
||
169 |
address jump_destination() const { |
|
170 |
ShouldNotCallThis(); |
|
19336 | 171 |
return NULL; |
4013 | 172 |
} |
173 |
||
174 |
void set_jump_destination(address dest) { |
|
175 |
ShouldNotCallThis(); |
|
176 |
} |
|
177 |
||
178 |
static void check_verified_entry_alignment(address entry, |
|
179 |
address verified_entry) { |
|
180 |
} |
|
181 |
||
182 |
static void patch_verified_entry(address entry, |
|
183 |
address verified_entry, |
|
184 |
address dest); |
|
185 |
}; |
|
186 |
||
187 |
inline NativeJump* nativeJump_at(address address) { |
|
188 |
ShouldNotCallThis(); |
|
19336 | 189 |
return NULL; |
4013 | 190 |
} |
191 |
||
192 |
class NativeGeneralJump : public NativeInstruction { |
|
193 |
public: |
|
194 |
address jump_destination() const { |
|
195 |
ShouldNotCallThis(); |
|
19336 | 196 |
return NULL; |
4013 | 197 |
} |
198 |
||
199 |
static void insert_unconditional(address code_pos, address entry) { |
|
200 |
ShouldNotCallThis(); |
|
201 |
} |
|
202 |
||
203 |
static void replace_mt_safe(address instr_addr, address code_buffer) { |
|
204 |
ShouldNotCallThis(); |
|
205 |
} |
|
206 |
}; |
|
207 |
||
208 |
inline NativeGeneralJump* nativeGeneralJump_at(address address) { |
|
209 |
ShouldNotCallThis(); |
|
19336 | 210 |
return NULL; |
4013 | 211 |
} |
7397 | 212 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49621
diff
changeset
|
213 |
#endif // CPU_ZERO_NATIVEINST_ZERO_HPP |