Mercurial > hg > truffle
comparison graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java @ 7275:4f220c85044d
replaces node intrinsics for loadinf from a Word with methods directly in the Word class itself
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 18 Dec 2012 22:23:46 +0100 |
parents | 9ba90252ce08 |
children | 346336325337 |
comparison
equal
deleted
inserted
replaced
7274:19f5c9b96fa7 | 7275:4f220c85044d |
---|---|
91 if (checkNull && object == null) { | 91 if (checkNull && object == null) { |
92 isNull.inc(); | 92 isNull.inc(); |
93 return falseValue; | 93 return falseValue; |
94 } | 94 } |
95 Word objectHub = loadHub(object); | 95 Word objectHub = loadHub(object); |
96 if (loadWordFromWord(objectHub, superCheckOffset) != hub) { | 96 if (objectHub.readWord(superCheckOffset) != hub) { |
97 displayMiss.inc(); | 97 displayMiss.inc(); |
98 return falseValue; | 98 return falseValue; |
99 } | 99 } |
100 displayHit.inc(); | 100 displayHit.inc(); |
101 return trueValue; | 101 return trueValue; |
132 return trueValue; | 132 return trueValue; |
133 } | 133 } |
134 | 134 |
135 static boolean checkSecondarySubType(Word t, Word s) { | 135 static boolean checkSecondarySubType(Word t, Word s) { |
136 // if (S.cache == T) return true | 136 // if (S.cache == T) return true |
137 if (loadWordFromWord(s, secondarySuperCacheOffset()) == t) { | 137 if (s.readWord(secondarySuperCacheOffset()) == t) { |
138 cacheHit.inc(); | 138 cacheHit.inc(); |
139 return true; | 139 return true; |
140 } | 140 } |
141 | 141 |
142 // if (T == S) return true | 142 // if (T == S) return true |
144 T_equals_S.inc(); | 144 T_equals_S.inc(); |
145 return true; | 145 return true; |
146 } | 146 } |
147 | 147 |
148 // if (S.scan_s_s_array(T)) { S.cache = T; return true; } | 148 // if (S.scan_s_s_array(T)) { S.cache = T; return true; } |
149 Word secondarySupers = loadWordFromWord(s, secondarySupersOffset()); | 149 Word secondarySupers = s.readWord(secondarySupersOffset()); |
150 int length = loadIntFromWord(secondarySupers, metaspaceArrayLengthOffset()); | 150 int length = secondarySupers.readInt(metaspaceArrayLengthOffset()); |
151 for (int i = 0; i < length; i++) { | 151 for (int i = 0; i < length; i++) { |
152 if (t == loadWordElement(secondarySupers, i)) { | 152 if (t == loadWordElement(secondarySupers, i)) { |
153 DirectObjectStoreNode.storeObject(s, secondarySuperCacheOffset(), 0, t); | 153 DirectObjectStoreNode.storeObject(s, secondarySuperCacheOffset(), 0, t); |
154 secondariesHit.inc(); | 154 secondariesHit.inc(); |
155 return true; | 155 return true; |