Thu, 19 Mar 2009 09:13:24 -0700
Merge
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | #ifdef CC_INTERP |
duke@435 | 26 | |
twisti@1040 | 27 | // This file contains the platform-independent parts |
duke@435 | 28 | // of the c++ interpreter |
duke@435 | 29 | |
duke@435 | 30 | class CppInterpreter: public AbstractInterpreter { |
duke@435 | 31 | friend class VMStructs; |
duke@435 | 32 | friend class Interpreter; // contains() |
duke@435 | 33 | friend class InterpreterGenerator; // result handlers |
duke@435 | 34 | friend class CppInterpreterGenerator; // result handlers |
duke@435 | 35 | public: |
duke@435 | 36 | |
duke@435 | 37 | |
duke@435 | 38 | protected: |
duke@435 | 39 | |
duke@435 | 40 | // tosca result -> stack result |
duke@435 | 41 | static address _tosca_to_stack[number_of_result_handlers]; // converts tosca to C++ interpreter stack result |
duke@435 | 42 | // stack result -> stack result |
duke@435 | 43 | static address _stack_to_stack[number_of_result_handlers]; // pass result between C++ interpreter calls |
duke@435 | 44 | // stack result -> native abi result |
duke@435 | 45 | static address _stack_to_native_abi[number_of_result_handlers]; // converts C++ interpreter results to native abi |
duke@435 | 46 | |
duke@435 | 47 | // this is to allow frame and only frame to use contains(). |
duke@435 | 48 | friend class frame; |
duke@435 | 49 | |
duke@435 | 50 | public: |
duke@435 | 51 | // Initialization/debugging |
duke@435 | 52 | static void initialize(); |
duke@435 | 53 | // this only returns whether a pc is within generated code for the interpreter. |
duke@435 | 54 | |
duke@435 | 55 | // This is a moderately dubious interface for the c++ interpreter. Only |
duke@435 | 56 | // frame code and debug.cpp should be using it. |
duke@435 | 57 | static bool contains(address pc); |
duke@435 | 58 | |
duke@435 | 59 | public: |
duke@435 | 60 | |
duke@435 | 61 | |
duke@435 | 62 | // No displatch table to switch so no need for these to do anything special |
duke@435 | 63 | static void notice_safepoints() {} |
duke@435 | 64 | static void ignore_safepoints() {} |
duke@435 | 65 | |
duke@435 | 66 | static address native_result_to_tosca() { return (address)_native_abi_to_tosca; } // aka result handler |
duke@435 | 67 | static address tosca_result_to_stack() { return (address)_tosca_to_stack; } |
duke@435 | 68 | static address stack_result_to_stack() { return (address)_stack_to_stack; } |
duke@435 | 69 | static address stack_result_to_native() { return (address)_stack_to_native_abi; } |
duke@435 | 70 | |
duke@435 | 71 | static address native_result_to_tosca(int index) { return _native_abi_to_tosca[index]; } // aka result handler |
duke@435 | 72 | static address tosca_result_to_stack(int index) { return _tosca_to_stack[index]; } |
duke@435 | 73 | static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } |
duke@435 | 74 | static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } |
duke@435 | 75 | |
duke@435 | 76 | static address return_entry (TosState state, int length); |
duke@435 | 77 | static address deopt_entry (TosState state, int length); |
duke@435 | 78 | |
duke@435 | 79 | #include "incls/_cppInterpreter_pd.hpp.incl" |
duke@435 | 80 | |
duke@435 | 81 | }; |
duke@435 | 82 | |
duke@435 | 83 | #endif // CC_INTERP |