1 /*
2 * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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 *
189 public:
190 InlinedString(const char* msg): InlinedLiteral() {
191 _msg = msg;
192 }
193 const char* msg() { return _msg; }
194 };
195
196 class MacroAssembler: public Assembler {
197 protected:
198
199 // Support for VM calls
200 //
201
202 // This is the base routine called by the different versions of call_VM_leaf.
203 void call_VM_leaf_helper(address entry_point, int number_of_arguments);
204
205 // This is the base routine called by the different versions of call_VM. The interpreter
206 // may customize this version by overriding it for its purposes (e.g., to save/restore
207 // additional registers when doing a VM call).
208 virtual void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions);
209
210 // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
211 // The implementation is only non-empty for the InterpreterMacroAssembler,
212 // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
213 virtual void check_and_handle_popframe() {}
214 virtual void check_and_handle_earlyret() {}
215
216 public:
217
218 MacroAssembler(CodeBuffer* code) : Assembler(code) {}
219
220 // By default, we do not need relocation information for non
221 // patchable absolute addresses. However, when needed by some
222 // extensions, ignore_non_patchable_relocations can be modified,
223 // returning false to preserve all relocation information.
224 inline bool ignore_non_patchable_relocations() { return true; }
225
226 // Initially added to the Assembler interface as a pure virtual:
227 // RegisterConstant delayed_value(..)
228 // for:
229 // 6812678 macro assembler needs delayed binding of a few constants (for 6655638)
230 // this was subsequently modified to its present name and return type
231 virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset);
232
233 #ifdef AARCH64
234 # define NOT_IMPLEMENTED() unimplemented("NYI at " __FILE__ ":" XSTR(__LINE__))
235 # define NOT_TESTED() warn("Not tested at " __FILE__ ":" XSTR(__LINE__))
236 #endif
237
238 void align(int modulus);
239
|
1 /*
2 * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
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 *
189 public:
190 InlinedString(const char* msg): InlinedLiteral() {
191 _msg = msg;
192 }
193 const char* msg() { return _msg; }
194 };
195
196 class MacroAssembler: public Assembler {
197 protected:
198
199 // Support for VM calls
200 //
201
202 // This is the base routine called by the different versions of call_VM_leaf.
203 void call_VM_leaf_helper(address entry_point, int number_of_arguments);
204
205 // This is the base routine called by the different versions of call_VM. The interpreter
206 // may customize this version by overriding it for its purposes (e.g., to save/restore
207 // additional registers when doing a VM call).
208 virtual void call_VM_helper(Register oop_result, address entry_point, int number_of_arguments, bool check_exceptions);
209 public:
210
211 MacroAssembler(CodeBuffer* code) : Assembler(code) {}
212
213 // These routines should emit JVMTI PopFrame and ForceEarlyReturn handling code.
214 // The implementation is only non-empty for the InterpreterMacroAssembler,
215 // as only the interpreter handles PopFrame and ForceEarlyReturn requests.
216 virtual void check_and_handle_popframe() {}
217 virtual void check_and_handle_earlyret() {}
218
219 // By default, we do not need relocation information for non
220 // patchable absolute addresses. However, when needed by some
221 // extensions, ignore_non_patchable_relocations can be modified,
222 // returning false to preserve all relocation information.
223 inline bool ignore_non_patchable_relocations() { return true; }
224
225 // Initially added to the Assembler interface as a pure virtual:
226 // RegisterConstant delayed_value(..)
227 // for:
228 // 6812678 macro assembler needs delayed binding of a few constants (for 6655638)
229 // this was subsequently modified to its present name and return type
230 virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset);
231
232 #ifdef AARCH64
233 # define NOT_IMPLEMENTED() unimplemented("NYI at " __FILE__ ":" XSTR(__LINE__))
234 # define NOT_TESTED() warn("Not tested at " __FILE__ ":" XSTR(__LINE__))
235 #endif
236
237 void align(int modulus);
238
|