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