equal
deleted
inserted
replaced
3355 __ jmp(L_exit); |
3355 __ jmp(L_exit); |
3356 |
3356 |
3357 return start; |
3357 return start; |
3358 } |
3358 } |
3359 |
3359 |
3360 |
3360 // Safefetch stubs. |
|
3361 void generate_safefetch(const char* name, int size, address* entry, |
|
3362 address* fault_pc, address* continuation_pc) { |
|
3363 // safefetch signatures: |
|
3364 // int SafeFetch32(int* adr, int errValue); |
|
3365 // intptr_t SafeFetchN (intptr_t* adr, intptr_t errValue); |
|
3366 // |
|
3367 // arguments: |
|
3368 // c_rarg0 = adr |
|
3369 // c_rarg1 = errValue |
|
3370 // |
|
3371 // result: |
|
3372 // PPC_RET = *adr or errValue |
|
3373 |
|
3374 StubCodeMark mark(this, "StubRoutines", name); |
|
3375 |
|
3376 // Entry point, pc or function descriptor. |
|
3377 *entry = __ pc(); |
|
3378 |
|
3379 // Load *adr into c_rarg1, may fault. |
|
3380 *fault_pc = __ pc(); |
|
3381 switch (size) { |
|
3382 case 4: |
|
3383 // int32_t |
|
3384 __ movl(c_rarg1, Address(c_rarg0, 0)); |
|
3385 break; |
|
3386 case 8: |
|
3387 // int64_t |
|
3388 __ movq(c_rarg1, Address(c_rarg0, 0)); |
|
3389 break; |
|
3390 default: |
|
3391 ShouldNotReachHere(); |
|
3392 } |
|
3393 |
|
3394 // return errValue or *adr |
|
3395 *continuation_pc = __ pc(); |
|
3396 __ movq(rax, c_rarg1); |
|
3397 __ ret(0); |
|
3398 } |
3361 |
3399 |
3362 // This is a version of CBC/AES Decrypt which does 4 blocks in a loop at a time |
3400 // This is a version of CBC/AES Decrypt which does 4 blocks in a loop at a time |
3363 // to hide instruction latency |
3401 // to hide instruction latency |
3364 // |
3402 // |
3365 // Arguments: |
3403 // Arguments: |
3831 StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); |
3869 StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); |
3832 StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); |
3870 StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); |
3833 StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); |
3871 StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); |
3834 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); |
3872 StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); |
3835 } |
3873 } |
|
3874 |
|
3875 // Safefetch stubs. |
|
3876 generate_safefetch("SafeFetch32", sizeof(int), &StubRoutines::_safefetch32_entry, |
|
3877 &StubRoutines::_safefetch32_fault_pc, |
|
3878 &StubRoutines::_safefetch32_continuation_pc); |
|
3879 generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry, |
|
3880 &StubRoutines::_safefetchN_fault_pc, |
|
3881 &StubRoutines::_safefetchN_continuation_pc); |
3836 } |
3882 } |
3837 |
3883 |
3838 public: |
3884 public: |
3839 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) { |
3885 StubGenerator(CodeBuffer* code, bool all) : StubCodeGenerator(code) { |
3840 if (all) { |
3886 if (all) { |