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