| 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 static bool PolymorphicTarget(const Function& function); | 534 static bool PolymorphicTarget(const Function& function); |
| 535 static intptr_t ResultCid(const Function& function); | 535 static intptr_t ResultCid(const Function& function); |
| 536 static intptr_t MethodKindToReceiverCid(Kind kind); | 536 static intptr_t MethodKindToReceiverCid(Kind kind); |
| 537 static const char* KindToCString(Kind kind); | 537 static const char* KindToCString(Kind kind); |
| 538 | 538 |
| 539 #if !defined(DART_PRECOMPILED_RUNTIME) | 539 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 540 static void InitializeState(); | 540 static void InitializeState(); |
| 541 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 541 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 542 }; | 542 }; |
| 543 | 543 |
| 544 | |
| 545 #if !defined(DART_PRECOMPILED_RUNTIME) | 544 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 546 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ | 545 #define CHECK_FINGERPRINT2(f, p0, p1, fp) \ |
| 547 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) | 546 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1, fp)) |
| 548 | 547 |
| 549 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ | 548 #define CHECK_FINGERPRINT3(f, p0, p1, p2, fp) \ |
| 550 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) | 549 ASSERT(f.CheckSourceFingerprint(#p0 ", " #p1 ", " #p2, fp)) |
| 551 #endif // !defined(DART_PRECOMPILED_RUNTIME) | 550 #endif // !defined(DART_PRECOMPILED_RUNTIME) |
| 552 | 551 |
| 553 | |
| 554 // clang-format off | 552 // clang-format off |
| 555 // List of recognized list factories: | 553 // List of recognized list factories: |
| 556 // (factory-name-symbol, class-name-string, constructor-name-string, | 554 // (factory-name-symbol, class-name-string, constructor-name-string, |
| 557 // result-cid, fingerprint). | 555 // result-cid, fingerprint). |
| 558 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ | 556 #define RECOGNIZED_LIST_FACTORY_LIST(V) \ |
| 559 V(_ListFactory, _List, ., kArrayCid, 0x6c3b54ee) \ | 557 V(_ListFactory, _List, ., kArrayCid, 0x6c3b54ee) \ |
| 560 V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \ | 558 V(_GrowableListWithData, _GrowableList, .withData, kGrowableObjectArrayCid, \ |
| 561 0x3468a26f) \ | 559 0x3468a26f) \ |
| 562 V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \ | 560 V(_GrowableListFactory, _GrowableList, ., kGrowableObjectArrayCid, \ |
| 563 0x7c4346ab) \ | 561 0x7c4346ab) \ |
| (...skipping 19 matching lines...) Expand all Loading... |
| 583 // Class that recognizes factories and returns corresponding result cid. | 581 // Class that recognizes factories and returns corresponding result cid. |
| 584 class FactoryRecognizer : public AllStatic { | 582 class FactoryRecognizer : public AllStatic { |
| 585 public: | 583 public: |
| 586 // Return kDynamicCid if factory is not recognized. | 584 // Return kDynamicCid if factory is not recognized. |
| 587 static intptr_t ResultCid(const Function& factory); | 585 static intptr_t ResultCid(const Function& factory); |
| 588 }; | 586 }; |
| 589 | 587 |
| 590 } // namespace dart | 588 } // namespace dart |
| 591 | 589 |
| 592 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ | 590 #endif // RUNTIME_VM_METHOD_RECOGNIZER_H_ |
| OLD | NEW |