OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 kImplicitGetter, // represents an implicit getter for fields. | 603 kImplicitGetter, // represents an implicit getter for fields. |
604 kImplicitSetter, // represents an implicit setter for fields. | 604 kImplicitSetter, // represents an implicit setter for fields. |
605 kImplicitStaticFinalGetter, // represents an implicit getter for static | 605 kImplicitStaticFinalGetter, // represents an implicit getter for static |
606 // final fields (incl. static const fields). | 606 // final fields (incl. static const fields). |
607 kStaticInitializer, // used in implicit static getters. | 607 kStaticInitializer, // used in implicit static getters. |
608 kMethodExtractor, // converts method into implicit closure on the receiver. | 608 kMethodExtractor, // converts method into implicit closure on the receiver. |
609 kNoSuchMethodDispatcher, // invokes noSuchMethod. | 609 kNoSuchMethodDispatcher, // invokes noSuchMethod. |
610 kInvokeFieldDispatcher, // invokes a field as a closure. | 610 kInvokeFieldDispatcher, // invokes a field as a closure. |
611 }; | 611 }; |
612 | 612 |
613 enum Modifier { | |
hausner
2014/07/12 00:05:24
Maybe give this a more specific name, e.g. AsyncMo
Michael Lippautz (Google)
2014/07/14 20:22:48
Done.
| |
614 kNoModifier, | |
615 kAsync, | |
616 }; | |
617 | |
613 private: | 618 private: |
614 // So that the MarkingVisitor::DetachCode can null out the code fields. | 619 // So that the MarkingVisitor::DetachCode can null out the code fields. |
615 friend class MarkingVisitor; | 620 friend class MarkingVisitor; |
616 friend class Class; | 621 friend class Class; |
617 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); | 622 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); |
618 static bool SkipCode(RawFunction* raw_fun); | 623 static bool SkipCode(RawFunction* raw_fun); |
619 | 624 |
620 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 625 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
621 RawString* name_; | 626 RawString* name_; |
622 RawObject* owner_; // Class or patch class or mixin class | 627 RawObject* owner_; // Class or patch class or mixin class |
(...skipping 15 matching lines...) Expand all Loading... | |
638 RawObject** to() { | 643 RawObject** to() { |
639 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); | 644 return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_); |
640 } | 645 } |
641 | 646 |
642 int32_t token_pos_; | 647 int32_t token_pos_; |
643 int32_t end_token_pos_; | 648 int32_t end_token_pos_; |
644 int32_t usage_counter_; // Incremented while function is running. | 649 int32_t usage_counter_; // Incremented while function is running. |
645 int16_t num_fixed_parameters_; | 650 int16_t num_fixed_parameters_; |
646 int16_t num_optional_parameters_; // > 0: positional; < 0: named. | 651 int16_t num_optional_parameters_; // > 0: positional; < 0: named. |
647 int16_t deoptimization_counter_; | 652 int16_t deoptimization_counter_; |
648 uint16_t kind_tag_; // See Function::KindTagBits. | 653 uint32_t kind_tag_; // See Function::KindTagBits. |
649 uint16_t optimized_instruction_count_; | 654 uint16_t optimized_instruction_count_; |
650 uint16_t optimized_call_site_count_; | 655 uint16_t optimized_call_site_count_; |
651 }; | 656 }; |
652 | 657 |
653 | 658 |
654 class RawClosureData : public RawObject { | 659 class RawClosureData : public RawObject { |
655 private: | 660 private: |
656 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); | 661 RAW_HEAP_OBJECT_IMPLEMENTATION(ClosureData); |
657 | 662 |
658 RawObject** from() { | 663 RawObject** from() { |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1898 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); | 1903 COMPILE_ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 14); |
1899 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 1904 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
1900 kTypedDataInt8ArrayViewCid + 15); | 1905 kTypedDataInt8ArrayViewCid + 15); |
1901 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); | 1906 COMPILE_ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 14); |
1902 return (kNullCid - kTypedDataInt8ArrayCid); | 1907 return (kNullCid - kTypedDataInt8ArrayCid); |
1903 } | 1908 } |
1904 | 1909 |
1905 } // namespace dart | 1910 } // namespace dart |
1906 | 1911 |
1907 #endif // VM_RAW_OBJECT_H_ | 1912 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |