src/share/vm/interpreter/abstractInterpreter.hpp

Print this page
rev 6670 : 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
Reviewed-by: lfoltan, coleenp, dholmes
   1 /*
   2  * Copyright (c) 1997, 2013, 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_ABSTRACTINTERPRETER_HPP
  26 #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
  27 

  28 #include "code/stubs.hpp"
  29 #include "interpreter/bytecodes.hpp"
  30 #include "runtime/thread.inline.hpp"
  31 #include "runtime/vmThread.hpp"
  32 #include "utilities/top.hpp"
  33 #ifdef TARGET_ARCH_x86
  34 # include "interp_masm_x86.hpp"
  35 #endif
  36 #ifdef TARGET_ARCH_MODEL_sparc
  37 # include "interp_masm_sparc.hpp"
  38 #endif
  39 #ifdef TARGET_ARCH_MODEL_zero
  40 # include "interp_masm_zero.hpp"
  41 #endif
  42 #ifdef TARGET_ARCH_MODEL_arm
  43 # include "interp_masm_arm.hpp"
  44 #endif
  45 #ifdef TARGET_ARCH_MODEL_ppc_32
  46 # include "interp_masm_ppc_32.hpp"
  47 #endif
  48 #ifdef TARGET_ARCH_MODEL_ppc_64
  49 # include "interp_masm_ppc_64.hpp"
  50 #endif
  51 
  52 // This file contains the platform-independent parts
  53 // of the abstract interpreter and the abstract interpreter generator.
  54 
  55 // Organization of the interpreter(s). There exists two different interpreters in hotpot
  56 // an assembly language version (aka template interpreter) and a high level language version
  57 // (aka c++ interpreter). Th division of labor is as follows:
  58 
  59 // Template Interpreter          C++ Interpreter        Functionality
  60 //
  61 // templateTable*                bytecodeInterpreter*   actual interpretation of bytecodes
  62 //
  63 // templateInterpreter*          cppInterpreter*        generation of assembly code that creates
  64 //                                                      and manages interpreter runtime frames.
  65 //                                                      Also code for populating interpreter
  66 //                                                      frames created during deoptimization.
  67 //
  68 // For both template and c++ interpreter. There are common files for aspects of the interpreter
  69 // that are generic to both interpreters. This is the layout:
  70 //
  71 // abstractInterpreter.hpp: generic description of the interpreter.
  72 // interpreter*:            generic frame creation and handling.
  73 //
  74 
  75 //------------------------------------------------------------------------------------------------------------------------
  76 // The C++ interface to the bytecode interpreter(s).
  77 


  78 class AbstractInterpreter: AllStatic {
  79   friend class VMStructs;
  80   friend class Interpreter;
  81   friend class CppInterpreterGenerator;
  82  public:
  83   enum MethodKind {
  84     zerolocals,                                                 // method needs locals initialization
  85     zerolocals_synchronized,                                    // method needs locals initialization & is synchronized
  86     native,                                                     // native method
  87     native_synchronized,                                        // native method & is synchronized
  88     empty,                                                      // empty method (code: _return)
  89     accessor,                                                   // accessor method (code: _aload_0, _getfield, _(a|i)return)
  90     abstract,                                                   // abstract method (throws an AbstractMethodException)
  91     method_handle_invoke_FIRST,                                 // java.lang.invoke.MethodHandles::invokeExact, etc.
  92     method_handle_invoke_LAST                                   = (method_handle_invoke_FIRST
  93                                                                    + (vmIntrinsics::LAST_MH_SIG_POLY
  94                                                                       - vmIntrinsics::FIRST_MH_SIG_POLY)),
  95     java_lang_math_sin,                                         // implementation of java.lang.Math.sin   (x)
  96     java_lang_math_cos,                                         // implementation of java.lang.Math.cos   (x)
  97     java_lang_math_tan,                                         // implementation of java.lang.Math.tan   (x)


   1 /*
   2  * Copyright (c) 1997, 2014, 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_ABSTRACTINTERPRETER_HPP
  26 #define SHARE_VM_INTERPRETER_ABSTRACTINTERPRETER_HPP
  27 
  28 #include "asm/macroAssembler.hpp"
  29 #include "code/stubs.hpp"
  30 #include "interpreter/bytecodes.hpp"
  31 #include "runtime/thread.inline.hpp"
  32 #include "runtime/vmThread.hpp"
  33 #include "utilities/top.hpp"


















  34 
  35 // This file contains the platform-independent parts
  36 // of the abstract interpreter and the abstract interpreter generator.
  37 
  38 // Organization of the interpreter(s). There exists two different interpreters in hotpot
  39 // an assembly language version (aka template interpreter) and a high level language version
  40 // (aka c++ interpreter). Th division of labor is as follows:
  41 
  42 // Template Interpreter          C++ Interpreter        Functionality
  43 //
  44 // templateTable*                bytecodeInterpreter*   actual interpretation of bytecodes
  45 //
  46 // templateInterpreter*          cppInterpreter*        generation of assembly code that creates
  47 //                                                      and manages interpreter runtime frames.
  48 //                                                      Also code for populating interpreter
  49 //                                                      frames created during deoptimization.
  50 //
  51 // For both template and c++ interpreter. There are common files for aspects of the interpreter
  52 // that are generic to both interpreters. This is the layout:
  53 //
  54 // abstractInterpreter.hpp: generic description of the interpreter.
  55 // interpreter*:            generic frame creation and handling.
  56 //
  57 
  58 //------------------------------------------------------------------------------------------------------------------------
  59 // The C++ interface to the bytecode interpreter(s).
  60 
  61 class InterpreterMacroAssembler;
  62 
  63 class AbstractInterpreter: AllStatic {
  64   friend class VMStructs;
  65   friend class Interpreter;
  66   friend class CppInterpreterGenerator;
  67  public:
  68   enum MethodKind {
  69     zerolocals,                                                 // method needs locals initialization
  70     zerolocals_synchronized,                                    // method needs locals initialization & is synchronized
  71     native,                                                     // native method
  72     native_synchronized,                                        // native method & is synchronized
  73     empty,                                                      // empty method (code: _return)
  74     accessor,                                                   // accessor method (code: _aload_0, _getfield, _(a|i)return)
  75     abstract,                                                   // abstract method (throws an AbstractMethodException)
  76     method_handle_invoke_FIRST,                                 // java.lang.invoke.MethodHandles::invokeExact, etc.
  77     method_handle_invoke_LAST                                   = (method_handle_invoke_FIRST
  78                                                                    + (vmIntrinsics::LAST_MH_SIG_POLY
  79                                                                       - vmIntrinsics::FIRST_MH_SIG_POLY)),
  80     java_lang_math_sin,                                         // implementation of java.lang.Math.sin   (x)
  81     java_lang_math_cos,                                         // implementation of java.lang.Math.cos   (x)
  82     java_lang_math_tan,                                         // implementation of java.lang.Math.tan   (x)