src/share/vm/runtime/stubRoutines.hpp

Print this page




   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 // StubRoutines provides entry points to assembly routines used by
  26 // compiled code and the run-time system. Platform-specific entry
  27 // points are defined in the platform-specific inner class.
  28 //
  29 // Class scheme:
  30 //
  31 //    platform-independent               platform-dependent
  32 //
  33 //    stubRoutines.hpp  <-- included --  stubRoutines_<arch>.hpp
  34 //           ^                                  ^
  35 //           |                                  |
  36 //       implements                         implements
  37 //           |                                  |
  38 //           |                                  |
  39 //    stubRoutines.cpp                   stubRoutines_<arch>.cpp
  40 //    stubRoutines_<os_family>.cpp       stubGenerator_<arch>.cpp
  41 //    stubRoutines_<os_arch>.cpp
  42 //
  43 // Note 1: The important thing is a clean decoupling between stub
  44 //         entry points (interfacing to the whole vm; i.e., 1-to-n


  57 // Scheme for adding a new entry point:
  58 //
  59 // 1. determine if it's a platform-dependent or independent entry point
  60 //    a) if platform independent: make subsequent changes in the independent files
  61 //    b) if platform   dependent: make subsequent changes in the   dependent files
  62 // 2. add a private instance variable holding the entry point address
  63 // 3. add a public accessor function to the instance variable
  64 // 4. implement the corresponding generator function in the platform-dependent
  65 //    stubGenerator_<arch>.cpp file and call the function in generate_all() of that file
  66 
  67 
  68 class StubRoutines: AllStatic {
  69 
  70  public:
  71   enum platform_independent_constants {
  72     max_size_of_parameters = 256                           // max. parameter size supported by megamorphic lookups
  73   };
  74 
  75   // Dependencies
  76   friend class StubGenerator;
  77   #include "incls/_stubRoutines_pd.hpp.incl"               // machine-specific parts












  78 
  79   static jint    _verify_oop_count;
  80   static address _verify_oop_subroutine_entry;
  81 
  82   static address _call_stub_return_address;                // the return PC, when returning to a call stub
  83   static address _call_stub_entry;
  84   static address _forward_exception_entry;
  85   static address _catch_exception_entry;
  86   static address _throw_AbstractMethodError_entry;
  87   static address _throw_IncompatibleClassChangeError_entry;
  88   static address _throw_ArithmeticException_entry;
  89   static address _throw_NullPointerException_entry;
  90   static address _throw_NullPointerException_at_call_entry;
  91   static address _throw_StackOverflowError_entry;
  92   static address _handler_for_unsafe_access_entry;
  93 
  94   static address _atomic_xchg_entry;
  95   static address _atomic_xchg_ptr_entry;
  96   static address _atomic_store_entry;
  97   static address _atomic_store_ptr_entry;


 304     assert(_intrinsic_tan != NULL, "must be defined");
 305     return _intrinsic_tan(d);
 306   }
 307 
 308   //
 309   // Default versions of the above arraycopy functions for platforms which do
 310   // not have specialized versions
 311   //
 312   static void jbyte_copy (jbyte*  src, jbyte*  dest, size_t count);
 313   static void jshort_copy(jshort* src, jshort* dest, size_t count);
 314   static void jint_copy  (jint*   src, jint*   dest, size_t count);
 315   static void jlong_copy (jlong*  src, jlong*  dest, size_t count);
 316   static void oop_copy   (oop*    src, oop*    dest, size_t count);
 317 
 318   static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
 319   static void arrayof_jshort_copy(HeapWord* src, HeapWord* dest, size_t count);
 320   static void arrayof_jint_copy  (HeapWord* src, HeapWord* dest, size_t count);
 321   static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
 322   static void arrayof_oop_copy   (HeapWord* src, HeapWord* dest, size_t count);
 323 };




   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_RUNTIME_STUBROUTINES_HPP
  26 #define SHARE_VM_RUNTIME_STUBROUTINES_HPP
  27 
  28 #include "code/codeBlob.hpp"
  29 #include "memory/allocation.hpp"
  30 #include "runtime/frame.hpp"
  31 #include "runtime/mutexLocker.hpp"
  32 #include "runtime/stubCodeGenerator.hpp"
  33 #include "utilities/top.hpp"
  34 #ifdef TARGET_ARCH_x86
  35 # include "nativeInst_x86.hpp"
  36 #endif
  37 #ifdef TARGET_ARCH_sparc
  38 # include "nativeInst_sparc.hpp"
  39 #endif
  40 #ifdef TARGET_ARCH_zero
  41 # include "nativeInst_zero.hpp"
  42 #endif
  43 
  44 // StubRoutines provides entry points to assembly routines used by
  45 // compiled code and the run-time system. Platform-specific entry
  46 // points are defined in the platform-specific inner class.
  47 //
  48 // Class scheme:
  49 //
  50 //    platform-independent               platform-dependent
  51 //
  52 //    stubRoutines.hpp  <-- included --  stubRoutines_<arch>.hpp
  53 //           ^                                  ^
  54 //           |                                  |
  55 //       implements                         implements
  56 //           |                                  |
  57 //           |                                  |
  58 //    stubRoutines.cpp                   stubRoutines_<arch>.cpp
  59 //    stubRoutines_<os_family>.cpp       stubGenerator_<arch>.cpp
  60 //    stubRoutines_<os_arch>.cpp
  61 //
  62 // Note 1: The important thing is a clean decoupling between stub
  63 //         entry points (interfacing to the whole vm; i.e., 1-to-n


  76 // Scheme for adding a new entry point:
  77 //
  78 // 1. determine if it's a platform-dependent or independent entry point
  79 //    a) if platform independent: make subsequent changes in the independent files
  80 //    b) if platform   dependent: make subsequent changes in the   dependent files
  81 // 2. add a private instance variable holding the entry point address
  82 // 3. add a public accessor function to the instance variable
  83 // 4. implement the corresponding generator function in the platform-dependent
  84 //    stubGenerator_<arch>.cpp file and call the function in generate_all() of that file
  85 
  86 
  87 class StubRoutines: AllStatic {
  88 
  89  public:
  90   enum platform_independent_constants {
  91     max_size_of_parameters = 256                           // max. parameter size supported by megamorphic lookups
  92   };
  93 
  94   // Dependencies
  95   friend class StubGenerator;
  96 #ifdef TARGET_ARCH_MODEL_x86_32
  97 # include "stubRoutines_x86_32.hpp"
  98 #endif
  99 #ifdef TARGET_ARCH_MODEL_x86_64
 100 # include "stubRoutines_x86_64.hpp"
 101 #endif
 102 #ifdef TARGET_ARCH_MODEL_sparc
 103 # include "stubRoutines_sparc.hpp"
 104 #endif
 105 #ifdef TARGET_ARCH_MODEL_zero
 106 # include "stubRoutines_zero.hpp"
 107 #endif
 108 
 109 
 110   static jint    _verify_oop_count;
 111   static address _verify_oop_subroutine_entry;
 112 
 113   static address _call_stub_return_address;                // the return PC, when returning to a call stub
 114   static address _call_stub_entry;
 115   static address _forward_exception_entry;
 116   static address _catch_exception_entry;
 117   static address _throw_AbstractMethodError_entry;
 118   static address _throw_IncompatibleClassChangeError_entry;
 119   static address _throw_ArithmeticException_entry;
 120   static address _throw_NullPointerException_entry;
 121   static address _throw_NullPointerException_at_call_entry;
 122   static address _throw_StackOverflowError_entry;
 123   static address _handler_for_unsafe_access_entry;
 124 
 125   static address _atomic_xchg_entry;
 126   static address _atomic_xchg_ptr_entry;
 127   static address _atomic_store_entry;
 128   static address _atomic_store_ptr_entry;


 335     assert(_intrinsic_tan != NULL, "must be defined");
 336     return _intrinsic_tan(d);
 337   }
 338 
 339   //
 340   // Default versions of the above arraycopy functions for platforms which do
 341   // not have specialized versions
 342   //
 343   static void jbyte_copy (jbyte*  src, jbyte*  dest, size_t count);
 344   static void jshort_copy(jshort* src, jshort* dest, size_t count);
 345   static void jint_copy  (jint*   src, jint*   dest, size_t count);
 346   static void jlong_copy (jlong*  src, jlong*  dest, size_t count);
 347   static void oop_copy   (oop*    src, oop*    dest, size_t count);
 348 
 349   static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
 350   static void arrayof_jshort_copy(HeapWord* src, HeapWord* dest, size_t count);
 351   static void arrayof_jint_copy  (HeapWord* src, HeapWord* dest, size_t count);
 352   static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
 353   static void arrayof_oop_copy   (HeapWord* src, HeapWord* dest, size_t count);
 354 };
 355 
 356 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP