1 /*
 2  * Copyright (c) 1997, 2023, 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_INTERPRETER_ZEROINTERPRETER_HPP
26 #define SHARE_INTERPRETER_ZEROINTERPRETER_HPP
27 
28 #include "interpreter/abstractInterpreter.hpp"
29 #include "utilities/macros.hpp"
30 
31 #ifdef ZERO
32 
33 class InterpreterCodelet;
34 
35 // This file contains the platform-independent parts
36 // of the c++ interpreter
37 
38 class ZeroInterpreter: public AbstractInterpreter {
39   friend class VMStructs;
40  public:
41   // Initialization/debugging
42   static void       initialize_stub();
43   static void       initialize_code();
44   // this only returns whether a pc is within generated code for the interpreter.
45 
46   // These are moderately dubious interfaces for the c++ interpreter. Only
47   // frame code and debug.cpp should be using it.
48   static bool       contains(address pc);
49   static InterpreterCodelet* codelet_containing(address pc);
50 
51  public:
52 
53 
54   // No displatch table to switch so no need for these to do anything special
55   static void notice_safepoints() {}
56   static void ignore_safepoints() {}
57 
58   static address    return_entry  (TosState state, int length, Bytecodes::Code code);
59   static address    deopt_entry   (TosState state, int length);
60 
61   static address    remove_activation_entry() { return (address)-1; }
62   static address    remove_activation_early_entry(TosState state);
63   static address    remove_activation_preserving_args_entry();
64 
65   static void invoke_method(Method* method, address entry_point, TRAPS);
66   static void invoke_osr(Method* method,
67                          address   entry_point,
68                          address   osr_buf,
69                          TRAPS);
70 
71   static address throw_NullPointerException_entry() { return nullptr; }
72   static address throw_ArithmeticException_entry()  { return nullptr; }
73   static address throw_StackOverflowError_entry()   { return nullptr; }
74 
75 # include "zeroInterpreter_zero.hpp"
76 };
77 
78 #endif // ZERO
79 
80 #endif // SHARE_INTERPRETER_ZEROINTERPRETER_HPP