OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 4840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4851 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; | 4851 static const int kParameterSizeOffset = kFrameSizeOffset + kIntSize; |
4852 static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize; | 4852 static const int kInterruptBudgetOffset = kParameterSizeOffset + kIntSize; |
4853 static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize; | 4853 static const int kOSRNestingLevelOffset = kInterruptBudgetOffset + kIntSize; |
4854 static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize; | 4854 static const int kHeaderSize = kOSRNestingLevelOffset + kCharSize; |
4855 | 4855 |
4856 // Maximal memory consumption for a single BytecodeArray. | 4856 // Maximal memory consumption for a single BytecodeArray. |
4857 static const int kMaxSize = 512 * MB; | 4857 static const int kMaxSize = 512 * MB; |
4858 // Maximal length of a single BytecodeArray. | 4858 // Maximal length of a single BytecodeArray. |
4859 static const int kMaxLength = kMaxSize - kHeaderSize; | 4859 static const int kMaxLength = kMaxSize - kHeaderSize; |
4860 | 4860 |
| 4861 static const int kPointerFieldsBeginOffset = kConstantPoolOffset; |
| 4862 static const int kPointerFieldsEndOffset = kFrameSizeOffset; |
| 4863 |
| 4864 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
| 4865 kPointerFieldsEndOffset, kHeaderSize> |
| 4866 MarkingBodyDescriptor; |
| 4867 |
4861 class BodyDescriptor; | 4868 class BodyDescriptor; |
4862 | 4869 |
4863 private: | 4870 private: |
4864 DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeArray); | 4871 DISALLOW_IMPLICIT_CONSTRUCTORS(BytecodeArray); |
4865 }; | 4872 }; |
4866 | 4873 |
4867 | 4874 |
4868 // FreeSpace are fixed-size free memory blocks used by the heap and GC. | 4875 // FreeSpace are fixed-size free memory blocks used by the heap and GC. |
4869 // They look like heap objects (are heap object tagged and have a map) so that | 4876 // They look like heap objects (are heap object tagged and have a map) so that |
4870 // the heap remains iterable. They have a size and a next pointer. | 4877 // the heap remains iterable. They have a size and a next pointer. |
(...skipping 4039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8910 static const int kDependentCodeOffset = | 8917 static const int kDependentCodeOffset = |
8911 kPretenureCreateCountOffset + kPointerSize; | 8918 kPretenureCreateCountOffset + kPointerSize; |
8912 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; | 8919 static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize; |
8913 static const int kSize = kWeakNextOffset + kPointerSize; | 8920 static const int kSize = kWeakNextOffset + kPointerSize; |
8914 | 8921 |
8915 // During mark compact we need to take special care for the dependent code | 8922 // During mark compact we need to take special care for the dependent code |
8916 // field. | 8923 // field. |
8917 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset; | 8924 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset; |
8918 static const int kPointerFieldsEndOffset = kWeakNextOffset; | 8925 static const int kPointerFieldsEndOffset = kWeakNextOffset; |
8919 | 8926 |
| 8927 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
| 8928 kPointerFieldsEndOffset, kSize> |
| 8929 MarkingBodyDescriptor; |
| 8930 |
8920 // For other visitors, use the fixed body descriptor below. | 8931 // For other visitors, use the fixed body descriptor below. |
8921 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, kSize, kSize> | 8932 typedef FixedBodyDescriptor<HeapObject::kHeaderSize, kSize, kSize> |
8922 BodyDescriptor; | 8933 BodyDescriptor; |
8923 | 8934 |
8924 private: | 8935 private: |
8925 inline bool PretenuringDecisionMade(); | 8936 inline bool PretenuringDecisionMade(); |
8926 | 8937 |
8927 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); | 8938 DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite); |
8928 }; | 8939 }; |
8929 | 8940 |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10160 // Dispatched behavior. | 10171 // Dispatched behavior. |
10161 DECLARE_PRINTER(PropertyCell) | 10172 DECLARE_PRINTER(PropertyCell) |
10162 DECLARE_VERIFIER(PropertyCell) | 10173 DECLARE_VERIFIER(PropertyCell) |
10163 | 10174 |
10164 // Layout description. | 10175 // Layout description. |
10165 static const int kDetailsOffset = HeapObject::kHeaderSize; | 10176 static const int kDetailsOffset = HeapObject::kHeaderSize; |
10166 static const int kValueOffset = kDetailsOffset + kPointerSize; | 10177 static const int kValueOffset = kDetailsOffset + kPointerSize; |
10167 static const int kDependentCodeOffset = kValueOffset + kPointerSize; | 10178 static const int kDependentCodeOffset = kValueOffset + kPointerSize; |
10168 static const int kSize = kDependentCodeOffset + kPointerSize; | 10179 static const int kSize = kDependentCodeOffset + kPointerSize; |
10169 | 10180 |
10170 static const int kPointerFieldsBeginOffset = kValueOffset; | |
10171 static const int kPointerFieldsEndOffset = kSize; | |
10172 | |
10173 typedef FixedBodyDescriptor<kValueOffset, | 10181 typedef FixedBodyDescriptor<kValueOffset, |
10174 kSize, | 10182 kSize, |
10175 kSize> BodyDescriptor; | 10183 kSize> BodyDescriptor; |
10176 | 10184 |
10177 private: | 10185 private: |
10178 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); | 10186 DISALLOW_IMPLICIT_CONSTRUCTORS(PropertyCell); |
10179 }; | 10187 }; |
10180 | 10188 |
10181 | 10189 |
10182 class WeakCell : public HeapObject { | 10190 class WeakCell : public HeapObject { |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11426 } | 11434 } |
11427 return value; | 11435 return value; |
11428 } | 11436 } |
11429 }; | 11437 }; |
11430 | 11438 |
11431 | 11439 |
11432 } // NOLINT, false-positive due to second-order macros. | 11440 } // NOLINT, false-positive due to second-order macros. |
11433 } // NOLINT, false-positive due to second-order macros. | 11441 } // NOLINT, false-positive due to second-order macros. |
11434 | 11442 |
11435 #endif // V8_OBJECTS_H_ | 11443 #endif // V8_OBJECTS_H_ |
OLD | NEW |