Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: runtime/vm/method_recognizer.h

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« runtime/vm/intrinsifier.cc ('K') | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_METHOD_RECOGNIZER_H_ 5 #ifndef VM_METHOD_RECOGNIZER_H_
6 #define VM_METHOD_RECOGNIZER_H_ 6 #define VM_METHOD_RECOGNIZER_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 967644870) \ 115 V(_Int32x4, shuffleMix, Int32x4ShuffleMix, 967644870) \
116 V(_Int32x4, select, Int32x4Select, 1696037681) \ 116 V(_Int32x4, select, Int32x4Select, 1696037681) \
117 V(_Int32x4, withFlagX, Int32x4WithFlagX, 467852789) \ 117 V(_Int32x4, withFlagX, Int32x4WithFlagX, 467852789) \
118 V(_Int32x4, withFlagY, Int32x4WithFlagY, 1903359978) \ 118 V(_Int32x4, withFlagY, Int32x4WithFlagY, 1903359978) \
119 V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 862460960) \ 119 V(_Int32x4, withFlagZ, Int32x4WithFlagZ, 862460960) \
120 V(_Int32x4, withFlagW, Int32x4WithFlagW, 1095242907) \ 120 V(_Int32x4, withFlagW, Int32x4WithFlagW, 1095242907) \
121 V(_Float32Array, [], Float32ArrayGetIndexed, 856653338) \ 121 V(_Float32Array, [], Float32ArrayGetIndexed, 856653338) \
122 V(_Float32Array, []=, Float32ArraySetIndexed, 2086166464) \ 122 V(_Float32Array, []=, Float32ArraySetIndexed, 2086166464) \
123 V(_Int8Array, [], Int8ArrayGetIndexed, 321230586) \ 123 V(_Int8Array, [], Int8ArrayGetIndexed, 321230586) \
124 V(_Int8Array, []=, Int8ArraySetIndexed, 2050598685) \ 124 V(_Int8Array, []=, Int8ArraySetIndexed, 2050598685) \
125 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \
126 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \ 125 V(_Uint8ClampedArray, [], Uint8ClampedArrayGetIndexed, 430672063) \
127 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \ 126 V(_Uint8ClampedArray, []=, Uint8ClampedArraySetIndexed, 821294340) \
128 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 918478513) \
129 V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \ 127 V(_ExternalUint8ClampedArray, [], ExternalUint8ClampedArrayGetIndexed, \
130 1346536303) \ 128 1346536303) \
131 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \ 129 V(_ExternalUint8ClampedArray, []=, ExternalUint8ClampedArraySetIndexed, \
132 1794849214) \ 130 1794849214) \
133 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \ 131 V(_Int16Array, [], Int16ArrayGetIndexed, 74127855) \
134 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \ 132 V(_Int16Array, []=, Int16ArraySetIndexed, 1610252345) \
135 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \ 133 V(_Uint16Array, [], Uint16ArrayGetIndexed, 470411953) \
136 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \ 134 V(_Uint16Array, []=, Uint16ArraySetIndexed, 1648929040) \
137 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \ 135 V(_Int32Array, [], Int32ArrayGetIndexed, 203101370) \
138 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \ 136 V(_Int32Array, []=, Int32ArraySetIndexed, 338968571) \
(...skipping 17 matching lines...) Expand all
156 V(_Double, <=, Double_lessEqualThan, 106225572) \ 154 V(_Double, <=, Double_lessEqualThan, 106225572) \
157 V(_Double, ==, Double_equal, 2093918133) \ 155 V(_Double, ==, Double_equal, 2093918133) \
158 V(_Double, +, Double_add, 1646350451) \ 156 V(_Double, +, Double_add, 1646350451) \
159 V(_Double, -, Double_sub, 1477459276) \ 157 V(_Double, -, Double_sub, 1477459276) \
160 V(_Double, *, Double_mul, 1334580777) \ 158 V(_Double, *, Double_mul, 1334580777) \
161 V(_Double, /, Double_div, 1938037155) \ 159 V(_Double, /, Double_div, 1938037155) \
162 V(_Double, get:isNaN, Double_getIsNaN, 843050033) \ 160 V(_Double, get:isNaN, Double_getIsNaN, 843050033) \
163 V(_Double, get:isNegative, Double_getIsNegative, 1637875580) \ 161 V(_Double, get:isNegative, Double_getIsNegative, 1637875580) \
164 V(_Double, _mulFromInteger, Double_mulFromInteger, 1594796483) \ 162 V(_Double, _mulFromInteger, Double_mulFromInteger, 1594796483) \
165 V(_Double, .fromInteger, DoubleFromInteger, 999771940) \ 163 V(_Double, .fromInteger, DoubleFromInteger, 999771940) \
166 V(_List, get:length, ObjectArrayLength, 1181352729) \
167 V(_List, [], ObjectArrayGetIndexed, 795612476) \
168 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ 164 V(_List, []=, ObjectArraySetIndexed, 1288827575) \
169 V(_GrowableList, .withData, GrowableArray_Allocate, 732923072) \ 165 V(_GrowableList, .withData, GrowableArray_Allocate, 732923072) \
170 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \
171 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 555140075) \
172 V(_GrowableList, [], GrowableArrayGetIndexed, 919108233) \ 166 V(_GrowableList, [], GrowableArrayGetIndexed, 919108233) \
173 V(_GrowableList, []=, GrowableArraySetIndexed, 1218649853) \ 167 V(_GrowableList, []=, GrowableArraySetIndexed, 1218649853) \
174 V(_GrowableList, _setLength, GrowableArraySetLength, 89389299) \ 168 V(_GrowableList, _setLength, GrowableArraySetLength, 89389299) \
175 V(_GrowableList, _setData, GrowableArraySetData, 2126927509) \ 169 V(_GrowableList, _setData, GrowableArraySetData, 2126927509) \
176 V(_GrowableList, add, GrowableArray_add, 1899133961) \ 170 V(_GrowableList, add, GrowableArray_add, 1899133961) \
177 V(_ImmutableList, [], ImmutableArrayGetIndexed, 1990177341) \
178 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \
179 V(Object, ==, ObjectEquals, 1068471689) \ 171 V(Object, ==, ObjectEquals, 1068471689) \
180 V(_StringBase, get:hashCode, String_getHashCode, 2102906241) \ 172 V(_StringBase, get:hashCode, String_getHashCode, 2102906241) \
181 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 49873871) \ 173 V(_StringBase, get:isEmpty, StringBaseIsEmpty, 49873871) \
182 V(_StringBase, get:length, StringBaseLength, 784399628) \
183 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 397735324) \ 174 V(_StringBase, codeUnitAt, StringBaseCodeUnitAt, 397735324) \
184 V(_StringBase, [], StringBaseCharAt, 1512210677) \ 175 V(_StringBase, [], StringBaseCharAt, 1512210677) \
185 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \ 176 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \
186 V(_OneByteString, _substringUncheckedNative, \ 177 V(_OneByteString, _substringUncheckedNative, \
187 OneByteString_substringUnchecked, 1527498975) \ 178 OneByteString_substringUnchecked, 1527498975) \
188 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ 179 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \
189 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \ 180 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \
190 V(_OneByteString, ==, OneByteString_equality, 1727047023) \ 181 V(_OneByteString, ==, OneByteString_equality, 1727047023) \
191 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \ 182 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \
192 183
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 V(_IntegerImplementation, >>, Integer_sar, 1797129864) \ 219 V(_IntegerImplementation, >>, Integer_sar, 1797129864) \
229 V(_Double, toInt, DoubleToInteger, 1547535151) 220 V(_Double, toInt, DoubleToInteger, 1547535151)
230 221
231 222
232 #define MATH_LIB_INTRINSIC_LIST(V) \ 223 #define MATH_LIB_INTRINSIC_LIST(V) \
233 V(::, sqrt, MathSqrt, 101545548) \ 224 V(::, sqrt, MathSqrt, 101545548) \
234 V(_Random, _nextState, Random_nextState, 55890711) \ 225 V(_Random, _nextState, Random_nextState, 55890711) \
235 226
236 227
237 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 228 #define TYPED_DATA_LIB_INTRINSIC_LIST(V) \
238 V(_TypedList, get:length, TypedDataLength, 522565357) \
239 V(_Int8Array, _new, TypedData_Int8Array_new, 1150131819) \ 229 V(_Int8Array, _new, TypedData_Int8Array_new, 1150131819) \
240 V(_Uint8Array, _new, TypedData_Uint8Array_new, 2019665760) \ 230 V(_Uint8Array, _new, TypedData_Uint8Array_new, 2019665760) \
241 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 726412668) \ 231 V(_Uint8ClampedArray, _new, TypedData_Uint8ClampedArray_new, 726412668) \
242 V(_Int16Array, _new, TypedData_Int16Array_new, 1879541015) \ 232 V(_Int16Array, _new, TypedData_Int16Array_new, 1879541015) \
243 V(_Uint16Array, _new, TypedData_Uint16Array_new, 189496401) \ 233 V(_Uint16Array, _new, TypedData_Uint16Array_new, 189496401) \
244 V(_Int32Array, _new, TypedData_Int32Array_new, 1725327048) \ 234 V(_Int32Array, _new, TypedData_Int32Array_new, 1725327048) \
245 V(_Uint32Array, _new, TypedData_Uint32Array_new, 10306485) \ 235 V(_Uint32Array, _new, TypedData_Uint32Array_new, 10306485) \
246 V(_Int64Array, _new, TypedData_Int64Array_new, 1299501918) \ 236 V(_Int64Array, _new, TypedData_Int64Array_new, 1299501918) \
247 V(_Uint64Array, _new, TypedData_Uint64Array_new, 1635318703) \ 237 V(_Uint64Array, _new, TypedData_Uint64Array_new, 1635318703) \
248 V(_Float32Array, _new, TypedData_Float32Array_new, 577737480) \ 238 V(_Float32Array, _new, TypedData_Float32Array_new, 577737480) \
249 V(_Float64Array, _new, TypedData_Float64Array_new, 645355686) \ 239 V(_Float64Array, _new, TypedData_Float64Array_new, 645355686) \
250 V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 596639418) \ 240 V(_Float32x4Array, _new, TypedData_Float32x4Array_new, 596639418) \
251 V(_Int32x4Array, _new, TypedData_Int32x4Array_new, 496358233) \ 241 V(_Int32x4Array, _new, TypedData_Int32x4Array_new, 496358233) \
252 V(_Float64x2Array, _new, TypedData_Float64x2Array_new, 1506975080) \ 242 V(_Float64x2Array, _new, TypedData_Float64x2Array_new, 1506975080) \
253 V(_Int8Array, ., TypedData_Int8Array_factory, 1499010120) \ 243 V(_Int8Array, ., TypedData_Int8Array_factory, 1499010120) \
254 V(_Uint8Array, ., TypedData_Uint8Array_factory, 354210806) \ 244 V(_Uint8Array, ., TypedData_Uint8Array_factory, 354210806) \
255 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 231626935) \ 245 V(_Uint8ClampedArray, ., TypedData_Uint8ClampedArray_factory, 231626935) \
256 V(_Int16Array, ., TypedData_Int16Array_factory, 1044203454) \ 246 V(_Int16Array, ., TypedData_Int16Array_factory, 1044203454) \
257 V(_Uint16Array, ., TypedData_Uint16Array_factory, 616427808) \ 247 V(_Uint16Array, ., TypedData_Uint16Array_factory, 616427808) \
258 V(_Int32Array, ., TypedData_Int32Array_factory, 26656923) \ 248 V(_Int32Array, ., TypedData_Int32Array_factory, 26656923) \
259 V(_Uint32Array, ., TypedData_Uint32Array_factory, 297463966) \ 249 V(_Uint32Array, ., TypedData_Uint32Array_factory, 297463966) \
260 V(_Int64Array, ., TypedData_Int64Array_factory, 105050331) \ 250 V(_Int64Array, ., TypedData_Int64Array_factory, 105050331) \
261 V(_Uint64Array, ., TypedData_Uint64Array_factory, 1469861670) \ 251 V(_Uint64Array, ., TypedData_Uint64Array_factory, 1469861670) \
262 V(_Float32Array, ., TypedData_Float32Array_factory, 105860920) \ 252 V(_Float32Array, ., TypedData_Float32Array_factory, 105860920) \
263 V(_Float64Array, ., TypedData_Float64Array_factory, 342242776) \ 253 V(_Float64Array, ., TypedData_Float64Array_factory, 342242776) \
264 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1217848993) \ 254 V(_Float32x4Array, ., TypedData_Float32x4Array_factory, 1217848993) \
265 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 100825417) \ 255 V(_Int32x4Array, ., TypedData_Int32x4Array_factory, 100825417) \
266 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 611308575) \ 256 V(_Float64x2Array, ., TypedData_Float64x2Array_factory, 611308575) \
257
258 #define GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
267 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \ 259 V(_Uint8Array, [], Uint8ArrayGetIndexed, 16125140) \
260 V(_Uint8Array, []=, Uint8ArraySetIndexed, 2018064553) \
268 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 1678777951) \ 261 V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 1678777951) \
262 V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 918478513) \
263 V(_Float64Array, []=, Float64ArraySetIndexed, 243929230) \
269 V(_Float64Array, [], Float64ArrayGetIndexed, 1779054297) \ 264 V(_Float64Array, [], Float64ArrayGetIndexed, 1779054297) \
270 V(_Float64Array, []=, Float64ArraySetIndexed, 243929230) \ 265 V(_TypedList, get:length, TypedDataLength, 522565357) \
271 266
267 #define GRAPH_CORE_INTRINSICS_LIST(V) \
268 V(_List, get:length, ObjectArrayLength, 1181352729) \
269 V(_List, [], ObjectArrayGetIndexed, 795612476) \
270 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \
271 V(_ImmutableList, [], ImmutableArrayGetIndexed, 1990177341) \
272 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \
273 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 555140075) \
274 V(_StringBase, get:length, StringBaseLength, 784399628) \
275
276 #define GRAPH_INTRINSICS_LIST(V) \
277 GRAPH_CORE_INTRINSICS_LIST(V) \
278 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \
272 279
273 #define PROFILER_LIB_INTRINSIC_LIST(V) \ 280 #define PROFILER_LIB_INTRINSIC_LIST(V) \
274 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ 281 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \
275 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ 282 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \
276 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ 283 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \
277 284
278 #define ALL_INTRINSICS_LIST(V) \ 285 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
279 CORE_LIB_INTRINSIC_LIST(V) \ 286 CORE_LIB_INTRINSIC_LIST(V) \
280 CORE_INTEGER_LIB_INTRINSIC_LIST(V) \
281 MATH_LIB_INTRINSIC_LIST(V) \ 287 MATH_LIB_INTRINSIC_LIST(V) \
282 TYPED_DATA_LIB_INTRINSIC_LIST(V) \ 288 TYPED_DATA_LIB_INTRINSIC_LIST(V) \
283 PROFILER_LIB_INTRINSIC_LIST(V) 289 PROFILER_LIB_INTRINSIC_LIST(V)
284 290
291 #define ALL_INTRINSICS_LIST(V) \
292 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \
293 CORE_INTEGER_LIB_INTRINSIC_LIST(V)
294
285 #define RECOGNIZED_LIST(V) \ 295 #define RECOGNIZED_LIST(V) \
286 OTHER_RECOGNIZED_LIST(V) \ 296 OTHER_RECOGNIZED_LIST(V) \
287 ALL_INTRINSICS_LIST(V) 297 ALL_INTRINSICS_LIST(V) \
298 GRAPH_INTRINSICS_LIST(V)
288 299
289 // A list of core function that should always be inlined. 300 // A list of core function that should always be inlined.
290 #define INLINE_WHITE_LIST(V) \ 301 #define INLINE_WHITE_LIST(V) \
291 V(Object, ==, ObjectEquals, 1068471689) \ 302 V(Object, ==, ObjectEquals, 1068471689) \
292 V(_List, get:length, ObjectArrayLength, 1181352729) \ 303 V(_List, get:length, ObjectArrayLength, 1181352729) \
293 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ 304 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \
294 V(_TypedList, get:length, TypedDataLength, 522565357) \ 305 V(_TypedList, get:length, TypedDataLength, 522565357) \
295 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ 306 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \
296 V(_StringBase, get:length, StringBaseLength, 784399628) \ 307 V(_StringBase, get:length, StringBaseLength, 784399628) \
297 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ 308 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 static Kind RecognizeKind(const Function& function); 401 static Kind RecognizeKind(const Function& function);
391 static bool AlwaysInline(const Function& function); 402 static bool AlwaysInline(const Function& function);
392 static bool PolymorphicTarget(const Function& function); 403 static bool PolymorphicTarget(const Function& function);
393 static const char* KindToCString(Kind kind); 404 static const char* KindToCString(Kind kind);
394 static void InitializeState(); 405 static void InitializeState();
395 }; 406 };
396 407
397 } // namespace dart 408 } // namespace dart
398 409
399 #endif // VM_METHOD_RECOGNIZER_H_ 410 #endif // VM_METHOD_RECOGNIZER_H_
OLDNEW
« runtime/vm/intrinsifier.cc ('K') | « runtime/vm/intrinsifier_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698