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