OLD | NEW |
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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 V(_StringBase, [], StringBaseCharAt, 1512210677) \ | 191 V(_StringBase, [], StringBaseCharAt, 1512210677) \ |
192 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \ | 192 V(_OneByteString, get:hashCode, OneByteString_getHashCode, 1111837929) \ |
193 V(_OneByteString, _substringUncheckedNative, \ | 193 V(_OneByteString, _substringUncheckedNative, \ |
194 OneByteString_substringUnchecked, 1527498975) \ | 194 OneByteString_substringUnchecked, 1527498975) \ |
195 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ | 195 V(_OneByteString, _setAt, OneByteStringSetAt, 468605749) \ |
196 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \ | 196 V(_OneByteString, _allocate, OneByteString_allocate, 2035417022) \ |
197 V(_OneByteString, ==, OneByteString_equality, 1727047023) \ | 197 V(_OneByteString, ==, OneByteString_equality, 1727047023) \ |
198 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \ | 198 V(_TwoByteString, ==, TwoByteString_equality, 951149689) \ |
199 | 199 |
200 | 200 |
| 201 // TODO(zerny): Remove this list and add _ExecuteMatch to |
| 202 // CORE_LIB_INTRINSIC_LIST once irregexp code has been implemented for all |
| 203 // architectures and JSCRE has been removed. |
| 204 #if defined(USE_JSCRE) |
| 205 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V) |
| 206 #else |
| 207 #define CORE_REGEXP_LIB_INTRINSIC_LIST(V) \ |
| 208 V(_JSSyntaxRegExp, _ExecuteMatch, JSRegExp_ExecuteMatch, 1654250896) |
| 209 #endif |
| 210 |
| 211 |
201 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \ | 212 #define CORE_INTEGER_LIB_INTRINSIC_LIST(V) \ |
202 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \ | 213 V(_IntegerImplementation, _addFromInteger, Integer_addFromInteger, \ |
203 438687793) \ | 214 438687793) \ |
204 V(_IntegerImplementation, +, Integer_add, 501253666) \ | 215 V(_IntegerImplementation, +, Integer_add, 501253666) \ |
205 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \ | 216 V(_IntegerImplementation, _subFromInteger, Integer_subFromInteger, \ |
206 562800077) \ | 217 562800077) \ |
207 V(_IntegerImplementation, -, Integer_sub, 1819430179) \ | 218 V(_IntegerImplementation, -, Integer_sub, 1819430179) \ |
208 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \ | 219 V(_IntegerImplementation, _mulFromInteger, Integer_mulFromInteger, \ |
209 67891834) \ | 220 67891834) \ |
210 V(_IntegerImplementation, *, Integer_mul, 1787870724) \ | 221 V(_IntegerImplementation, *, Integer_mul, 1787870724) \ |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 GRAPH_CORE_INTRINSICS_LIST(V) \ | 304 GRAPH_CORE_INTRINSICS_LIST(V) \ |
294 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ | 305 GRAPH_TYPED_DATA_INTRINSICS_LIST(V) \ |
295 | 306 |
296 #define PROFILER_LIB_INTRINSIC_LIST(V) \ | 307 #define PROFILER_LIB_INTRINSIC_LIST(V) \ |
297 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ | 308 V(_UserTag, makeCurrent, UserTag_makeCurrent, 370414636) \ |
298 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ | 309 V(::, _getDefaultTag, UserTag_defaultTag, 1159885970) \ |
299 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ | 310 V(::, _getCurrentTag, Profiler_getCurrentTag, 1182126114) \ |
300 | 311 |
301 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ | 312 #define ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ |
302 CORE_LIB_INTRINSIC_LIST(V) \ | 313 CORE_LIB_INTRINSIC_LIST(V) \ |
| 314 CORE_REGEXP_LIB_INTRINSIC_LIST(V) \ |
303 MATH_LIB_INTRINSIC_LIST(V) \ | 315 MATH_LIB_INTRINSIC_LIST(V) \ |
304 TYPED_DATA_LIB_INTRINSIC_LIST(V) \ | 316 TYPED_DATA_LIB_INTRINSIC_LIST(V) \ |
305 PROFILER_LIB_INTRINSIC_LIST(V) | 317 PROFILER_LIB_INTRINSIC_LIST(V) |
306 | 318 |
307 #define ALL_INTRINSICS_LIST(V) \ | 319 #define ALL_INTRINSICS_LIST(V) \ |
308 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ | 320 ALL_INTRINSICS_NO_INTEGER_LIB_LIST(V) \ |
309 CORE_INTEGER_LIB_INTRINSIC_LIST(V) | 321 CORE_INTEGER_LIB_INTRINSIC_LIST(V) |
310 | 322 |
311 #define RECOGNIZED_LIST(V) \ | 323 #define RECOGNIZED_LIST(V) \ |
312 OTHER_RECOGNIZED_LIST(V) \ | 324 OTHER_RECOGNIZED_LIST(V) \ |
313 ALL_INTRINSICS_LIST(V) \ | 325 ALL_INTRINSICS_LIST(V) \ |
314 GRAPH_INTRINSICS_LIST(V) | 326 GRAPH_INTRINSICS_LIST(V) |
315 | 327 |
316 // A list of core function that should always be inlined. | 328 // A list of core function that should always be inlined. |
317 #define INLINE_WHITE_LIST(V) \ | 329 #define INLINE_WHITE_LIST(V) \ |
318 V(Object, ==, ObjectEquals, 1068471689) \ | 330 V(Object, ==, ObjectEquals, 1068471689) \ |
319 V(_List, get:length, ObjectArrayLength, 1181352729) \ | 331 V(_List, get:length, ObjectArrayLength, 1181352729) \ |
320 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ | 332 V(_ImmutableList, get:length, ImmutableArrayLength, 274917727) \ |
321 V(_TypedList, get:length, TypedDataLength, 522565357) \ | 333 V(_TypedList, get:length, TypedDataLength, 522565357) \ |
322 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ | 334 V(_GrowableList, get:length, GrowableArrayLength, 778505107) \ |
323 V(_StringBase, get:length, StringBaseLength, 784399628) \ | 335 V(_StringBase, get:length, StringBaseLength, 784399628) \ |
| 336 V(_GrowableList, add, GrowableListAdd, 1899133961) \ |
| 337 V(_GrowableList, removeLast, GrowableListRemoveLast, 1274907639) \ |
324 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ | 338 V(ListIterator, moveNext, ListIteratorMoveNext, 210829138) \ |
325 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \ | 339 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 1147271335) \ |
326 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \ | 340 V(_GrowableList, get:iterator, GrowableArrayIterator, 1812933946) \ |
327 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \ | 341 V(_GrowableList, forEach, GrowableArrayForEach, 2085943947) \ |
328 V(_List, ., ObjectArrayAllocate, 1595327584) \ | 342 V(_List, ., ObjectArrayAllocate, 1595327584) \ |
329 V(_List, [], ObjectArrayGetIndexed, 795612476) \ | 343 V(_List, [], ObjectArrayGetIndexed, 795612476) \ |
330 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ | 344 V(_List, []=, ObjectArraySetIndexed, 1288827575) \ |
331 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \ | 345 V(_List, get:isEmpty, ObjectArrayIsEmpty, 2130247737) \ |
332 V(_List, get:iterator, ObjectArrayIterator, 458612415) \ | 346 V(_List, get:iterator, ObjectArrayIterator, 458612415) \ |
333 V(_List, forEach, ObjectArrayForEach, 592525445) \ | 347 V(_List, forEach, ObjectArrayForEach, 592525445) \ |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 static Kind RecognizeKind(const Function& function); | 436 static Kind RecognizeKind(const Function& function); |
423 static bool AlwaysInline(const Function& function); | 437 static bool AlwaysInline(const Function& function); |
424 static bool PolymorphicTarget(const Function& function); | 438 static bool PolymorphicTarget(const Function& function); |
425 static const char* KindToCString(Kind kind); | 439 static const char* KindToCString(Kind kind); |
426 static void InitializeState(); | 440 static void InitializeState(); |
427 }; | 441 }; |
428 | 442 |
429 } // namespace dart | 443 } // namespace dart |
430 | 444 |
431 #endif // VM_METHOD_RECOGNIZER_H_ | 445 #endif // VM_METHOD_RECOGNIZER_H_ |
OLD | NEW |