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 4695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4706 inline static FreeSpace* cast(HeapObject* obj); | 4706 inline static FreeSpace* cast(HeapObject* obj); |
4707 | 4707 |
4708 // Dispatched behavior. | 4708 // Dispatched behavior. |
4709 DECLARE_PRINTER(FreeSpace) | 4709 DECLARE_PRINTER(FreeSpace) |
4710 DECLARE_VERIFIER(FreeSpace) | 4710 DECLARE_VERIFIER(FreeSpace) |
4711 | 4711 |
4712 // Layout description. | 4712 // Layout description. |
4713 // Size is smi tagged when it is stored. | 4713 // Size is smi tagged when it is stored. |
4714 static const int kSizeOffset = HeapObject::kHeaderSize; | 4714 static const int kSizeOffset = HeapObject::kHeaderSize; |
4715 static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize); | 4715 static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize); |
4716 static const int kSize = kNextOffset + kPointerSize; | |
4717 | 4716 |
4718 private: | 4717 private: |
4719 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); | 4718 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); |
4720 }; | 4719 }; |
4721 | 4720 |
4722 | 4721 |
4723 // V has parameters (Type, type, TYPE, C type, element_size) | 4722 // V has parameters (Type, type, TYPE, C type, element_size) |
4724 #define TYPED_ARRAYS(V) \ | 4723 #define TYPED_ARRAYS(V) \ |
4725 V(Uint8, uint8, UINT8, uint8_t, 1) \ | 4724 V(Uint8, uint8, UINT8, uint8_t, 1) \ |
4726 V(Int8, int8, INT8, int8_t, 1) \ | 4725 V(Int8, int8, INT8, int8_t, 1) \ |
(...skipping 5745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10472 DECLARE_PRINTER(JSArray) | 10471 DECLARE_PRINTER(JSArray) |
10473 DECLARE_VERIFIER(JSArray) | 10472 DECLARE_VERIFIER(JSArray) |
10474 | 10473 |
10475 // Number of element slots to pre-allocate for an empty array. | 10474 // Number of element slots to pre-allocate for an empty array. |
10476 static const int kPreallocatedArrayElements = 4; | 10475 static const int kPreallocatedArrayElements = 4; |
10477 | 10476 |
10478 // Layout description. | 10477 // Layout description. |
10479 static const int kLengthOffset = JSObject::kHeaderSize; | 10478 static const int kLengthOffset = JSObject::kHeaderSize; |
10480 static const int kSize = kLengthOffset + kPointerSize; | 10479 static const int kSize = kLengthOffset + kPointerSize; |
10481 | 10480 |
10482 // 300 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which | 10481 // 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which |
10483 // we do not want to include in objects.h | 10482 // we do not want to include in objects.h |
10484 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with | 10483 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with |
10485 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. | 10484 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. |
10486 static const int kInitialMaxFastElementArray = | 10485 static const int kInitialMaxFastElementArray = |
10487 (300 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / | 10486 (600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / |
10488 kPointerSize; | 10487 kPointerSize; |
10489 | 10488 |
10490 private: | 10489 private: |
10491 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10490 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10492 }; | 10491 }; |
10493 | 10492 |
10494 | 10493 |
10495 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10494 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10496 Handle<Map> initial_map); | 10495 Handle<Map> initial_map); |
10497 | 10496 |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11098 } | 11097 } |
11099 return value; | 11098 return value; |
11100 } | 11099 } |
11101 }; | 11100 }; |
11102 | 11101 |
11103 | 11102 |
11104 } // NOLINT, false-positive due to second-order macros. | 11103 } // NOLINT, false-positive due to second-order macros. |
11105 } // NOLINT, false-positive due to second-order macros. | 11104 } // NOLINT, false-positive due to second-order macros. |
11106 | 11105 |
11107 #endif // V8_OBJECTS_H_ | 11106 #endif // V8_OBJECTS_H_ |
OLD | NEW |