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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 #if defined(DART_NO_SNAPSHOT) | 503 #if defined(DART_NO_SNAPSHOT) |
504 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ | 504 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ |
505 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) | 505 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) |
506 | 506 |
507 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ | 507 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ |
508 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) | 508 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) |
509 #endif // defined(DART_NO_SNAPSHOT). | 509 #endif // defined(DART_NO_SNAPSHOT). |
510 | 510 |
511 | 511 |
| 512 // List of recognized list factories: |
| 513 // (factory-name-symbol, result-cid, fingerprint). |
| 514 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ |
| 515 V(_ListFactory, kArrayCid, 850375012) \ |
| 516 V(_GrowableListWithData, kGrowableObjectArrayCid, 2094352700) \ |
| 517 V(_GrowableListFactory, kGrowableObjectArrayCid, 1518848600) \ |
| 518 V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 439914696) \ |
| 519 V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 1442599030) \ |
| 520 V(_Uint8ClampedArrayFactory, kTypedDataUint8ClampedArrayCid, 1320015159) \ |
| 521 V(_Int16ArrayFactory, kTypedDataInt16ArrayCid, 2132591678) \ |
| 522 V(_Uint16ArrayFactory, kTypedDataUint16ArrayCid, 1704816032) \ |
| 523 V(_Int32ArrayFactory, kTypedDataInt32ArrayCid, 1115045147) \ |
| 524 V(_Uint32ArrayFactory, kTypedDataUint32ArrayCid, 1385852190) \ |
| 525 V(_Int64ArrayFactory, kTypedDataInt64ArrayCid, 1193438555) \ |
| 526 V(_Uint64ArrayFactory, kTypedDataUint64ArrayCid, 410766246) \ |
| 527 V(_Float64ArrayFactory, kTypedDataFloat64ArrayCid, 1430631000) \ |
| 528 V(_Float32ArrayFactory, kTypedDataFloat32ArrayCid, 1194249144) \ |
| 529 V(_Float32x4ArrayFactory, kTypedDataFloat32x4ArrayCid, 158753569) \ |
| 530 |
| 531 |
| 532 // Class that recognizes factories and returns corresponding result cid. |
| 533 class FactoryRecognizer : public AllStatic { |
| 534 public: |
| 535 // Return kDynamicCid if factory is not recognized. |
| 536 static intptr_t ResultCid(const Function& factory); |
| 537 }; |
| 538 |
512 } // namespace dart | 539 } // namespace dart |
513 | 540 |
514 #endif // VM_METHOD_RECOGNIZER_H_ | 541 #endif // VM_METHOD_RECOGNIZER_H_ |
OLD | NEW |