1 /*
2 * Copyright (c) 1997, 2009, 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 *
23 */
24
25 // This file contains the platform-independent parts
26 // of the template interpreter and the template interpreter generator.
27
28 #ifndef CC_INTERP
29
30 //------------------------------------------------------------------------------------------------------------------------
31 // A little wrapper class to group tosca-specific entry points into a unit.
32 // (tosca = Top-Of-Stack CAche)
33
34 class EntryPoint VALUE_OBJ_CLASS_SPEC {
35 private:
36 address _entry[number_of_states];
37
38 public:
39 // Construction
40 EntryPoint();
41 EntryPoint(address bentry, address centry, address sentry, address aentry, address ientry, address lentry, address fentry, address dentry, address ventry);
42
43 // Attributes
44 address entry(TosState state) const; // return target address for a given tosca state
160 static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table
161
162 static address return_entry (TosState state, int length);
163 static address deopt_entry (TosState state, int length);
164
165 // Safepoint support
166 static void notice_safepoints(); // stops the thread when reaching a safepoint
167 static void ignore_safepoints(); // ignores safepoints
168
169 // Deoptimization support
170 // Compute the entry address for continuation after
171 static address deopt_continue_after_entry(methodOop method,
172 address bcp,
173 int callee_parameters,
174 bool is_top_frame);
175 // Deoptimization should reexecute this bytecode
176 static bool bytecode_should_reexecute(Bytecodes::Code code);
177 // Compute the address for reexecution
178 static address deopt_reexecute_entry(methodOop method, address bcp);
179
180 #include "incls/_templateInterpreter_pd.hpp.incl"
181
182 };
183
184 #endif // !CC_INTERP
|
1 /*
2 * Copyright (c) 1997, 2010, 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 *
23 */
24
25 #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
26 #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
27
28 #include "interpreter/abstractInterpreter.hpp"
29 #include "interpreter/templateTable.hpp"
30
31 // This file contains the platform-independent parts
32 // of the template interpreter and the template interpreter generator.
33
34 #ifndef CC_INTERP
35
36 //------------------------------------------------------------------------------------------------------------------------
37 // A little wrapper class to group tosca-specific entry points into a unit.
38 // (tosca = Top-Of-Stack CAche)
39
40 class EntryPoint VALUE_OBJ_CLASS_SPEC {
41 private:
42 address _entry[number_of_states];
43
44 public:
45 // Construction
46 EntryPoint();
47 EntryPoint(address bentry, address centry, address sentry, address aentry, address ientry, address lentry, address fentry, address dentry, address ventry);
48
49 // Attributes
50 address entry(TosState state) const; // return target address for a given tosca state
166 static int TosState_as_index(TosState state); // computes index into return_3_entry_by_index table
167
168 static address return_entry (TosState state, int length);
169 static address deopt_entry (TosState state, int length);
170
171 // Safepoint support
172 static void notice_safepoints(); // stops the thread when reaching a safepoint
173 static void ignore_safepoints(); // ignores safepoints
174
175 // Deoptimization support
176 // Compute the entry address for continuation after
177 static address deopt_continue_after_entry(methodOop method,
178 address bcp,
179 int callee_parameters,
180 bool is_top_frame);
181 // Deoptimization should reexecute this bytecode
182 static bool bytecode_should_reexecute(Bytecodes::Code code);
183 // Compute the address for reexecution
184 static address deopt_reexecute_entry(methodOop method, address bcp);
185
186 #ifdef TARGET_ARCH_x86
187 # include "templateInterpreter_x86.hpp"
188 #endif
189 #ifdef TARGET_ARCH_sparc
190 # include "templateInterpreter_sparc.hpp"
191 #endif
192 #ifdef TARGET_ARCH_zero
193 # include "templateInterpreter_zero.hpp"
194 #endif
195
196
197 };
198
199 #endif // !CC_INTERP
200
201 #endif // SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP
|