Skip to content

Commit 59e528f

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents 3bee28e + 19bade0 commit 59e528f

File tree

9 files changed

+17
-118
lines changed

9 files changed

+17
-118
lines changed

src/hotspot/cpu/aarch64/aarch64.ad

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,11 +2516,6 @@ const uint Matcher::vector_ideal_reg(int len) {
25162516
return 0;
25172517
}
25182518

2519-
// AES support not yet implemented
2520-
const bool Matcher::pass_original_key_for_aes() {
2521-
return false;
2522-
}
2523-
25242519
// aarch64 supports misaligned vectors store/load.
25252520
const bool Matcher::misaligned_vectors_ok() {
25262521
return true;

src/hotspot/cpu/arm/arm.ad

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,11 +1041,6 @@ const bool Matcher::misaligned_vectors_ok() {
10411041
return false;
10421042
}
10431043

1044-
// ARM doesn't support AES intrinsics
1045-
const bool Matcher::pass_original_key_for_aes() {
1046-
return false;
1047-
}
1048-
10491044
const bool Matcher::convL2FSupported(void) {
10501045
return false;
10511046
}

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,11 +2200,6 @@ const bool Matcher::misaligned_vectors_ok() {
22002200
return false;
22012201
}
22022202

2203-
// PPC AES support not yet implemented
2204-
const bool Matcher::pass_original_key_for_aes() {
2205-
return false;
2206-
}
2207-
22082203
// RETURNS: whether this branch offset is short enough that a short
22092204
// branch can be used.
22102205
//

src/hotspot/cpu/s390/s390.ad

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,11 +1588,6 @@ const bool Matcher::misaligned_vectors_ok() {
15881588
return true;
15891589
}
15901590

1591-
// Not yet ported to z/Architecture.
1592-
const bool Matcher::pass_original_key_for_aes() {
1593-
return false;
1594-
}
1595-
15961591
// RETURNS: whether this branch offset is short enough that a short
15971592
// branch can be used.
15981593
//

src/hotspot/cpu/x86/x86.ad

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,12 +1899,6 @@ const bool Matcher::misaligned_vectors_ok() {
18991899
return true;
19001900
}
19011901

1902-
// x86 AES instructions are compatible with SunJCE expanded
1903-
// keys, hence we do not need to pass the original key to stubs
1904-
const bool Matcher::pass_original_key_for_aes() {
1905-
return false;
1906-
}
1907-
19081902

19091903
const bool Matcher::convi2l_type_required = true;
19101904

src/hotspot/share/opto/library_call.cpp

Lines changed: 17 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5614,22 +5614,10 @@ bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) {
56145614
Node* k_start = get_key_start_from_aescrypt_object(aescrypt_object);
56155615
if (k_start == NULL) return false;
56165616

5617-
if (Matcher::pass_original_key_for_aes()) {
5618-
// on SPARC we need to pass the original key since key expansion needs to happen in intrinsics due to
5619-
// compatibility issues between Java key expansion and SPARC crypto instructions
5620-
Node* original_k_start = get_original_key_start_from_aescrypt_object(aescrypt_object);
5621-
if (original_k_start == NULL) return false;
5622-
5623-
// Call the stub.
5624-
make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::aescrypt_block_Type(),
5625-
stubAddr, stubName, TypePtr::BOTTOM,
5626-
src_start, dest_start, k_start, original_k_start);
5627-
} else {
5628-
// Call the stub.
5629-
make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::aescrypt_block_Type(),
5630-
stubAddr, stubName, TypePtr::BOTTOM,
5631-
src_start, dest_start, k_start);
5632-
}
5617+
// Call the stub.
5618+
make_runtime_call(RC_LEAF|RC_NO_FP, OptoRuntime::aescrypt_block_Type(),
5619+
stubAddr, stubName, TypePtr::BOTTOM,
5620+
src_start, dest_start, k_start);
56335621

56345622
return true;
56355623
}
@@ -5712,25 +5700,11 @@ bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) {
57125700
if (objRvec == NULL) return false;
57135701
Node* r_start = array_element_address(objRvec, intcon(0), T_BYTE);
57145702

5715-
Node* cbcCrypt;
5716-
if (Matcher::pass_original_key_for_aes()) {
5717-
// on SPARC we need to pass the original key since key expansion needs to happen in intrinsics due to
5718-
// compatibility issues between Java key expansion and SPARC crypto instructions
5719-
Node* original_k_start = get_original_key_start_from_aescrypt_object(aescrypt_object);
5720-
if (original_k_start == NULL) return false;
5721-
5722-
// Call the stub, passing src_start, dest_start, k_start, r_start, src_len and original_k_start
5723-
cbcCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
5724-
OptoRuntime::cipherBlockChaining_aescrypt_Type(),
5725-
stubAddr, stubName, TypePtr::BOTTOM,
5726-
src_start, dest_start, k_start, r_start, len, original_k_start);
5727-
} else {
5728-
// Call the stub, passing src_start, dest_start, k_start, r_start and src_len
5729-
cbcCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
5730-
OptoRuntime::cipherBlockChaining_aescrypt_Type(),
5731-
stubAddr, stubName, TypePtr::BOTTOM,
5732-
src_start, dest_start, k_start, r_start, len);
5733-
}
5703+
// Call the stub, passing src_start, dest_start, k_start, r_start and src_len
5704+
Node* cbcCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
5705+
OptoRuntime::cipherBlockChaining_aescrypt_Type(),
5706+
stubAddr, stubName, TypePtr::BOTTOM,
5707+
src_start, dest_start, k_start, r_start, len);
57345708

