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