1 /*
2 * Copyright (c) 1997, 2015, 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 *
31 #include "runtime/frame.hpp"
32
33 // This file specializes the assember with interpreter-specific macros
34
35 typedef ByteSize (*OffsetFunction)(uint);
36
37 class InterpreterMacroAssembler: public MacroAssembler {
38
39 protected:
40 // Interpreter specific version of call_VM_base
41 virtual void call_VM_leaf_base(address entry_point,
42 int number_of_arguments);
43
44 virtual void call_VM_base(Register oop_result,
45 Register java_thread,
46 Register last_java_sp,
47 address entry_point,
48 int number_of_arguments,
49 bool check_exceptions);
50
51 virtual void check_and_handle_popframe(Register java_thread);
52 virtual void check_and_handle_earlyret(Register java_thread);
53
54 // base routine for all dispatches
55 void dispatch_base(TosState state, address* table, bool verifyoop = true);
56
57 public:
58 InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code),
59 _locals_register(LP64_ONLY(r14) NOT_LP64(rdi)),
60 _bcp_register(LP64_ONLY(r13) NOT_LP64(rsi)) {}
61
62 void jump_to_entry(address entry);
63
64 void load_earlyret_value(TosState state);
65
66 // Interpreter-specific registers
67 void save_bcp() {
68 movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), _bcp_register);
69 }
70
71 void restore_bcp() {
72 movptr(_bcp_register, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize));
73 }
74
75 void restore_locals() {
76 movptr(_locals_register, Address(rbp, frame::interpreter_frame_locals_offset * wordSize));
77 }
78
79 // Helpers for runtime call arguments/results
80 void get_method(Register reg) {
81 movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
82 }
83
|
1 /*
2 * Copyright (c) 1997, 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 *
31 #include "runtime/frame.hpp"
32
33 // This file specializes the assember with interpreter-specific macros
34
35 typedef ByteSize (*OffsetFunction)(uint);
36
37 class InterpreterMacroAssembler: public MacroAssembler {
38
39 protected:
40 // Interpreter specific version of call_VM_base
41 virtual void call_VM_leaf_base(address entry_point,
42 int number_of_arguments);
43
44 virtual void call_VM_base(Register oop_result,
45 Register java_thread,
46 Register last_java_sp,
47 address entry_point,
48 int number_of_arguments,
49 bool check_exceptions);
50
51 // base routine for all dispatches
52 void dispatch_base(TosState state, address* table, bool verifyoop = true);
53
54 public:
55 InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code),
56 _locals_register(LP64_ONLY(r14) NOT_LP64(rdi)),
57 _bcp_register(LP64_ONLY(r13) NOT_LP64(rsi)) {}
58
59 void jump_to_entry(address entry);
60
61 virtual void check_and_handle_popframe(Register java_thread);
62 virtual void check_and_handle_earlyret(Register java_thread);
63
64 void load_earlyret_value(TosState state);
65
66 // Interpreter-specific registers
67 void save_bcp() {
68 movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), _bcp_register);
69 }
70
71 void restore_bcp() {
72 movptr(_bcp_register, Address(rbp, frame::interpreter_frame_bcp_offset * wordSize));
73 }
74
75 void restore_locals() {
76 movptr(_locals_register, Address(rbp, frame::interpreter_frame_locals_offset * wordSize));
77 }
78
79 // Helpers for runtime call arguments/results
80 void get_method(Register reg) {
81 movptr(reg, Address(rbp, frame::interpreter_frame_method_offset * wordSize));
82 }
83
|