| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 #undef DEFINE_ENUM_LIST | 508 #undef DEFINE_ENUM_LIST |
| 509 kNumRecognizedMethods | 509 kNumRecognizedMethods |
| 510 }; | 510 }; |
| 511 | 511 |
| 512 static Kind RecognizeKind(const Function& function); | 512 static Kind RecognizeKind(const Function& function); |
| 513 static bool AlwaysInline(const Function& function); | 513 static bool AlwaysInline(const Function& function); |
| 514 static bool PolymorphicTarget(const Function& function); | 514 static bool PolymorphicTarget(const Function& function); |
| 515 static intptr_t ResultCid(const Function& function); | 515 static intptr_t ResultCid(const Function& function); |
| 516 static intptr_t MethodKindToReceiverCid(Kind kind); | 516 static intptr_t MethodKindToReceiverCid(Kind kind); |
| 517 static const char* KindToCString(Kind kind); | 517 static const char* KindToCString(Kind kind); |
| 518 #if defined(DART_NO_SNAPSHOT) | |
| 519 static void InitializeState(); | 518 static void InitializeState(); |
| 520 #endif // defined(DART_NO_SNAPSHOT). | |
| 521 }; | 519 }; |
| 522 | 520 |
| 523 | 521 |
| 524 #if defined(DART_NO_SNAPSHOT) | |
| 525 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ | 522 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ |
| 526 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) | 523 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) |
| 527 | 524 |
| 528 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ | 525 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ |
| 529 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) | 526 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) |
| 530 #endif // defined(DART_NO_SNAPSHOT). | |
| 531 | 527 |
| 532 | 528 |
| 533 // List of recognized list factories: | 529 // List of recognized list factories: |
| 534 // (factory-name-symbol, result-cid, fingerprint). | 530 // (factory-name-symbol, result-cid, fingerprint). |
| 535 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ | 531 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ |
| 536 V(_ListFactory, kArrayCid, 0x63078b15) \ | 532 V(_ListFactory, kArrayCid, 0x63078b15) \ |
| 537 V(_GrowableListWithData, kGrowableObjectArrayCid, 0x25a786de) \ | 533 V(_GrowableListWithData, kGrowableObjectArrayCid, 0x25a786de) \ |
| 538 V(_GrowableListFactory, kGrowableObjectArrayCid, 0x4f4d4790) \ | 534 V(_GrowableListFactory, kGrowableObjectArrayCid, 0x4f4d4790) \ |
| 539 V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 0x2e7749e3) \ | 535 V(_Int8ArrayFactory, kTypedDataInt8ArrayCid, 0x2e7749e3) \ |
| 540 V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 0x6ab75439) \ | 536 V(_Uint8ArrayFactory, kTypedDataUint8ArrayCid, 0x6ab75439) \ |
| (...skipping 12 matching lines...) Expand all Loading... |
| 553 // Class that recognizes factories and returns corresponding result cid. | 549 // Class that recognizes factories and returns corresponding result cid. |
| 554 class FactoryRecognizer : public AllStatic { | 550 class FactoryRecognizer : public AllStatic { |
| 555 public: | 551 public: |
| 556 // Return kDynamicCid if factory is not recognized. | 552 // Return kDynamicCid if factory is not recognized. |
| 557 static intptr_t ResultCid(const Function& factory); | 553 static intptr_t ResultCid(const Function& factory); |
| 558 }; | 554 }; |
| 559 | 555 |
| 560 } // namespace dart | 556 } // namespace dart |
| 561 | 557 |
| 562 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ | 558 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ |
| OLD | NEW |