57355709
// return cipher length (int)
57365710
Node* retvalue = _gvn.transform(new ProjNode(cbcCrypt, TypeFunc::Parms));
@@ -5809,16 +5783,11 @@ bool LibraryCallKit::inline_electronicCodeBook_AESCrypt(vmIntrinsics::ID id) {
58095783
Node* k_start = get_key_start_from_aescrypt_object(aescrypt_object);
58105784
if (k_start == NULL) return false;
58115785

5812-
Node* ecbCrypt;
5813-
if (Matcher::pass_original_key_for_aes()) {
5814-
// no SPARC version for AES/ECB intrinsics now.
5815-
return false;
5816-
}
58175786
// Call the stub, passing src_start, dest_start, k_start, r_start and src_len
5818-
ecbCrypt = make_runtime_call(RC_LEAF | RC_NO_FP,
5819-
OptoRuntime::electronicCodeBook_aescrypt_Type(),
5820-
stubAddr, stubName, TypePtr::BOTTOM,
5821-
src_start, dest_start, k_start, len);
5787+
Node* ecbCrypt = make_runtime_call(RC_LEAF | RC_NO_FP,
5788+
OptoRuntime::electronicCodeBook_aescrypt_Type(),
5789+
stubAddr, stubName, TypePtr::BOTTOM,
5790+
src_start, dest_start, k_start, len);
58225791

58235792
// return cipher length (int)
58245793
Node* retvalue = _gvn.transform(new ProjNode(ecbCrypt, TypeFunc::Parms));
@@ -5893,16 +5862,11 @@ bool LibraryCallKit::inline_counterMode_AESCrypt(vmIntrinsics::ID id) {
58935862
Node* saved_encCounter_start = array_element_address(saved_encCounter, intcon(0), T_BYTE);
58945863
Node* used = field_address_from_object(counterMode_object, "used", "I", /*is_exact*/ false);
58955864

5896-
Node* ctrCrypt;
5897-
if (Matcher::pass_original_key_for_aes()) {
5898-
// no SPARC version for AES/CTR intrinsics now.
5899-
return false;
5900-
}
59015865
// Call the stub, passing src_start, dest_start, k_start, r_start and src_len
5902-
ctrCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
5903-
OptoRuntime::counterMode_aescrypt_Type(),
5904-
stubAddr, stubName, TypePtr::BOTTOM,
5905-
src_start, dest_start, k_start, cnt_start, len, saved_encCounter_start, used);
5866+
Node* ctrCrypt = make_runtime_call(RC_LEAF|RC_NO_FP,
5867+
OptoRuntime::counterMode_aescrypt_Type(),
5868+
stubAddr, stubName, TypePtr::BOTTOM,
5869+
src_start, dest_start, k_start, cnt_start, len, saved_encCounter_start, used);
59065870

59075871
// return cipher length (int)
59085872
Node* retvalue = _gvn.transform(new ProjNode(ctrCrypt, TypeFunc::Parms));
@@ -5934,17 +5898,6 @@ Node * LibraryCallKit::get_key_start_from_aescrypt_object(Node *aescrypt_object)
59345898
return k_start;
59355899
}
59365900

5937-
//------------------------------get_original_key_start_from_aescrypt_object-----------------------
5938-
Node * LibraryCallKit::get_original_key_start_from_aescrypt_object(Node *aescrypt_object) {
5939-
Node* objAESCryptKey = load_field_from_object(aescrypt_object, "lastKey", "[B", /*is_exact*/ false);
5940-
assert (objAESCryptKey != NULL, "wrong version of com.sun.crypto.provider.AESCrypt");
5941-
if (objAESCryptKey == NULL) return (Node *) NULL;
5942-
5943-
// now have the array, need to get the start address of the lastKey array
5944-
Node* original_k_start = array_element_address(objAESCryptKey, intcon(0), T_BYTE);
5945-
return original_k_start;
5946-
}
5947-
59485901
//----------------------------inline_cipherBlockChaining_AESCrypt_predicate----------------------------
59495902
// Return node representing slow path of predicate check.
59505903
// the pseudo code we want to emulate with this predicate is:

src/hotspot/share/opto/library_call.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ class LibraryCallKit : public GraphKit {
273273
Node* inline_electronicCodeBook_AESCrypt_predicate(bool decrypting);
274274
Node* inline_counterMode_AESCrypt_predicate();
275275
Node* get_key_start_from_aescrypt_object(Node* aescrypt_object);
276-
Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object);
277276
bool inline_ghash_processBlocks();
278277
bool inline_base64_encodeBlock();
279278
bool inline_base64_decodeBlock();

src/hotspot/share/opto/matcher.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ class Matcher : public PhaseTransform {
351351
// CPU supports misaligned vectors store/load.
352352
static const bool misaligned_vectors_ok();
353353

354-
// Should original key array reference be passed to AES stubs
355-
static const bool pass_original_key_for_aes();
356-
357354
// Used to determine a "low complexity" 64-bit constant. (Zero is simple.)
358355
// The standard of comparison is one (StoreL ConL) vs. two (StoreI ConI).
359356
// Depends on the details of 64-bit constant generation on the CPU.

src/hotspot/share/opto/runtime.cpp

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -786,18 +786,12 @@ const TypeFunc* OptoRuntime::array_fill_Type() {
786786
const TypeFunc* OptoRuntime::aescrypt_block_Type() {
787787
// create input type (domain)
788788
int num_args = 3;
789-
if (Matcher::pass_original_key_for_aes()) {
790-
num_args = 4;
791-
}
792789
int argcnt = num_args;
793790
const Type** fields = TypeTuple::fields(argcnt);
794791
int argp = TypeFunc::Parms;
795792
fields[argp++] = TypePtr::NOTNULL; // src
796793
fields[argp++] = TypePtr::NOTNULL; // dest
797794
fields[argp++] = TypePtr::NOTNULL; // k array
798-
if (Matcher::pass_original_key_for_aes()) {
799-
fields[argp++] = TypePtr::NOTNULL; // original k array
800-
}
801795
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
802796
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
803797

@@ -879,9 +873,6 @@ const TypeFunc* OptoRuntime::updateBytesAdler32_Type() {
879873
const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
880874
// create input type (domain)
881875
int num_args = 5;
882-
if (Matcher::pass_original_key_for_aes()) {
883-
num_args = 6;
884-
}
885876
int argcnt = num_args;
886877
const Type** fields = TypeTuple::fields(argcnt);
887878
int argp = TypeFunc::Parms;
@@ -890,9 +881,6 @@ const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
890881
fields[argp++] = TypePtr::NOTNULL; // k array
891882
fields[argp++] = TypePtr::NOTNULL; // r array
892883
fields[argp++] = TypeInt::INT; // src len
893-
if (Matcher::pass_original_key_for_aes()) {
894-
fields[argp++] = TypePtr::NOTNULL; // original k array
895-
}
896884
assert(argp == TypeFunc::Parms+argcnt, "correct decoding");
897885
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields);
898886

@@ -907,19 +895,13 @@ const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
907895
const TypeFunc* OptoRuntime::electronicCodeBook_aescrypt_Type() {
908896
// create input type (domain)
909897
int num_args = 4;
910-
if (Matcher::pass_original_key_for_aes()) {
911-
num_args = 5;
912-
}
913898
int argcnt = num_args;
914899
const Type** fields = TypeTuple::fields(argcnt);
915900
int argp = TypeFunc::Parms;
916901
fields[argp++] = TypePtr::NOTNULL; // src
917902
fields[argp++] = TypePtr::NOTNULL; // dest
918903
fields[argp++] = TypePtr::NOTNULL; // k array
919904
fields[argp++] = TypeInt::INT; // src len
920-
if (Matcher::pass_original_key_for_aes()) {
921-
fields[argp++] = TypePtr::NOTNULL; // original k array
922-
}
923905
assert(argp == TypeFunc::Parms + argcnt, "correct decoding");
924906
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields);
925907

@@ -934,9 +916,6 @@ const TypeFunc* OptoRuntime::electronicCodeBook_aescrypt_Type() {
934916
const TypeFunc* OptoRuntime::counterMode_aescrypt_Type() {
935917
// create input type (domain)
936918
int num_args = 7;
937-
if (Matcher::pass_original_key_for_aes()) {
938-
num_args = 8;
939-
}
940919
int argcnt = num_args;
941920
const Type** fields = TypeTuple::fields(argcnt);
942921
int argp = TypeFunc::Parms;
@@ -947,9 +926,6 @@ const TypeFunc* OptoRuntime::counterMode_aescrypt_Type() {
947926
fields[argp++] = TypeInt::INT; // src len
948927
fields[argp++] = TypePtr::NOTNULL; // saved_encCounter
949928
fields[argp++] = TypePtr::NOTNULL; // saved used addr
950-
if (Matcher::pass_original_key_for_aes()) {
951-
fields[argp++] = TypePtr::NOTNULL; // original k array
952-
}
953929
assert(argp == TypeFunc::Parms + argcnt, "correct decoding");
954930
const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields);
955931
// returning cipher len (int)

0 commit comments

Comments
 (0)