--- old/src/hotspot/share/opto/library_call.cpp 2018-06-21 22:32:20.289289500 -0700 +++ new/src/hotspot/share/opto/library_call.cpp 2018-06-21 22:32:19.719232500 -0700 @@ -301,6 +301,7 @@ Node* get_key_start_from_aescrypt_object(Node* aescrypt_object); Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object); bool inline_ghash_processBlocks(); + bool inline_base64_implEncode(); bool inline_sha_implCompress(vmIntrinsics::ID id); bool inline_digestBase_implCompressMB(int predicate); bool inline_sha_implCompressMB(Node* digestBaseObj, ciInstanceKlass* instklass_SHA, @@ -836,6 +837,8 @@ case vmIntrinsics::_ghash_processBlocks: return inline_ghash_processBlocks(); + case vmIntrinsics::_base64_implEncode: + return inline_base64_implEncode(); case vmIntrinsics::_encodeISOArray: case vmIntrinsics::_encodeByteISOArray: @@ -6633,6 +6636,35 @@ return true; } +bool LibraryCallKit::inline_base64_implEncode() { + address stubAddr; + const char *stubName; + assert(UseBASE64Intrinsics, "need Base64 intrinsics support"); + assert(callee()->signature()->size() == 6, "base64_implEncode has 6 parameters"); + stubAddr = StubRoutines::base64_implEncode(); + stubName = "implEncode"; + + if (!stubAddr) return false; + Node* base64obj = argument(0); + Node* src = argument(1); + Node* offset = argument(2); + Node* len = argument(3); + Node* dest = argument(4); + Node* dp = argument(5); + Node* isURL = argument(6); + + Node* src_start = array_element_address(src, intcon(0), T_BYTE); + assert(src_start, "source array is NULL"); + Node* dest_start = array_element_address(dest, intcon(0), T_BYTE); + assert(dest_start, "destination array is NULL"); + + Node* base64 = make_runtime_call(RC_LEAF, + OptoRuntime::base64_implEncode_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + src_start, offset, len, dest_start, dp, isURL); + return true; +} + //------------------------------inline_sha_implCompress----------------------- // // Calculate SHA (i.e., SHA-1) for single-block byte[] array.