0N/A/*
2273N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
1879N/A#define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP
1879N/A
1879N/A#include "interpreter/abstractInterpreter.hpp"
1879N/A
0N/A#ifdef CC_INTERP
0N/A
605N/A// This file contains the platform-independent parts
0N/A// of the c++ interpreter
0N/A
0N/Aclass CppInterpreter: public AbstractInterpreter {
0N/A friend class VMStructs;
0N/A friend class Interpreter; // contains()
0N/A friend class InterpreterGenerator; // result handlers
0N/A friend class CppInterpreterGenerator; // result handlers
0N/A public:
0N/A
0N/A
0N/A protected:
0N/A
0N/A // tosca result -> stack result
0N/A static address _tosca_to_stack[number_of_result_handlers]; // converts tosca to C++ interpreter stack result
0N/A // stack result -> stack result
0N/A static address _stack_to_stack[number_of_result_handlers]; // pass result between C++ interpreter calls
0N/A // stack result -> native abi result
0N/A static address _stack_to_native_abi[number_of_result_handlers]; // converts C++ interpreter results to native abi
0N/A
0N/A // this is to allow frame and only frame to use contains().
0N/A friend class frame;
0N/A
0N/A public:
0N/A // Initialization/debugging
0N/A static void initialize();
0N/A // this only returns whether a pc is within generated code for the interpreter.
0N/A
0N/A // This is a moderately dubious interface for the c++ interpreter. Only
0N/A // frame code and debug.cpp should be using it.
0N/A static bool contains(address pc);
0N/A
0N/A public:
0N/A
0N/A
0N/A // No displatch table to switch so no need for these to do anything special
0N/A static void notice_safepoints() {}
0N/A static void ignore_safepoints() {}
0N/A
0N/A static address native_result_to_tosca() { return (address)_native_abi_to_tosca; } // aka result handler
0N/A static address tosca_result_to_stack() { return (address)_tosca_to_stack; }
0N/A static address stack_result_to_stack() { return (address)_stack_to_stack; }
0N/A static address stack_result_to_native() { return (address)_stack_to_native_abi; }
0N/A
0N/A static address native_result_to_tosca(int index) { return _native_abi_to_tosca[index]; } // aka result handler
0N/A static address tosca_result_to_stack(int index) { return _tosca_to_stack[index]; }
0N/A static address stack_result_to_stack(int index) { return _stack_to_stack[index]; }
0N/A static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; }
0N/A
0N/A static address return_entry (TosState state, int length);
0N/A static address deopt_entry (TosState state, int length);
0N/A
1879N/A#ifdef TARGET_ARCH_x86
1879N/A# include "cppInterpreter_x86.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_ARCH_sparc
1879N/A# include "cppInterpreter_sparc.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_ARCH_zero
1879N/A# include "cppInterpreter_zero.hpp"
1879N/A#endif
2073N/A#ifdef TARGET_ARCH_arm
2073N/A# include "cppInterpreter_arm.hpp"
2073N/A#endif
2073N/A#ifdef TARGET_ARCH_ppc
2073N/A# include "cppInterpreter_ppc.hpp"
2073N/A#endif
1879N/A
0N/A
0N/A};
0N/A
0N/A#endif // CC_INTERP
1879N/A
1879N/A#endif // SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP