Merge
This commit is contained in:
commit
3e18a6f16d
@ -34,19 +34,7 @@
|
||||
#include "libproc_md.h"
|
||||
#endif
|
||||
|
||||
#if defined(sparc) || defined(sparcv9)
|
||||
/*
|
||||
If _LP64 is defined ptrace.h should be taken from /usr/include/asm-sparc64
|
||||
otherwise it should be from /usr/include/asm-sparc
|
||||
These two files define pt_regs structure differently
|
||||
*/
|
||||
#ifdef _LP64
|
||||
#include "asm-sparc64/ptrace.h"
|
||||
#else
|
||||
#include "asm-sparc/ptrace.h"
|
||||
#endif
|
||||
|
||||
#endif //sparc or sparcv9
|
||||
#include <linux/ptrace.h>
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -123,8 +123,13 @@ class Assembler : public AbstractAssembler {
|
||||
fpop2_op3 = 0x35,
|
||||
impdep1_op3 = 0x36,
|
||||
aes3_op3 = 0x36,
|
||||
alignaddr_op3 = 0x36,
|
||||
faligndata_op3 = 0x36,
|
||||
flog3_op3 = 0x36,
|
||||
edge_op3 = 0x36,
|
||||
fsrc_op3 = 0x36,
|
||||
impdep2_op3 = 0x37,
|
||||
stpartialf_op3 = 0x37,
|
||||
jmpl_op3 = 0x38,
|
||||
rett_op3 = 0x39,
|
||||
trap_op3 = 0x3a,
|
||||
@ -175,17 +180,23 @@ class Assembler : public AbstractAssembler {
|
||||
|
||||
enum opfs {
|
||||
// selected opfs
|
||||
edge8n_opf = 0x01,
|
||||
|
||||
fmovs_opf = 0x01,
|
||||
fmovd_opf = 0x02,
|
||||
|
||||
fnegs_opf = 0x05,
|
||||
fnegd_opf = 0x06,
|
||||
|
||||
alignaddr_opf = 0x18,
|
||||
|
||||
fadds_opf = 0x41,
|
||||
faddd_opf = 0x42,
|
||||
fsubs_opf = 0x45,
|
||||
fsubd_opf = 0x46,
|
||||
|
||||
faligndata_opf = 0x48,
|
||||
|
||||
fmuls_opf = 0x49,
|
||||
fmuld_opf = 0x4a,
|
||||
fdivs_opf = 0x4d,
|
||||
@ -348,6 +359,8 @@ class Assembler : public AbstractAssembler {
|
||||
ASI_PRIMARY = 0x80,
|
||||
ASI_PRIMARY_NOFAULT = 0x82,
|
||||
ASI_PRIMARY_LITTLE = 0x88,
|
||||
// 8x8-bit partial store
|
||||
ASI_PST8_PRIMARY = 0xC0,
|
||||
// Block initializing store
|
||||
ASI_ST_BLKINIT_PRIMARY = 0xE2,
|
||||
// Most-Recently-Used (MRU) BIS variant
|
||||
@ -585,6 +598,9 @@ class Assembler : public AbstractAssembler {
|
||||
// instruction only in VIS1
|
||||
static void vis1_only() { assert( VM_Version::has_vis1(), "This instruction only works on SPARC with VIS1"); }
|
||||
|
||||
// instruction only in VIS2
|
||||
static void vis2_only() { assert( VM_Version::has_vis2(), "This instruction only works on SPARC with VIS2"); }
|
||||
|
||||
// instruction only in VIS3
|
||||
static void vis3_only() { assert( VM_Version::has_vis3(), "This instruction only works on SPARC with VIS3"); }
|
||||
|
||||
@ -1164,6 +1180,20 @@ public:
|
||||
inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); }
|
||||
|
||||
|
||||
// VIS1 instructions
|
||||
|
||||
void alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); }
|
||||
|
||||
void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); }
|
||||
|
||||
void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); }
|
||||
|
||||
void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); }
|
||||
|
||||
// VIS2 instructions
|
||||
|
||||
void edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); }
|
||||
|
||||
// VIS3 instructions
|
||||
|
||||
void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); }
|
||||
|
@ -259,8 +259,8 @@
|
||||
|
||||
// next two fns read and write Lmonitors value,
|
||||
private:
|
||||
BasicObjectLock* interpreter_frame_monitors() const { return *interpreter_frame_monitors_addr(); }
|
||||
void interpreter_frame_set_monitors(BasicObjectLock* monitors) { *interpreter_frame_monitors_addr() = monitors; }
|
||||
BasicObjectLock* interpreter_frame_monitors() const;
|
||||
void interpreter_frame_set_monitors(BasicObjectLock* monitors);
|
||||
#else
|
||||
public:
|
||||
inline interpreterState get_interpreterState() const {
|
||||
|
@ -226,6 +226,13 @@ inline Method** frame::interpreter_frame_method_addr() const {
|
||||
return (Method**)sp_addr_at( Lmethod->sp_offset_in_saved_window());
|
||||
}
|
||||
|
||||
inline BasicObjectLock* frame::interpreter_frame_monitors() const {
|
||||
return *interpreter_frame_monitors_addr();
|
||||
}
|
||||
|
||||
inline void frame::interpreter_frame_set_monitors(BasicObjectLock* monitors) {
|
||||
*interpreter_frame_monitors_addr() = monitors;
|
||||
}
|
||||
|
||||
// Constant pool cache
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -41,7 +41,7 @@ static bool returns_to_call_stub(address return_pc) {
|
||||
enum /* platform_dependent_constants */ {
|
||||
// %%%%%%%% May be able to shrink this a lot
|
||||
code_size1 = 20000, // simply increase if too small (assembler will crash if too small)
|
||||
code_size2 = 20000 // simply increase if too small (assembler will crash if too small)
|
||||
code_size2 = 22000 // simply increase if too small (assembler will crash if too small)
|
||||
};
|
||||
|
||||
class Sparc {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -266,9 +266,9 @@ void VM_Version::initialize() {
|
||||
if (!has_vis1()) // Drop to 0 if no VIS1 support
|
||||
UseVIS = 0;
|
||||
|
||||
// T2 and above should have support for AES instructions
|
||||
// SPARC T4 and above should have support for AES instructions
|
||||
if (has_aes()) {
|
||||
if (UseVIS > 0) { // AES intrinsics use FXOR instruction which is VIS1
|
||||
if (UseVIS > 2) { // AES intrinsics use MOVxTOd/MOVdTOx which are VIS3
|
||||
if (FLAG_IS_DEFAULT(UseAES)) {
|
||||
FLAG_SET_DEFAULT(UseAES, true);
|
||||
}
|
||||
@ -282,7 +282,7 @@ void VM_Version::initialize() {
|
||||
}
|
||||
} else {
|
||||
if (UseAES || UseAESIntrinsics) {
|
||||
warning("SPARC AES intrinsics require VIS1 instruction support. Intrinsics will be disabled.");
|
||||
warning("SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled.");
|
||||
if (UseAES) {
|
||||
FLAG_SET_DEFAULT(UseAES, false);
|
||||
}
|
||||
|
@ -78,12 +78,12 @@ inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) {
|
||||
__asm__ volatile(
|
||||
"1: \n\t"
|
||||
" ldx [%2], %%o2\n\t"
|
||||
" add %0, %%o2, %%o3\n\t"
|
||||
" add %1, %%o2, %%o3\n\t"
|
||||
" casx [%2], %%o2, %%o3\n\t"
|
||||
" cmp %%o2, %%o3\n\t"
|
||||
" bne %%xcc, 1b\n\t"
|
||||
" nop\n\t"
|
||||
" add %0, %%o2, %0\n\t"
|
||||
" add %1, %%o2, %0\n\t"
|
||||
: "=r" (rv)
|
||||
: "r" (add_value), "r" (dest)
|
||||
: "memory", "o2", "o3");
|
||||
|
@ -302,29 +302,30 @@ void os::print_register_info(outputStream *st, void *context) {
|
||||
if (context == NULL) return;
|
||||
|
||||
ucontext_t *uc = (ucontext_t*)context;
|
||||
sigcontext* sc = (sigcontext*)context;
|
||||
intptr_t *sp = (intptr_t *)os::Linux::ucontext_get_sp(uc);
|
||||
|
||||
st->print_cr("Register to memory mapping:");
|
||||
st->cr();
|
||||
|
||||
// this is only for the "general purpose" registers
|
||||
st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON__G1]);
|
||||
st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON__G2]);
|
||||
st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON__G3]);
|
||||
st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON__G4]);
|
||||
st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON__G5]);
|
||||
st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON__G6]);
|
||||
st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON__G7]);
|
||||
st->print("G1="); print_location(st, SIG_REGS(sc).u_regs[CON_G1]);
|
||||
st->print("G2="); print_location(st, SIG_REGS(sc).u_regs[CON_G2]);
|
||||
st->print("G3="); print_location(st, SIG_REGS(sc).u_regs[CON_G3]);
|
||||
st->print("G4="); print_location(st, SIG_REGS(sc).u_regs[CON_G4]);
|
||||
st->print("G5="); print_location(st, SIG_REGS(sc).u_regs[CON_G5]);
|
||||
st->print("G6="); print_location(st, SIG_REGS(sc).u_regs[CON_G6]);
|
||||
st->print("G7="); print_location(st, SIG_REGS(sc).u_regs[CON_G7]);
|
||||
st->cr();
|
||||
|
||||
st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON__O0]);
|
||||
st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON__O1]);
|
||||
st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON__O2]);
|
||||
st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON__O3]);
|
||||
st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON__O4]);
|
||||
st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON__O5]);
|
||||
st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON__O6]);
|
||||
st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON__O7]);
|
||||
st->print("O0="); print_location(st, SIG_REGS(sc).u_regs[CON_O0]);
|
||||
st->print("O1="); print_location(st, SIG_REGS(sc).u_regs[CON_O1]);
|
||||
st->print("O2="); print_location(st, SIG_REGS(sc).u_regs[CON_O2]);
|
||||
st->print("O3="); print_location(st, SIG_REGS(sc).u_regs[CON_O3]);
|
||||
st->print("O4="); print_location(st, SIG_REGS(sc).u_regs[CON_O4]);
|
||||
st->print("O5="); print_location(st, SIG_REGS(sc).u_regs[CON_O5]);
|
||||
st->print("O6="); print_location(st, SIG_REGS(sc).u_regs[CON_O6]);
|
||||
st->print("O7="); print_location(st, SIG_REGS(sc).u_regs[CON_O7]);
|
||||
st->cr();
|
||||
|
||||
st->print("L0="); print_location(st, sp[L0->sp_offset_in_saved_window()]);
|
||||
@ -516,7 +517,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) {
|
||||
if (nativeInstruction_at(*pc)->is_ic_miss_trap()) {
|
||||
#ifdef ASSERT
|
||||
#ifdef TIERED
|
||||
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
||||
CodeBlob* cb = CodeCache::find_blob_unsafe(*pc);
|
||||
assert(cb->is_compiled_by_c2(), "Wrong compiler");
|
||||
#endif // TIERED
|
||||
#endif // ASSERT
|
||||
|
@ -775,7 +775,7 @@
|
||||
/* java/lang/ref/Reference */ \
|
||||
do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \
|
||||
\
|
||||
/* support for com.sum.crypto.provider.AESCrypt and some of its callers */ \
|
||||
/* support for com.sun.crypto.provider.AESCrypt and some of its callers */ \
|
||||
do_class(com_sun_crypto_provider_aescrypt, "com/sun/crypto/provider/AESCrypt") \
|
||||
do_intrinsic(_aescrypt_encryptBlock, com_sun_crypto_provider_aescrypt, encryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
||||
do_intrinsic(_aescrypt_decryptBlock, com_sun_crypto_provider_aescrypt, decryptBlock_name, byteArray_int_byteArray_int_signature, F_R) \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -868,7 +868,7 @@ const TypeFunc* OptoRuntime::updateBytesCRC32_Type() {
|
||||
return TypeFunc::make(domain, range);
|
||||
}
|
||||
|
||||
// for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning void
|
||||
// for cipherBlockChaining calls of aescrypt encrypt/decrypt, four pointers and a length, returning int
|
||||
const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() {
|
||||
// create input type (domain)
|
||||
int num_args = 5;
|
||||
|
@ -2399,7 +2399,7 @@ bool Arguments::check_vm_args_consistency() {
|
||||
status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
|
||||
|
||||
// TieredCompilation needs at least 2 compiler threads.
|
||||
const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : 1;
|
||||
const int num_min_compiler_threads = (TieredCompilation && (TieredStopAtLevel >= CompLevel_full_optimization)) ? 2 : CI_COMPILER_COUNT;
|
||||
status &=verify_min_value(CICompilerCount, num_min_compiler_threads, "CICompilerCount");
|
||||
|
||||
if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -40,9 +40,20 @@ abstract public class TestAESBase {
|
||||
int msgSize = Integer.getInteger("msgSize", 646);
|
||||
boolean checkOutput = Boolean.getBoolean("checkOutput");
|
||||
boolean noReinit = Boolean.getBoolean("noReinit");
|
||||
boolean testingMisalignment;
|
||||
private static final int ALIGN = 8;
|
||||
int encInputOffset = Integer.getInteger("encInputOffset", 0) % ALIGN;
|
||||
int encOutputOffset = Integer.getInteger("encOutputOffset", 0) % ALIGN;
|
||||
int decOutputOffset = Integer.getInteger("decOutputOffset", 0) % ALIGN;
|
||||
int lastChunkSize = Integer.getInteger("lastChunkSize", 32);
|
||||
int keySize = Integer.getInteger("keySize", 128);
|
||||
int inputLength;
|
||||
int encodeLength;
|
||||
int decodeLength;
|
||||
int decodeMsgSize;
|
||||
String algorithm = System.getProperty("algorithm", "AES");
|
||||
String mode = System.getProperty("mode", "CBC");
|
||||
String paddingStr = System.getProperty("paddingStr", "PKCS5Padding");
|
||||
byte[] input;
|
||||
byte[] encode;
|
||||
byte[] expectedEncode;
|
||||
@ -51,7 +62,6 @@ abstract public class TestAESBase {
|
||||
Random random = new Random(0);
|
||||
Cipher cipher;
|
||||
Cipher dCipher;
|
||||
String paddingStr = "PKCS5Padding";
|
||||
AlgorithmParameters algParams;
|
||||
SecretKey key;
|
||||
|
||||
@ -67,7 +77,10 @@ abstract public class TestAESBase {
|
||||
|
||||
public void prepare() {
|
||||
try {
|
||||
System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput);
|
||||
System.out.println("\nalgorithm=" + algorithm + ", mode=" + mode + ", paddingStr=" + paddingStr + ", msgSize=" + msgSize + ", keySize=" + keySize + ", noReinit=" + noReinit + ", checkOutput=" + checkOutput + ", encInputOffset=" + encInputOffset + ", encOutputOffset=" + encOutputOffset + ", decOutputOffset=" + decOutputOffset + ", lastChunkSize=" +lastChunkSize );
|
||||
|
||||
if (encInputOffset % ALIGN != 0 || encOutputOffset % ALIGN != 0 || decOutputOffset % ALIGN !=0 )
|
||||
testingMisalignment = true;
|
||||
|
||||
int keyLenBytes = (keySize == 0 ? 16 : keySize/8);
|
||||
byte keyBytes[] = new byte[keyLenBytes];
|
||||
@ -81,10 +94,6 @@ abstract public class TestAESBase {
|
||||
System.out.println("Algorithm: " + key.getAlgorithm() + "("
|
||||
+ key.getEncoded().length * 8 + "bit)");
|
||||
}
|
||||
input = new byte[msgSize];
|
||||
for (int i=0; i<input.length; i++) {
|
||||
input[i] = (byte) (i & 0xff);
|
||||
}
|
||||
|
||||
cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
|
||||
dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE");
|
||||
@ -103,10 +112,35 @@ abstract public class TestAESBase {
|
||||
childShowCipher();
|
||||
}
|
||||
|
||||
inputLength = msgSize + encInputOffset;
|
||||
if (testingMisalignment) {
|
||||
encodeLength = cipher.getOutputSize(msgSize - lastChunkSize) + encOutputOffset;
|
||||
encodeLength += cipher.getOutputSize(lastChunkSize);
|
||||
decodeLength = dCipher.getOutputSize(encodeLength - lastChunkSize) + decOutputOffset;
|
||||
decodeLength += dCipher.getOutputSize(lastChunkSize);
|
||||
} else {
|
||||
encodeLength = cipher.getOutputSize(msgSize) + encOutputOffset;
|
||||
decodeLength = dCipher.getOutputSize(encodeLength) + decOutputOffset;
|
||||
}
|
||||
|
||||
input = new byte[inputLength];
|
||||
for (int i=encInputOffset, j=0; i<inputLength; i++, j++) {
|
||||
input[i] = (byte) (j & 0xff);
|
||||
}
|
||||
|
||||
// do one encode and decode in preparation
|
||||
// this will also create the encode buffer and decode buffer
|
||||
encode = cipher.doFinal(input);
|
||||
decode = dCipher.doFinal(encode);
|
||||
encode = new byte[encodeLength];
|
||||
decode = new byte[decodeLength];
|
||||
if (testingMisalignment) {
|
||||
decodeMsgSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
|
||||
decodeMsgSize += cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + decodeMsgSize));
|
||||
|
||||
int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
|
||||
dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
|
||||
} else {
|
||||
decodeMsgSize = cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
|
||||
dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
|
||||
}
|
||||
if (checkOutput) {
|
||||
expectedEncode = (byte[]) encode.clone();
|
||||
expectedDecode = (byte[]) decode.clone();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,14 +33,15 @@ public class TestAESDecode extends TestAESBase {
|
||||
public void run() {
|
||||
try {
|
||||
if (!noReinit) dCipher.init(Cipher.DECRYPT_MODE, key, algParams);
|
||||
if (checkOutput) {
|
||||
// checked version creates new output buffer each time
|
||||
decode = dCipher.doFinal(encode, 0, encode.length);
|
||||
compareArrays(decode, expectedDecode);
|
||||
decode = new byte[decodeLength];
|
||||
if (testingMisalignment) {
|
||||
int tempSize = dCipher.update(encode, encOutputOffset, (decodeMsgSize - lastChunkSize), decode, decOutputOffset);
|
||||
dCipher.doFinal(encode, (encOutputOffset + decodeMsgSize - lastChunkSize), lastChunkSize, decode, (decOutputOffset + tempSize));
|
||||
} else {
|
||||
// non-checked version outputs to existing encode buffer for maximum speed
|
||||
decode = new byte[dCipher.getOutputSize(encode.length)];
|
||||
dCipher.doFinal(encode, 0, encode.length, decode);
|
||||
dCipher.doFinal(encode, encOutputOffset, decodeMsgSize, decode, decOutputOffset);
|
||||
}
|
||||
if (checkOutput) {
|
||||
compareArrays(decode, expectedDecode);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -33,14 +33,15 @@ public class TestAESEncode extends TestAESBase {
|
||||
public void run() {
|
||||
try {
|
||||
if (!noReinit) cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
|
||||
if (checkOutput) {
|
||||
// checked version creates new output buffer each time
|
||||
encode = cipher.doFinal(input, 0, msgSize);
|
||||
compareArrays(encode, expectedEncode);
|
||||
encode = new byte[encodeLength];
|
||||
if (testingMisalignment) {
|
||||
int tempSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
|
||||
cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + tempSize));
|
||||
} else {
|
||||
// non-checked version outputs to existing encode buffer for maximum speed
|
||||
encode = new byte[cipher.getOutputSize(msgSize)];
|
||||
cipher.doFinal(input, 0, msgSize, encode);
|
||||
cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
|
||||
}
|
||||
if (checkOutput) {
|
||||
compareArrays(encode, expectedEncode);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -28,7 +28,19 @@
|
||||
* @summary add intrinsics to use AES instructions
|
||||
*
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DdecOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CBC -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DdecOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain
|
||||
* @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=ECB -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain
|
||||
*
|
||||
* @author Tom Deneau
|
||||
*/
|
||||
@ -36,12 +48,13 @@
|
||||
public class TestAESMain {
|
||||
public static void main(String[] args) {
|
||||
int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000);
|
||||
int warmupIters = (args.length > 1 ? Integer.valueOf(args[1]) : 20000);
|
||||
System.out.println(iters + " iterations");
|
||||
TestAESEncode etest = new TestAESEncode();
|
||||
etest.prepare();
|
||||
// warm-up for 20K iterations
|
||||
// warm-up
|
||||
System.out.println("Starting encryption warm-up");
|
||||
for (int i=0; i<20000; i++) {
|
||||
for (int i=0; i<warmupIters; i++) {
|
||||
etest.run();
|
||||
}
|
||||
System.out.println("Finished encryption warm-up");
|
||||
@ -54,9 +67,9 @@ public class TestAESMain {
|
||||
|
||||
TestAESDecode dtest = new TestAESDecode();
|
||||
dtest.prepare();
|
||||
// warm-up for 20K iterations
|
||||
// warm-up
|
||||
System.out.println("Starting decryption warm-up");
|
||||
for (int i=0; i<20000; i++) {
|
||||
for (int i=0; i<warmupIters; i++) {
|
||||
dtest.run();
|
||||
}
|
||||
System.out.println("Finished decryption warm-up");
|
||||
|
@ -30,11 +30,28 @@
|
||||
import com.oracle.java.testlibrary.*;
|
||||
|
||||
public class NumCompilerThreadsCheck {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
|
||||
String expectedOutput = "CICompilerCount of -1 is invalid";
|
||||
out.shouldContain(expectedOutput);
|
||||
|
||||
if (isZeroVm()) {
|
||||
String expectedLowWaterMarkText = "must be at least 0";
|
||||
out.shouldContain(expectedLowWaterMarkText);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isZeroVm() {
|
||||
String vmName = System.getProperty("java.vm.name");
|
||||
if (vmName == null) {
|
||||
throw new RuntimeException("No VM name");
|
||||
}
|
||||
if (vmName.toLowerCase().contains("zero")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user