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/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 kAsync = kAsyncBit, | 714 kAsync = kAsyncBit, |
715 kSyncGen = kGeneratorBit, | 715 kSyncGen = kGeneratorBit, |
716 kAsyncGen = kAsyncBit | kGeneratorBit, | 716 kAsyncGen = kAsyncBit | kGeneratorBit, |
717 }; | 717 }; |
718 | 718 |
719 private: | 719 private: |
720 // So that the MarkingVisitor::DetachCode can null out the code fields. | 720 // So that the MarkingVisitor::DetachCode can null out the code fields. |
721 friend class MarkingVisitor; | 721 friend class MarkingVisitor; |
722 friend class Class; | 722 friend class Class; |
723 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); | 723 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); |
724 static bool SkipCode(RawFunction* raw_fun); | 724 static bool ShouldVisitCode(RawCode* raw_code); |
| 725 static bool CheckUsageCounter(RawFunction* raw_fun); |
725 | 726 |
726 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 727 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
727 RawString* name_; | 728 RawString* name_; |
728 RawObject* owner_; // Class or patch class or mixin class | 729 RawObject* owner_; // Class or patch class or mixin class |
729 // where this function is defined. | 730 // where this function is defined. |
730 RawAbstractType* result_type_; | 731 RawAbstractType* result_type_; |
731 RawArray* parameter_types_; | 732 RawArray* parameter_types_; |
732 RawArray* parameter_names_; | 733 RawArray* parameter_names_; |
733 RawObject* data_; // Additional data specific to the function kind. | 734 RawObject* data_; // Additional data specific to the function kind. |
734 RawObject** to_snapshot() { | 735 RawObject** to_snapshot() { |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1005 | 1006 |
1006 // Variable length data follows here. | 1007 // Variable length data follows here. |
1007 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } | 1008 uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); } |
1008 | 1009 |
1009 // Private helper function used while visiting stack frames. The | 1010 // Private helper function used while visiting stack frames. The |
1010 // code which iterates over dart frames is also called during GC and | 1011 // code which iterates over dart frames is also called during GC and |
1011 // is not allowed to create handles. | 1012 // is not allowed to create handles. |
1012 static bool ContainsPC(RawObject* raw_obj, uword pc); | 1013 static bool ContainsPC(RawObject* raw_obj, uword pc); |
1013 | 1014 |
1014 friend class RawCode; | 1015 friend class RawCode; |
| 1016 friend class RawFunction; |
1015 friend class Code; | 1017 friend class Code; |
1016 friend class StackFrame; | 1018 friend class StackFrame; |
1017 friend class MarkingVisitor; | 1019 friend class MarkingVisitor; |
1018 friend class Function; | 1020 friend class Function; |
1019 }; | 1021 }; |
1020 | 1022 |
1021 | 1023 |
1022 class RawPcDescriptors : public RawObject { | 1024 class RawPcDescriptors : public RawObject { |
1023 public: | 1025 public: |
1024 enum Kind { | 1026 enum Kind { |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2155 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2154 kTypedDataInt8ArrayViewCid + 15); | 2156 kTypedDataInt8ArrayViewCid + 15); |
2155 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2157 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2156 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2158 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2157 return (kNullCid - kTypedDataInt8ArrayCid); | 2159 return (kNullCid - kTypedDataInt8ArrayCid); |
2158 } | 2160 } |
2159 | 2161 |
2160 } // namespace dart | 2162 } // namespace dart |
2161 | 2163 |
2162 #endif // VM_RAW_OBJECT_H_ | 2164 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |