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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 friend class Object; | 576 friend class Object; |
577 friend class OneByteString; // StoreSmi | 577 friend class OneByteString; // StoreSmi |
578 friend class RawExternalTypedData; | 578 friend class RawExternalTypedData; |
579 friend class RawInstructions; | 579 friend class RawInstructions; |
580 friend class RawInstance; | 580 friend class RawInstance; |
581 friend class RawTypedData; | 581 friend class RawTypedData; |
582 friend class Scavenger; | 582 friend class Scavenger; |
583 friend class ScavengerVisitor; | 583 friend class ScavengerVisitor; |
584 friend class SizeExcludingClassVisitor; // GetClassId | 584 friend class SizeExcludingClassVisitor; // GetClassId |
585 friend class RetainingPathVisitor; // GetClassId | 585 friend class RetainingPathVisitor; // GetClassId |
| 586 friend class SkippedCodeFunctions; // StorePointer |
586 friend class SnapshotReader; | 587 friend class SnapshotReader; |
587 friend class SnapshotWriter; | 588 friend class SnapshotWriter; |
588 friend class String; | 589 friend class String; |
589 friend class TypedData; | 590 friend class TypedData; |
590 friend class TypedDataView; | 591 friend class TypedDataView; |
591 friend class WeakProperty; // StorePointer | 592 friend class WeakProperty; // StorePointer |
592 friend class Instance; // StorePointer | 593 friend class Instance; // StorePointer |
593 | 594 |
594 DISALLOW_ALLOCATION(); | 595 DISALLOW_ALLOCATION(); |
595 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 596 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
736 enum AsyncModifier { | 737 enum AsyncModifier { |
737 kNoModifier = 0x0, | 738 kNoModifier = 0x0, |
738 kAsyncBit = 0x1, | 739 kAsyncBit = 0x1, |
739 kGeneratorBit = 0x2, | 740 kGeneratorBit = 0x2, |
740 kAsync = kAsyncBit, | 741 kAsync = kAsyncBit, |
741 kSyncGen = kGeneratorBit, | 742 kSyncGen = kGeneratorBit, |
742 kAsyncGen = kAsyncBit | kGeneratorBit, | 743 kAsyncGen = kAsyncBit | kGeneratorBit, |
743 }; | 744 }; |
744 | 745 |
745 private: | 746 private: |
746 // So that the MarkingVisitor::DetachCode can null out the code fields. | 747 // So that the SkippedCodeFunctions::DetachCode can null out the code fields. |
747 friend class MarkingVisitor; | 748 friend class SkippedCodeFunctions; |
748 friend class Class; | 749 friend class Class; |
749 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); | 750 RAW_HEAP_OBJECT_IMPLEMENTATION(Function); |
750 static bool ShouldVisitCode(RawCode* raw_code); | 751 static bool ShouldVisitCode(RawCode* raw_code); |
751 static bool CheckUsageCounter(RawFunction* raw_fun); | 752 static bool CheckUsageCounter(RawFunction* raw_fun); |
752 | 753 |
753 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 754 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
754 RawString* name_; | 755 RawString* name_; |
755 RawObject* owner_; // Class or patch class or mixin class | 756 RawObject* owner_; // Class or patch class or mixin class |
756 // where this function is defined. | 757 // where this function is defined. |
757 RawAbstractType* result_type_; | 758 RawAbstractType* result_type_; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 int32_t entry_patch_pc_offset_; | 1020 int32_t entry_patch_pc_offset_; |
1020 int32_t patch_code_pc_offset_; | 1021 int32_t patch_code_pc_offset_; |
1021 int32_t lazy_deopt_pc_offset_; | 1022 int32_t lazy_deopt_pc_offset_; |
1022 | 1023 |
1023 // Variable length data follows here. | 1024 // Variable length data follows here. |
1024 int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); } | 1025 int32_t* data() { OPEN_ARRAY_START(int32_t, int32_t); } |
1025 const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); } | 1026 const int32_t* data() const { OPEN_ARRAY_START(int32_t, int32_t); } |
1026 | 1027 |
1027 friend class Function; | 1028 friend class Function; |
1028 friend class MarkingVisitor; | 1029 friend class MarkingVisitor; |
| 1030 friend class SkippedCodeFunctions; |
1029 friend class StackFrame; | 1031 friend class StackFrame; |
1030 }; | 1032 }; |
1031 | 1033 |
1032 | 1034 |
1033 class RawObjectPool : public RawObject { | 1035 class RawObjectPool : public RawObject { |
1034 RAW_HEAP_OBJECT_IMPLEMENTATION(ObjectPool); | 1036 RAW_HEAP_OBJECT_IMPLEMENTATION(ObjectPool); |
1035 | 1037 |
1036 intptr_t length_; | 1038 intptr_t length_; |
1037 RawTypedData* info_array_; | 1039 RawTypedData* info_array_; |
1038 | 1040 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // Private helper function used while visiting stack frames. The | 1072 // Private helper function used while visiting stack frames. The |
1071 // code which iterates over dart frames is also called during GC and | 1073 // code which iterates over dart frames is also called during GC and |
1072 // is not allowed to create handles. | 1074 // is not allowed to create handles. |
1073 static bool ContainsPC(RawObject* raw_obj, uword pc); | 1075 static bool ContainsPC(RawObject* raw_obj, uword pc); |
1074 | 1076 |
1075 friend class RawCode; | 1077 friend class RawCode; |
1076 friend class RawFunction; | 1078 friend class RawFunction; |
1077 friend class Code; | 1079 friend class Code; |
1078 friend class StackFrame; | 1080 friend class StackFrame; |
1079 friend class MarkingVisitor; | 1081 friend class MarkingVisitor; |
| 1082 friend class SkippedCodeFunctions; |
1080 friend class Function; | 1083 friend class Function; |
1081 }; | 1084 }; |
1082 | 1085 |
1083 | 1086 |
1084 class RawPcDescriptors : public RawObject { | 1087 class RawPcDescriptors : public RawObject { |
1085 public: | 1088 public: |
1086 enum Kind { | 1089 enum Kind { |
1087 kDeopt = 1, // Deoptimization continuation point. | 1090 kDeopt = 1, // Deoptimization continuation point. |
1088 kIcCall = kDeopt << 1, // IC call. | 1091 kIcCall = kDeopt << 1, // IC call. |
1089 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. | 1092 kUnoptStaticCall = kIcCall << 1, // Call to a known target via stub. |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2198 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2196 kTypedDataInt8ArrayViewCid + 15); | 2199 kTypedDataInt8ArrayViewCid + 15); |
2197 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2200 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2198 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2201 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2199 return (kNullCid - kTypedDataInt8ArrayCid); | 2202 return (kNullCid - kTypedDataInt8ArrayCid); |
2200 } | 2203 } |
2201 | 2204 |
2202 } // namespace dart | 2205 } // namespace dart |
2203 | 2206 |
2204 #endif // VM_RAW_OBJECT_H_ | 2207 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |