Mercurial > hg > graal-jvmci-8
changeset 22116:1ca46ed9e31a
give error handling code in crypto substitutions a low probability
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 29 Jun 2015 16:45:09 +0200 |
parents | 919ea5f6486a |
children | bb6e6bc3b773 |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon Jun 29 14:22:03 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Mon Jun 29 16:45:09 2015 +0200 @@ -24,11 +24,12 @@ import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; +import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.word.Word.*; +import static jdk.internal.jvmci.code.UnsignedMath.*; import java.lang.reflect.*; -import jdk.internal.jvmci.code.*; import jdk.internal.jvmci.common.*; import jdk.internal.jvmci.meta.*; import sun.misc.*; @@ -92,7 +93,7 @@ * Perform null and array bounds checks for arguments to a cipher operation. */ static void checkArgs(byte[] in, int inOffset, byte[] out, int outOffset) { - if (UnsignedMath.aboveThan(inOffset + AES_BLOCK_SIZE, in.length) || UnsignedMath.aboveThan(outOffset + AES_BLOCK_SIZE, out.length)) { + if (probability(VERY_SLOW_PATH_PROBABILITY, aboveThan(inOffset + AES_BLOCK_SIZE, in.length) || aboveThan(outOffset + AES_BLOCK_SIZE, out.length))) { DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } }