# HG changeset patch # User Gilles Duboscq # Date 1389606412 -3600 # Node ID 11c46696a65550a11e74d96d5bb22ef1b33640d8 # Parent b1838411e896940538ed8b7d5ed23ce15ef76aa5 Add probabilities to NewObjectSnippets.allocateInstanceDynamic diff -r b1838411e896 -r 11c46696a655 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue Jan 14 10:14:31 2014 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Mon Jan 13 10:46:52 2014 +0100 @@ -151,8 +151,8 @@ @Snippet public static Object allocateInstanceDynamic(Class type, @ConstantParameter boolean fillContents, @ConstantParameter Register threadRegister, @ConstantParameter String typeContext) { Word hub = loadWordFromObject(type, klassOffset()); - if (!hub.equal(Word.zero())) { - if (isKlassFullyInitialized(hub)) { + if (probability(FAST_PATH_PROBABILITY, !hub.equal(Word.zero()))) { + if (probability(FAST_PATH_PROBABILITY, isKlassFullyInitialized(hub))) { int layoutHelper = readLayoutHelper(hub); /* * src/share/vm/oops/klass.hpp: For instances, layout helper is a positive number, @@ -160,7 +160,7 @@ * scaled to bytes. The low order bit is set if instances of this class cannot be * allocated using the fastpath. */ - if ((layoutHelper & 1) == 0) { + if (probability(FAST_PATH_PROBABILITY, (layoutHelper & 1) == 0)) { Word prototypeMarkWord = hub.readWord(prototypeMarkWordOffset(), PROTOTYPE_MARK_WORD_LOCATION); return allocateInstance(layoutHelper, hub, prototypeMarkWord, fillContents, threadRegister, false, typeContext); }