Mercurial > hg > graal-compiler
changeset 12546:d084c3db9c61
ArrayCopySnippets: use slow path probability for deopt branches
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 23 Oct 2013 22:06:04 +0200 |
parents | 11b086b1bae4 |
children | da2edc2ceffc |
files | graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java Wed Oct 23 13:54:21 2013 -0400 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ArrayCopySnippets.java Wed Oct 23 22:06:04 2013 +0200 @@ -90,30 +90,30 @@ public static int checkArrayType(Word hub) { int layoutHelper = readLayoutHelper(hub); - if (layoutHelper >= 0) { + if (probability(SLOW_PATH_PROBABILITY, layoutHelper >= 0)) { DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } return layoutHelper; } public static void checkLimits(Object src, int srcPos, Object dest, int destPos, int length) { - if (srcPos < 0) { + if (probability(SLOW_PATH_PROBABILITY, srcPos < 0)) { checkAIOOBECounter.inc(); DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } - if (destPos < 0) { + if (probability(SLOW_PATH_PROBABILITY, destPos < 0)) { checkAIOOBECounter.inc(); DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } - if (length < 0) { + if (probability(SLOW_PATH_PROBABILITY, length < 0)) { checkAIOOBECounter.inc(); DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } - if (srcPos + length > ArrayLengthNode.arrayLength(src)) { + if (probability(SLOW_PATH_PROBABILITY, srcPos + length > ArrayLengthNode.arrayLength(src))) { checkAIOOBECounter.inc(); DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); } - if (destPos + length > ArrayLengthNode.arrayLength(dest)) { + if (probability(SLOW_PATH_PROBABILITY, destPos + length > ArrayLengthNode.arrayLength(dest))) { checkAIOOBECounter.inc(); DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint); }