Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java @ 7701:47467b2c3fc5
Use equal() and notEqual() instead of == and != to compare words
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Mon, 04 Feb 2013 09:31:44 -0800 |
parents | 9472211c812b |
children | 7a5bbcc36bb2 992f62c457b0 |
comparison
equal
deleted
inserted
replaced
7700:627c284671b7 | 7701:47467b2c3fc5 |
---|---|
82 @ConstantParameter("size") int size, | 82 @ConstantParameter("size") int size, |
83 @ConstantParameter("fillContents") boolean fillContents, | 83 @ConstantParameter("fillContents") boolean fillContents, |
84 @ConstantParameter("locked") boolean locked) { | 84 @ConstantParameter("locked") boolean locked) { |
85 | 85 |
86 Object result; | 86 Object result; |
87 if (memory == Word.zero()) { | 87 if (memory.equal(0)) { |
88 new_stub.inc(); | 88 new_stub.inc(); |
89 result = NewInstanceStubCall.call(hub); | 89 result = NewInstanceStubCall.call(hub); |
90 } else { | 90 } else { |
91 probability(FAST_PATH_PROBABILITY); | 91 probability(FAST_PATH_PROBABILITY); |
92 if (locked) { | 92 if (locked) { |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 private static Object initializeArray(Word memory, Word hub, int length, int allocationSize, Word prototypeMarkWord, int headerSize, boolean fillContents) { | 119 private static Object initializeArray(Word memory, Word hub, int length, int allocationSize, Word prototypeMarkWord, int headerSize, boolean fillContents) { |
120 Object result; | 120 Object result; |
121 if (memory == Word.zero()) { | 121 if (memory.equal(0)) { |
122 newarray_stub.inc(); | 122 newarray_stub.inc(); |
123 result = NewArrayStubCall.call(hub, length); | 123 result = NewArrayStubCall.call(hub, length); |
124 } else { | 124 } else { |
125 probability(FAST_PATH_PROBABILITY); | 125 probability(FAST_PATH_PROBABILITY); |
126 newarray_loopInit.inc(); | 126 newarray_loopInit.inc(); |