src/share/vm/runtime/stubRoutines.hpp

Tue, 29 May 2018 20:20:25 +0800

author
aoqi
date
Tue, 29 May 2018 20:20:25 +0800
changeset 9122
024be04bb151
parent 8604
04d83ba48607
child 9806
758c07667682
permissions
-rw-r--r--

Merge

aoqi@0 1 /*
dlong@7598 2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@1 25 /*
aoqi@1 26 * This file has been modified by Loongson Technology in 2015. These
aoqi@1 27 * modifications are Copyright (c) 2015 Loongson Technology, and are made
aoqi@1 28 * available on the same license terms set forth above.
aoqi@1 29 */
aoqi@1 30
aoqi@0 31 #ifndef SHARE_VM_RUNTIME_STUBROUTINES_HPP
aoqi@0 32 #define SHARE_VM_RUNTIME_STUBROUTINES_HPP
aoqi@0 33
aoqi@0 34 #include "code/codeBlob.hpp"
aoqi@0 35 #include "memory/allocation.hpp"
aoqi@0 36 #include "runtime/frame.hpp"
aoqi@0 37 #include "runtime/mutexLocker.hpp"
aoqi@0 38 #include "runtime/stubCodeGenerator.hpp"
aoqi@0 39 #include "utilities/top.hpp"
aoqi@0 40 #ifdef TARGET_ARCH_x86
aoqi@0 41 # include "nativeInst_x86.hpp"
aoqi@0 42 #endif
aoqi@0 43 #ifdef TARGET_ARCH_sparc
aoqi@0 44 # include "nativeInst_sparc.hpp"
aoqi@0 45 #endif
aoqi@0 46 #ifdef TARGET_ARCH_zero
aoqi@0 47 # include "nativeInst_zero.hpp"
aoqi@0 48 #endif
aoqi@0 49 #ifdef TARGET_ARCH_arm
aoqi@0 50 # include "nativeInst_arm.hpp"
aoqi@0 51 #endif
aoqi@0 52 #ifdef TARGET_ARCH_ppc
aoqi@0 53 # include "nativeInst_ppc.hpp"
aoqi@0 54 #endif
aoqi@1 55 #ifdef TARGET_ARCH_mips
aoqi@1 56 # include "nativeInst_mips.hpp"
aoqi@1 57 #endif
aoqi@0 58
aoqi@0 59 // StubRoutines provides entry points to assembly routines used by
aoqi@0 60 // compiled code and the run-time system. Platform-specific entry
aoqi@0 61 // points are defined in the platform-specific inner class.
aoqi@0 62 //
aoqi@0 63 // Class scheme:
aoqi@0 64 //
aoqi@0 65 // platform-independent platform-dependent
aoqi@0 66 //
aoqi@0 67 // stubRoutines.hpp <-- included -- stubRoutines_<arch>.hpp
aoqi@0 68 // ^ ^
aoqi@0 69 // | |
aoqi@0 70 // implements implements
aoqi@0 71 // | |
aoqi@0 72 // | |
aoqi@0 73 // stubRoutines.cpp stubRoutines_<arch>.cpp
aoqi@0 74 // stubRoutines_<os_family>.cpp stubGenerator_<arch>.cpp
aoqi@0 75 // stubRoutines_<os_arch>.cpp
aoqi@0 76 //
aoqi@0 77 // Note 1: The important thing is a clean decoupling between stub
aoqi@0 78 // entry points (interfacing to the whole vm; i.e., 1-to-n
aoqi@0 79 // relationship) and stub generators (interfacing only to
aoqi@0 80 // the entry points implementation; i.e., 1-to-1 relationship).
aoqi@0 81 // This significantly simplifies changes in the generator
aoqi@0 82 // structure since the rest of the vm is not affected.
aoqi@0 83 //
aoqi@0 84 // Note 2: stubGenerator_<arch>.cpp contains a minimal portion of
aoqi@0 85 // machine-independent code; namely the generator calls of
aoqi@0 86 // the generator functions that are used platform-independently.
aoqi@0 87 // However, it comes with the advantage of having a 1-file
aoqi@0 88 // implementation of the generator. It should be fairly easy
aoqi@0 89 // to change, should it become a problem later.
aoqi@0 90 //
aoqi@0 91 // Scheme for adding a new entry point:
aoqi@0 92 //
aoqi@0 93 // 1. determine if it's a platform-dependent or independent entry point
aoqi@0 94 // a) if platform independent: make subsequent changes in the independent files
aoqi@0 95 // b) if platform dependent: make subsequent changes in the dependent files
aoqi@0 96 // 2. add a private instance variable holding the entry point address
aoqi@0 97 // 3. add a public accessor function to the instance variable
aoqi@0 98 // 4. implement the corresponding generator function in the platform-dependent
aoqi@0 99 // stubGenerator_<arch>.cpp file and call the function in generate_all() of that file
aoqi@0 100
aoqi@0 101
aoqi@0 102 class StubRoutines: AllStatic {
aoqi@0 103
aoqi@0 104 public:
aoqi@0 105 enum platform_independent_constants {
aoqi@0 106 max_size_of_parameters = 256 // max. parameter size supported by megamorphic lookups
aoqi@0 107 };
aoqi@0 108
aoqi@0 109 // Dependencies
aoqi@0 110 friend class StubGenerator;
dlong@7598 111 #if defined STUBROUTINES_MD_HPP
dlong@7598 112 # include STUBROUTINES_MD_HPP
dlong@7598 113 #elif defined TARGET_ARCH_MODEL_x86_32
aoqi@0 114 # include "stubRoutines_x86_32.hpp"
dlong@7598 115 #elif defined TARGET_ARCH_MODEL_x86_64
aoqi@0 116 # include "stubRoutines_x86_64.hpp"
dlong@7598 117 #elif defined TARGET_ARCH_MODEL_sparc
kvn@7152 118 # include "stubRoutines_sparc.hpp"
dlong@7598 119 #elif defined TARGET_ARCH_MODEL_zero
kvn@7152 120 # include "stubRoutines_zero.hpp"
dlong@7598 121 #elif defined TARGET_ARCH_MODEL_ppc_64
kvn@7152 122 # include "stubRoutines_ppc_64.hpp"
aoqi@7994 123 #elif defined TARGET_ARCH_MODEL_mips_64
aoqi@1 124 # include "stubRoutines_mips_64.hpp"
aoqi@1 125 #endif
aoqi@0 126
aoqi@0 127 static jint _verify_oop_count;
aoqi@0 128 static address _verify_oop_subroutine_entry;
aoqi@0 129
aoqi@0 130 static address _call_stub_return_address; // the return PC, when returning to a call stub
aoqi@0 131 static address _call_stub_entry;
aoqi@0 132 static address _forward_exception_entry;
aoqi@0 133 static address _catch_exception_entry;
aoqi@0 134 static address _throw_AbstractMethodError_entry;
aoqi@0 135 static address _throw_IncompatibleClassChangeError_entry;
aoqi@0 136 static address _throw_NullPointerException_at_call_entry;
aoqi@0 137 static address _throw_StackOverflowError_entry;
aoqi@0 138 static address _handler_for_unsafe_access_entry;
aoqi@0 139
aoqi@0 140 static address _atomic_xchg_entry;
aoqi@0 141 static address _atomic_xchg_ptr_entry;
aoqi@0 142 static address _atomic_store_entry;
aoqi@0 143 static address _atomic_store_ptr_entry;
aoqi@0 144 static address _atomic_cmpxchg_entry;
aoqi@0 145 static address _atomic_cmpxchg_ptr_entry;
aoqi@0 146 static address _atomic_cmpxchg_long_entry;
aoqi@0 147 static address _atomic_add_entry;
aoqi@0 148 static address _atomic_add_ptr_entry;
aoqi@0 149 static address _fence_entry;
aoqi@0 150 static address _d2i_wrapper;
aoqi@0 151 static address _d2l_wrapper;
aoqi@0 152
aoqi@0 153 static jint _fpu_cntrl_wrd_std;
aoqi@0 154 static jint _fpu_cntrl_wrd_24;
aoqi@0 155 static jint _fpu_cntrl_wrd_64;
aoqi@0 156 static jint _fpu_cntrl_wrd_trunc;
aoqi@0 157 static jint _mxcsr_std;
aoqi@0 158 static jint _fpu_subnormal_bias1[3];
aoqi@0 159 static jint _fpu_subnormal_bias2[3];
aoqi@0 160
aoqi@0 161 static BufferBlob* _code1; // code buffer for initial routines
aoqi@0 162 static BufferBlob* _code2; // code buffer for all other routines
aoqi@0 163
aoqi@0 164 // Leaf routines which implement arraycopy and their addresses
aoqi@0 165 // arraycopy operands aligned on element type boundary
aoqi@0 166 static address _jbyte_arraycopy;
aoqi@0 167 static address _jshort_arraycopy;
aoqi@0 168 static address _jint_arraycopy;
aoqi@0 169 static address _jlong_arraycopy;
aoqi@0 170 static address _oop_arraycopy, _oop_arraycopy_uninit;
aoqi@0 171 static address _jbyte_disjoint_arraycopy;
aoqi@0 172 static address _jshort_disjoint_arraycopy;
aoqi@0 173 static address _jint_disjoint_arraycopy;
aoqi@0 174 static address _jlong_disjoint_arraycopy;
aoqi@0 175 static address _oop_disjoint_arraycopy, _oop_disjoint_arraycopy_uninit;
aoqi@0 176
aoqi@0 177 // arraycopy operands aligned on zero'th element boundary
aoqi@0 178 // These are identical to the ones aligned aligned on an
aoqi@0 179 // element type boundary, except that they assume that both
aoqi@0 180 // source and destination are HeapWord aligned.
aoqi@0 181 static address _arrayof_jbyte_arraycopy;
aoqi@0 182 static address _arrayof_jshort_arraycopy;
aoqi@0 183 static address _arrayof_jint_arraycopy;
aoqi@0 184 static address _arrayof_jlong_arraycopy;
aoqi@0 185 static address _arrayof_oop_arraycopy, _arrayof_oop_arraycopy_uninit;
aoqi@0 186 static address _arrayof_jbyte_disjoint_arraycopy;
aoqi@0 187 static address _arrayof_jshort_disjoint_arraycopy;
aoqi@0 188 static address _arrayof_jint_disjoint_arraycopy;
aoqi@0 189 static address _arrayof_jlong_disjoint_arraycopy;
aoqi@0 190 static address _arrayof_oop_disjoint_arraycopy, _arrayof_oop_disjoint_arraycopy_uninit;
aoqi@0 191
aoqi@0 192 // these are recommended but optional:
aoqi@0 193 static address _checkcast_arraycopy, _checkcast_arraycopy_uninit;
aoqi@0 194 static address _unsafe_arraycopy;
aoqi@0 195 static address _generic_arraycopy;
aoqi@0 196
aoqi@0 197 static address _jbyte_fill;
aoqi@0 198 static address _jshort_fill;
aoqi@0 199 static address _jint_fill;
aoqi@0 200 static address _arrayof_jbyte_fill;
aoqi@0 201 static address _arrayof_jshort_fill;
aoqi@0 202 static address _arrayof_jint_fill;
aoqi@0 203
aoqi@0 204 // zero heap space aligned to jlong (8 bytes)
aoqi@0 205 static address _zero_aligned_words;
aoqi@0 206
aoqi@0 207 static address _aescrypt_encryptBlock;
aoqi@0 208 static address _aescrypt_decryptBlock;
aoqi@0 209 static address _cipherBlockChaining_encryptAESCrypt;
aoqi@0 210 static address _cipherBlockChaining_decryptAESCrypt;
aoqi@0 211
kvn@7027 212 static address _sha1_implCompress;
kvn@7027 213 static address _sha1_implCompressMB;
kvn@7027 214 static address _sha256_implCompress;
kvn@7027 215 static address _sha256_implCompressMB;
kvn@7027 216 static address _sha512_implCompress;
kvn@7027 217 static address _sha512_implCompressMB;
kvn@7027 218
aoqi@0 219 static address _updateBytesCRC32;
aoqi@0 220 static address _crc_table_adr;
aoqi@0 221
kvn@7152 222 static address _multiplyToLen;
igerasim@8307 223 static address _squareToLen;
igerasim@8307 224 static address _mulAdd;
vkempik@8318 225 static address _montgomeryMultiply;
vkempik@8318 226 static address _montgomerySquare;
kvn@7152 227
aoqi@0 228 // These are versions of the java.lang.Math methods which perform
aoqi@0 229 // the same operations as the intrinsic version. They are used for
aoqi@0 230 // constant folding in the compiler to ensure equivalence. If the
aoqi@0 231 // intrinsic version returns the same result as the strict version
aoqi@0 232 // then they can be set to the appropriate function from
aoqi@0 233 // SharedRuntime.
aoqi@0 234 static double (*_intrinsic_log)(double);
aoqi@0 235 static double (*_intrinsic_log10)(double);
aoqi@0 236 static double (*_intrinsic_exp)(double);
aoqi@0 237 static double (*_intrinsic_pow)(double, double);
aoqi@0 238 static double (*_intrinsic_sin)(double);
aoqi@0 239 static double (*_intrinsic_cos)(double);
aoqi@0 240 static double (*_intrinsic_tan)(double);
aoqi@0 241
aoqi@0 242 // Safefetch stubs.
aoqi@0 243 static address _safefetch32_entry;
aoqi@0 244 static address _safefetch32_fault_pc;
aoqi@0 245 static address _safefetch32_continuation_pc;
aoqi@0 246 static address _safefetchN_entry;
aoqi@0 247 static address _safefetchN_fault_pc;
aoqi@0 248 static address _safefetchN_continuation_pc;
aoqi@0 249
aoqi@0 250 public:
aoqi@0 251 // Initialization/Testing
aoqi@0 252 static void initialize1(); // must happen before universe::genesis
aoqi@0 253 static void initialize2(); // must happen after universe::genesis
aoqi@0 254
aoqi@0 255 static bool is_stub_code(address addr) { return contains(addr); }
aoqi@0 256
aoqi@0 257 static bool contains(address addr) {
aoqi@0 258 return
aoqi@0 259 (_code1 != NULL && _code1->blob_contains(addr)) ||
aoqi@0 260 (_code2 != NULL && _code2->blob_contains(addr)) ;
aoqi@0 261 }
aoqi@0 262
aoqi@0 263 static CodeBlob* code1() { return _code1; }
aoqi@0 264 static CodeBlob* code2() { return _code2; }
aoqi@0 265
aoqi@0 266 // Debugging
aoqi@0 267 static jint verify_oop_count() { return _verify_oop_count; }
aoqi@0 268 static jint* verify_oop_count_addr() { return &_verify_oop_count; }
aoqi@0 269 // a subroutine for debugging the GC
aoqi@0 270 static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; }
aoqi@0 271
aoqi@0 272 static address catch_exception_entry() { return _catch_exception_entry; }
aoqi@0 273
aoqi@0 274 // Calls to Java
aoqi@0 275 typedef void (*CallStub)(
aoqi@0 276 address link,
aoqi@0 277 intptr_t* result,
aoqi@0 278 BasicType result_type,
aoqi@0 279 Method* method,
aoqi@0 280 address entry_point,
aoqi@0 281 intptr_t* parameters,
aoqi@0 282 int size_of_parameters,
aoqi@0 283 TRAPS
aoqi@0 284 );
aoqi@0 285
aoqi@0 286 static CallStub call_stub() { return CAST_TO_FN_PTR(CallStub, _call_stub_entry); }
aoqi@0 287
aoqi@0 288 // Exceptions
aoqi@0 289 static address forward_exception_entry() { return _forward_exception_entry; }
aoqi@0 290 // Implicit exceptions
aoqi@0 291 static address throw_AbstractMethodError_entry() { return _throw_AbstractMethodError_entry; }
aoqi@0 292 static address throw_IncompatibleClassChangeError_entry(){ return _throw_IncompatibleClassChangeError_entry; }
aoqi@0 293 static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; }
aoqi@0 294 static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; }
aoqi@0 295
aoqi@0 296 // Exceptions during unsafe access - should throw Java exception rather
aoqi@0 297 // than crash.
aoqi@0 298 static address handler_for_unsafe_access() { return _handler_for_unsafe_access_entry; }
aoqi@0 299
aoqi@0 300 static address atomic_xchg_entry() { return _atomic_xchg_entry; }
aoqi@0 301 static address atomic_xchg_ptr_entry() { return _atomic_xchg_ptr_entry; }
aoqi@0 302 static address atomic_store_entry() { return _atomic_store_entry; }
aoqi@0 303 static address atomic_store_ptr_entry() { return _atomic_store_ptr_entry; }
aoqi@0 304 static address atomic_cmpxchg_entry() { return _atomic_cmpxchg_entry; }
aoqi@0 305 static address atomic_cmpxchg_ptr_entry() { return _atomic_cmpxchg_ptr_entry; }
aoqi@0 306 static address atomic_cmpxchg_long_entry() { return _atomic_cmpxchg_long_entry; }
aoqi@0 307 static address atomic_add_entry() { return _atomic_add_entry; }
aoqi@0 308 static address atomic_add_ptr_entry() { return _atomic_add_ptr_entry; }
aoqi@0 309 static address fence_entry() { return _fence_entry; }
aoqi@0 310
aoqi@0 311 static address d2i_wrapper() { return _d2i_wrapper; }
aoqi@0 312 static address d2l_wrapper() { return _d2l_wrapper; }
aoqi@0 313 static jint fpu_cntrl_wrd_std() { return _fpu_cntrl_wrd_std; }
aoqi@0 314 static address addr_fpu_cntrl_wrd_std() { return (address)&_fpu_cntrl_wrd_std; }
aoqi@0 315 static address addr_fpu_cntrl_wrd_24() { return (address)&_fpu_cntrl_wrd_24; }
aoqi@0 316 static address addr_fpu_cntrl_wrd_64() { return (address)&_fpu_cntrl_wrd_64; }
aoqi@0 317 static address addr_fpu_cntrl_wrd_trunc() { return (address)&_fpu_cntrl_wrd_trunc; }
aoqi@0 318 static address addr_mxcsr_std() { return (address)&_mxcsr_std; }
aoqi@0 319 static address addr_fpu_subnormal_bias1() { return (address)&_fpu_subnormal_bias1; }
aoqi@0 320 static address addr_fpu_subnormal_bias2() { return (address)&_fpu_subnormal_bias2; }
aoqi@0 321
aoqi@0 322
aoqi@0 323 static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized);
aoqi@0 324
aoqi@0 325 static address jbyte_arraycopy() { return _jbyte_arraycopy; }
aoqi@0 326 static address jshort_arraycopy() { return _jshort_arraycopy; }
aoqi@0 327 static address jint_arraycopy() { return _jint_arraycopy; }
aoqi@0 328 static address jlong_arraycopy() { return _jlong_arraycopy; }
aoqi@0 329 static address oop_arraycopy(bool dest_uninitialized = false) {
aoqi@0 330 return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
aoqi@0 331 }
aoqi@0 332 static address jbyte_disjoint_arraycopy() { return _jbyte_disjoint_arraycopy; }
aoqi@0 333 static address jshort_disjoint_arraycopy() { return _jshort_disjoint_arraycopy; }
aoqi@0 334 static address jint_disjoint_arraycopy() { return _jint_disjoint_arraycopy; }
aoqi@0 335 static address jlong_disjoint_arraycopy() { return _jlong_disjoint_arraycopy; }
aoqi@0 336 static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
aoqi@0 337 return dest_uninitialized ? _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
aoqi@0 338 }
aoqi@0 339
aoqi@0 340 static address arrayof_jbyte_arraycopy() { return _arrayof_jbyte_arraycopy; }
aoqi@0 341 static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
aoqi@0 342 static address arrayof_jint_arraycopy() { return _arrayof_jint_arraycopy; }
aoqi@0 343 static address arrayof_jlong_arraycopy() { return _arrayof_jlong_arraycopy; }
aoqi@0 344 static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
aoqi@0 345 return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
aoqi@0 346 }
aoqi@0 347
aoqi@0 348 static address arrayof_jbyte_disjoint_arraycopy() { return _arrayof_jbyte_disjoint_arraycopy; }
aoqi@0 349 static address arrayof_jshort_disjoint_arraycopy() { return _arrayof_jshort_disjoint_arraycopy; }
aoqi@0 350 static address arrayof_jint_disjoint_arraycopy() { return _arrayof_jint_disjoint_arraycopy; }
aoqi@0 351 static address arrayof_jlong_disjoint_arraycopy() { return _arrayof_jlong_disjoint_arraycopy; }
aoqi@0 352 static address arrayof_oop_disjoint_arraycopy(bool dest_uninitialized = false) {
aoqi@0 353 return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy;
aoqi@0 354 }
aoqi@0 355
aoqi@0 356 static address checkcast_arraycopy(bool dest_uninitialized = false) {
aoqi@0 357 return dest_uninitialized ? _checkcast_arraycopy_uninit : _checkcast_arraycopy;
aoqi@0 358 }
aoqi@0 359 static address unsafe_arraycopy() { return _unsafe_arraycopy; }
aoqi@0 360 static address generic_arraycopy() { return _generic_arraycopy; }
aoqi@0 361
aoqi@0 362 static address jbyte_fill() { return _jbyte_fill; }
aoqi@0 363 static address jshort_fill() { return _jshort_fill; }
aoqi@0 364 static address jint_fill() { return _jint_fill; }
aoqi@0 365 static address arrayof_jbyte_fill() { return _arrayof_jbyte_fill; }
aoqi@0 366 static address arrayof_jshort_fill() { return _arrayof_jshort_fill; }
aoqi@0 367 static address arrayof_jint_fill() { return _arrayof_jint_fill; }
aoqi@0 368
aoqi@0 369 static address aescrypt_encryptBlock() { return _aescrypt_encryptBlock; }
aoqi@0 370 static address aescrypt_decryptBlock() { return _aescrypt_decryptBlock; }
aoqi@0 371 static address cipherBlockChaining_encryptAESCrypt() { return _cipherBlockChaining_encryptAESCrypt; }
aoqi@0 372 static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; }
aoqi@0 373
kvn@7027 374 static address sha1_implCompress() { return _sha1_implCompress; }
kvn@7027 375 static address sha1_implCompressMB() { return _sha1_implCompressMB; }
kvn@7027 376 static address sha256_implCompress() { return _sha256_implCompress; }
kvn@7027 377 static address sha256_implCompressMB() { return _sha256_implCompressMB; }
kvn@7027 378 static address sha512_implCompress() { return _sha512_implCompress; }
kvn@7027 379 static address sha512_implCompressMB() { return _sha512_implCompressMB; }
kvn@7027 380
aoqi@0 381 static address updateBytesCRC32() { return _updateBytesCRC32; }
aoqi@0 382 static address crc_table_addr() { return _crc_table_adr; }
aoqi@0 383
kvn@7152 384 static address multiplyToLen() {return _multiplyToLen; }
igerasim@8307 385 static address squareToLen() {return _squareToLen; }
igerasim@8307 386 static address mulAdd() {return _mulAdd; }
vkempik@8318 387 static address montgomeryMultiply() { return _montgomeryMultiply; }
vkempik@8318 388 static address montgomerySquare() { return _montgomerySquare; }
kvn@7152 389
aoqi@0 390 static address select_fill_function(BasicType t, bool aligned, const char* &name);
aoqi@0 391
aoqi@0 392 static address zero_aligned_words() { return _zero_aligned_words; }
aoqi@0 393
aoqi@0 394 static double intrinsic_log(double d) {
aoqi@0 395 assert(_intrinsic_log != NULL, "must be defined");
aoqi@0 396 return _intrinsic_log(d);
aoqi@0 397 }
aoqi@0 398 static double intrinsic_log10(double d) {
aoqi@0 399 assert(_intrinsic_log != NULL, "must be defined");
aoqi@0 400 return _intrinsic_log10(d);
aoqi@0 401 }
aoqi@0 402 static double intrinsic_exp(double d) {
aoqi@0 403 assert(_intrinsic_exp != NULL, "must be defined");
aoqi@0 404 return _intrinsic_exp(d);
aoqi@0 405 }
aoqi@0 406 static double intrinsic_pow(double d, double d2) {
aoqi@0 407 assert(_intrinsic_pow != NULL, "must be defined");
aoqi@0 408 return _intrinsic_pow(d, d2);
aoqi@0 409 }
aoqi@0 410 static double intrinsic_sin(double d) {
aoqi@0 411 assert(_intrinsic_sin != NULL, "must be defined");
aoqi@0 412 return _intrinsic_sin(d);
aoqi@0 413 }
aoqi@0 414 static double intrinsic_cos(double d) {
aoqi@0 415 assert(_intrinsic_cos != NULL, "must be defined");
aoqi@0 416 return _intrinsic_cos(d);
aoqi@0 417 }
aoqi@0 418 static double intrinsic_tan(double d) {
aoqi@0 419 assert(_intrinsic_tan != NULL, "must be defined");
aoqi@0 420 return _intrinsic_tan(d);
aoqi@0 421 }
aoqi@0 422
aoqi@0 423 //
aoqi@0 424 // Safefetch stub support
aoqi@0 425 //
aoqi@0 426
aoqi@0 427 typedef int (*SafeFetch32Stub)(int* adr, int errValue);
aoqi@0 428 typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue);
aoqi@0 429
aoqi@0 430 static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); }
aoqi@0 431 static SafeFetchNStub SafeFetchN_stub() { return CAST_TO_FN_PTR(SafeFetchNStub, _safefetchN_entry); }
aoqi@0 432
aoqi@0 433 static bool is_safefetch_fault(address pc) {
aoqi@0 434 return pc != NULL &&
aoqi@0 435 (pc == _safefetch32_fault_pc ||
aoqi@0 436 pc == _safefetchN_fault_pc);
aoqi@0 437 }
aoqi@0 438
aoqi@0 439 static address continuation_for_safefetch_fault(address pc) {
aoqi@0 440 assert(_safefetch32_continuation_pc != NULL &&
aoqi@0 441 _safefetchN_continuation_pc != NULL,
aoqi@0 442 "not initialized");
aoqi@0 443
aoqi@0 444 if (pc == _safefetch32_fault_pc) return _safefetch32_continuation_pc;
aoqi@0 445 if (pc == _safefetchN_fault_pc) return _safefetchN_continuation_pc;
aoqi@0 446
aoqi@0 447 ShouldNotReachHere();
aoqi@0 448 return NULL;
aoqi@0 449 }
aoqi@0 450
aoqi@0 451 //
aoqi@0 452 // Default versions of the above arraycopy functions for platforms which do
aoqi@0 453 // not have specialized versions
aoqi@0 454 //
aoqi@0 455 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count);
aoqi@0 456 static void jshort_copy (jshort* src, jshort* dest, size_t count);
aoqi@0 457 static void jint_copy (jint* src, jint* dest, size_t count);
aoqi@0 458 static void jlong_copy (jlong* src, jlong* dest, size_t count);
aoqi@0 459 static void oop_copy (oop* src, oop* dest, size_t count);
aoqi@0 460 static void oop_copy_uninit(oop* src, oop* dest, size_t count);
aoqi@0 461
aoqi@0 462 static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 463 static void arrayof_jshort_copy (HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 464 static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 465 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 466 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 467 static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
aoqi@0 468 };
aoqi@0 469
aoqi@0 470 // Safefetch allows to load a value from a location that's not known
aoqi@0 471 // to be valid. If the load causes a fault, the error value is returned.
aoqi@0 472 inline int SafeFetch32(int* adr, int errValue) {
aoqi@0 473 assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
aoqi@0 474 return StubRoutines::SafeFetch32_stub()(adr, errValue);
aoqi@0 475 }
aoqi@0 476 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
aoqi@0 477 assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
aoqi@0 478 return StubRoutines::SafeFetchN_stub()(adr, errValue);
aoqi@0 479 }
aoqi@0 480
aoqi@0 481 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP

mercurial