Mercurial > hg > truffle
diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java @ 7554:9472211c812b
named constants for snippet probabilities (likely, frequent, fast_path, deopt), see CR-7
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 24 Jan 2013 18:20:46 +0100 |
parents | a0298e142ea8 |
children | 47467b2c3fc5 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java Thu Jan 24 17:06:00 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java Thu Jan 24 18:20:46 2013 +0100 @@ -68,13 +68,13 @@ @Parameter("falseValue") Object falseValue, @ConstantParameter("checkNull") boolean checkNull) { if (checkNull && object == null) { - probability(0.01); + probability(NOT_FREQUENT_PROBABILITY); isNull.inc(); return falseValue; } Word objectHub = loadHub(object); if (objectHub != exactHub) { - probability(0.75); + probability(LIKELY_PROBABILITY); exactMiss.inc(); return falseValue; } @@ -94,13 +94,13 @@ @ConstantParameter("checkNull") boolean checkNull, @ConstantParameter("superCheckOffset") int superCheckOffset) { if (checkNull && object == null) { - probability(0.01); + probability(NOT_FREQUENT_PROBABILITY); isNull.inc(); return falseValue; } Word objectHub = loadHub(object); if (objectHub.readWord(superCheckOffset) != hub) { - probability(0.45); + probability(NOT_LIKELY_PROBABILITY); displayMiss.inc(); return falseValue; } @@ -120,7 +120,7 @@ @VarargsParameter("hints") Word[] hints, @ConstantParameter("checkNull") boolean checkNull) { if (checkNull && object == null) { - probability(0.01); + probability(NOT_FREQUENT_PROBABILITY); isNull.inc(); return falseValue; } @@ -130,7 +130,7 @@ for (int i = 0; i < hints.length; i++) { Word hintHub = hints[i]; if (hintHub == objectHub) { - probability(0.01); + probability(NOT_FREQUENT_PROBABILITY); hintsHit.inc(); return trueValue; } @@ -152,7 +152,7 @@ @Parameter("falseValue") Object falseValue, @ConstantParameter("checkNull") boolean checkNull) { if (checkNull && object == null) { - probability(0.01); + probability(NOT_FREQUENT_PROBABILITY); isNull.inc(); return falseValue; }