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 RUNTIME_VM_METHOD_RECOGNIZER_H_ | 5 #ifndef RUNTIME_VM_METHOD_RECOGNIZER_H_ |
6 #define RUNTIME_VM_METHOD_RECOGNIZER_H_ | 6 #define RUNTIME_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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 V(_Double, *, Double_mul, Double, 0x66c66e3d) \ | 161 V(_Double, *, Double_mul, Double, 0x66c66e3d) \ |
162 V(_Double, /, Double_div, Double, 0x034b9f08) \ | 162 V(_Double, /, Double_div, Double, 0x034b9f08) \ |
163 V(_Double, get:isNaN, Double_getIsNaN, Bool, 0x0af9604a) \ | 163 V(_Double, get:isNaN, Double_getIsNaN, Bool, 0x0af9604a) \ |
164 V(_Double, get:isInfinite, Double_getIsInfinite, Bool, 0x0f7a56e8) \ | 164 V(_Double, get:isInfinite, Double_getIsInfinite, Bool, 0x0f7a56e8) \ |
165 V(_Double, get:isNegative, Double_getIsNegative, Bool, 0x3a597395) \ | 165 V(_Double, get:isNegative, Double_getIsNegative, Bool, 0x3a597395) \ |
166 V(_Double, _mulFromInteger, Double_mulFromInteger, Double, 0x4fb72915) \ | 166 V(_Double, _mulFromInteger, Double_mulFromInteger, Double, 0x4fb72915) \ |
167 V(_Double, .fromInteger, DoubleFromInteger, Double, 0x78d9de2c) \ | 167 V(_Double, .fromInteger, DoubleFromInteger, Double, 0x78d9de2c) \ |
168 V(_List, []=, ObjectArraySetIndexed, Dynamic, 0x51691f4c) \ | 168 V(_List, []=, ObjectArraySetIndexed, Dynamic, 0x51691f4c) \ |
169 V(_GrowableList, .withData, GrowableArray_Allocate, GrowableObjectArray, \ | 169 V(_GrowableList, .withData, GrowableArray_Allocate, GrowableObjectArray, \ |
170 0x3468a26f) \ | 170 0x3468a26f) \ |
171 V(_GrowableList, add, GrowableArray_add, Dynamic, 0x19eaa9aa) \ | 171 V(_GrowableList, add, GrowableArray_add, Dynamic, 0x1ce3b4f8) \ |
172 V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, Dynamic, 0x380184b1) \ | 172 V(_RegExp, _ExecuteMatch, RegExp_ExecuteMatch, Dynamic, 0x380184b1) \ |
173 V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, Dynamic, \ | 173 V(_RegExp, _ExecuteMatchSticky, RegExp_ExecuteMatchSticky, Dynamic, \ |
174 0x79b8f955) \ | 174 0x79b8f955) \ |
175 V(Object, ==, ObjectEquals, Bool, 0x464c6a19) \ | 175 V(Object, ==, ObjectEquals, Bool, 0x464c6a19) \ |
176 V(Object, get:runtimeType, ObjectRuntimeType, Type, 0x00e836ca) \ | 176 V(Object, get:runtimeType, ObjectRuntimeType, Type, 0x00e836ca) \ |
177 V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, Bool, 0x597b967a) \ | 177 V(Object, _haveSameRuntimeType, ObjectHaveSameRuntimeType, Bool, 0x597b967a) \ |
178 V(_StringBase, get:hashCode, String_getHashCode, Smi, 0x78c35fe7) \ | 178 V(_StringBase, get:hashCode, String_getHashCode, Smi, 0x78c35fe7) \ |
179 V(_StringBase, get:isEmpty, StringBaseIsEmpty, Bool, 0x1fa6a4c9) \ | 179 V(_StringBase, get:isEmpty, StringBaseIsEmpty, Bool, 0x1fa6a4c9) \ |
180 V(_StringBase, _substringMatches, StringBaseSubstringMatches, Bool, \ | 180 V(_StringBase, _substringMatches, StringBaseSubstringMatches, Bool, \ |
181 0x649cbeef) \ | 181 0x649cbeef) \ |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 GRAPH_INTRINSICS_LIST(V) | 371 GRAPH_INTRINSICS_LIST(V) |
372 | 372 |
373 // A list of core function that should always be inlined. | 373 // A list of core function that should always be inlined. |
374 #define INLINE_WHITE_LIST(V) \ | 374 #define INLINE_WHITE_LIST(V) \ |
375 V(Object, ==, ObjectEquals, 0x464c6a19) \ | 375 V(Object, ==, ObjectEquals, 0x464c6a19) \ |
376 V(_List, get:length, ObjectArrayLength, 0x2594af31) \ | 376 V(_List, get:length, ObjectArrayLength, 0x2594af31) \ |
377 V(_ImmutableList, get:length, ImmutableArrayLength, 0x2594af31) \ | 377 V(_ImmutableList, get:length, ImmutableArrayLength, 0x2594af31) \ |
378 V(_TypedList, get:length, TypedDataLength, 0x20915079) \ | 378 V(_TypedList, get:length, TypedDataLength, 0x20915079) \ |
379 V(_GrowableList, get:length, GrowableArrayLength, 0x18dd1255) \ | 379 V(_GrowableList, get:length, GrowableArrayLength, 0x18dd1255) \ |
380 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e044a01) \ | 380 V(_GrowableList, get:_capacity, GrowableArrayCapacity, 0x2e044a01) \ |
381 V(_GrowableList, add, GrowableListAdd, 0x19eaa9aa) \ | 381 V(_GrowableList, add, GrowableListAdd, 0x1ce3b4f8) \ |
382 V(_GrowableList, removeLast, GrowableListRemoveLast, 0x3daaaca4) \ | 382 V(_GrowableList, removeLast, GrowableListRemoveLast, 0x3daaaca4) \ |
383 V(_StringBase, get:length, StringBaseLength, 0x2a2c8f72) \ | 383 V(_StringBase, get:length, StringBaseLength, 0x2a2c8f72) \ |
384 V(ListIterator, moveNext, ListIteratorMoveNext, 0x7ead154d) \ | 384 V(ListIterator, moveNext, ListIteratorMoveNext, 0x7ead154d) \ |
385 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 0x4197892b) \ | 385 V(_FixedSizeArrayIterator, moveNext, FixedListIteratorMoveNext, 0x4197892b) \ |
386 V(_GrowableList, get:iterator, GrowableArrayIterator, 0x64c204d5) \ | 386 V(_GrowableList, get:iterator, GrowableArrayIterator, 0x64c204d5) \ |
387 V(_GrowableList, forEach, GrowableArrayForEach, 0x4cc8215b) \ | 387 V(_GrowableList, forEach, GrowableArrayForEach, 0x4cc8215b) \ |
388 V(_List, ., ObjectArrayAllocate, 0x6c3b54ee) \ | 388 V(_List, ., ObjectArrayAllocate, 0x6c3b54ee) \ |
389 V(ListMixin, get:isEmpty, ListMixinIsEmpty, 0x7a327465) \ | 389 V(ListMixin, get:isEmpty, ListMixinIsEmpty, 0x7a327465) \ |
390 V(_List, get:iterator, ObjectArrayIterator, 0x757431f3) \ | 390 V(_List, get:iterator, ObjectArrayIterator, 0x757431f3) \ |
391 V(_List, forEach, ObjectArrayForEach, 0x4dfea652) \ | 391 V(_List, forEach, ObjectArrayForEach, 0x4dfea652) \ |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 | 551 |
552 // clang-format off | 552 // clang-format off |
553 // List of recognized list factories: | 553 // List of recognized list factories: |
554 // (factory-name-symbol, class-name-string, constructor-name-string, | 554 // (factory-name-symbol, class-name-string, constructor-name-string, |
555 // result-cid, fingerprint). | 555 // result-cid, fingerprint). |
556 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ | 556 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ |
557 V(_ListFactory, _List, ., kArrayCid, 0x6c3b54ee) \ | 557 V(_ListFactory, _List, ., kArrayCid, 0x6c3b54ee) \ |
558 V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \ | 558 V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \ |
559 0x3468a26f) \ | 559 0x3468a26f) \ |
560 V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \ | 560 V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \ |
561 0x3bd724aa) \ | 561 0x7c4346ab) \ |
562 V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x165876c2) \ | 562 V(_Int8ArrayFactory, Int8List, ., kTypedDataInt8ArrayCid, 0x165876c2) \ |
563 V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x52988118) \ | 563 V(_Uint8ArrayFactory, Uint8List, ., kTypedDataUint8ArrayCid, 0x52988118) \ |
564 V(_Uint8ClampedArrayFactory, Uint8ClampedList, ., \ | 564 V(_Uint8ClampedArrayFactory, Uint8ClampedList, ., \ |
565 kTypedDataUint8ClampedArrayCid, 0x001256b6) \ | 565 kTypedDataUint8ClampedArrayCid, 0x001256b6) \ |
566 V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x7c9690c9) \ | 566 V(_Int16ArrayFactory, Int16List, ., kTypedDataInt16ArrayCid, 0x7c9690c9) \ |
567 V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x6f2698c3) \ | 567 V(_Uint16ArrayFactory, Uint16List, ., kTypedDataUint16ArrayCid, 0x6f2698c3) \ |
568 V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x43b5bf2f) \ | 568 V(_Int32ArrayFactory, Int32List, ., kTypedDataInt32ArrayCid, 0x43b5bf2f) \ |
569 V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0x243ae083) \ | 569 V(_Uint32ArrayFactory, Uint32List, ., kTypedDataUint32ArrayCid, 0x243ae083) \ |
570 V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x3fb987a6) \ | 570 V(_Int64ArrayFactory, Int64List, ., kTypedDataInt64ArrayCid, 0x3fb987a6) \ |
571 V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x13ea5ce3) \ | 571 V(_Uint64ArrayFactory, Uint64List, ., kTypedDataUint64ArrayCid, 0x13ea5ce3) \ |
572 V(_Float64ArrayFactory, Float64List, ., kTypedDataFloat64ArrayCid, \ | 572 V(_Float64ArrayFactory, Float64List, ., kTypedDataFloat64ArrayCid, \ |
573 0x37fd11d0) \ | 573 0x37fd11d0) \ |
574 V(_Float32ArrayFactory, Float32List, ., kTypedDataFloat32ArrayCid, \ | 574 V(_Float32ArrayFactory, Float32List, ., kTypedDataFloat32ArrayCid, \ |
575 0x5b6f3f2a) \ | 575 0x5b6f3f2a) \ |
576 V(_Float32x4ArrayFactory, Float32x4List, ., kTypedDataFloat32x4ArrayCid, \ | 576 V(_Float32x4ArrayFactory, Float32x4List, ., kTypedDataFloat32x4ArrayCid, \ |
577 0x625f03f7) | 577 0x625f03f7) |
578 | 578 |
579 // clang-format on | 579 // clang-format on |
580 | 580 |
581 // Class that recognizes factories and returns corresponding result cid. | 581 // Class that recognizes factories and returns corresponding result cid. |
582 class FactoryRecognizer : public AllStatic { | 582 class FactoryRecognizer : public AllStatic { |
583 public: | 583 public: |
584 // Return kDynamicCid if factory is not recognized. | 584 // Return kDynamicCid if factory is not recognized. |
585 static intptr_t ResultCid(const Function& factory); | 585 static intptr_t ResultCid(const Function& factory); |
586 }; | 586 }; |
587 | 587 |
588 } // namespace dart | 588 } // namespace dart |
589 | 589 |
590 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ | 590 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ |
OLD | NEW |