Chromium Code Reviews| 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 4694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4705 inline static FreeSpace* cast(HeapObject* obj); | 4705 inline static FreeSpace* cast(HeapObject* obj); |
| 4706 | 4706 |
| 4707 // Dispatched behavior. | 4707 // Dispatched behavior. |
| 4708 DECLARE_PRINTER(FreeSpace) | 4708 DECLARE_PRINTER(FreeSpace) |
| 4709 DECLARE_VERIFIER(FreeSpace) | 4709 DECLARE_VERIFIER(FreeSpace) |
| 4710 | 4710 |
| 4711 // Layout description. | 4711 // Layout description. |
| 4712 // Size is smi tagged when it is stored. | 4712 // Size is smi tagged when it is stored. |
| 4713 static const int kSizeOffset = HeapObject::kHeaderSize; | 4713 static const int kSizeOffset = HeapObject::kHeaderSize; |
| 4714 static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize); | 4714 static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize); |
| 4715 static const int kSize = kNextOffset + kPointerSize; | |
| 4715 | 4716 |
| 4716 private: | 4717 private: |
| 4717 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); | 4718 DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); |
| 4718 }; | 4719 }; |
| 4719 | 4720 |
| 4720 | 4721 |
| 4721 // V has parameters (Type, type, TYPE, C type, element_size) | 4722 // V has parameters (Type, type, TYPE, C type, element_size) |
| 4722 #define TYPED_ARRAYS(V) \ | 4723 #define TYPED_ARRAYS(V) \ |
| 4723 V(Uint8, uint8, UINT8, uint8_t, 1) \ | 4724 V(Uint8, uint8, UINT8, uint8_t, 1) \ |
| 4724 V(Int8, int8, INT8, int8_t, 1) \ | 4725 V(Int8, int8, INT8, int8_t, 1) \ |
| (...skipping 5734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10459 DECLARE_PRINTER(JSArray) | 10460 DECLARE_PRINTER(JSArray) |
| 10460 DECLARE_VERIFIER(JSArray) | 10461 DECLARE_VERIFIER(JSArray) |
| 10461 | 10462 |
| 10462 // Number of element slots to pre-allocate for an empty array. | 10463 // Number of element slots to pre-allocate for an empty array. |
| 10463 static const int kPreallocatedArrayElements = 4; | 10464 static const int kPreallocatedArrayElements = 4; |
| 10464 | 10465 |
| 10465 // Layout description. | 10466 // Layout description. |
| 10466 static const int kLengthOffset = JSObject::kHeaderSize; | 10467 static const int kLengthOffset = JSObject::kHeaderSize; |
| 10467 static const int kSize = kLengthOffset + kPointerSize; | 10468 static const int kSize = kLengthOffset + kPointerSize; |
| 10468 | 10469 |
| 10469 // 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which | 10470 // 400 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which |
|
Hannes Payer (out of office)
2016/08/10 21:17:35
Why not 300?
Michael Lippautz
2016/08/11 09:48:11
Crankshaft (and esp hydrogen stubs) don't check fo
| |
| 10470 // we do not want to include in objects.h | 10471 // we do not want to include in objects.h |
| 10471 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with | 10472 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with |
| 10472 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. | 10473 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. |
| 10473 static const int kInitialMaxFastElementArray = | 10474 static const int kInitialMaxFastElementArray = |
| 10474 (600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / | 10475 (400 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / |
| 10475 kPointerSize; | 10476 kPointerSize; |
| 10476 | 10477 |
| 10477 private: | 10478 private: |
| 10478 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10479 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
| 10479 }; | 10480 }; |
| 10480 | 10481 |
| 10481 | 10482 |
| 10482 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10483 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
| 10483 Handle<Map> initial_map); | 10484 Handle<Map> initial_map); |
| 10484 | 10485 |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11073 } | 11074 } |
| 11074 return value; | 11075 return value; |
| 11075 } | 11076 } |
| 11076 }; | 11077 }; |
| 11077 | 11078 |
| 11078 | 11079 |
| 11079 } // NOLINT, false-positive due to second-order macros. | 11080 } // NOLINT, false-positive due to second-order macros. |
| 11080 } // NOLINT, false-positive due to second-order macros. | 11081 } // NOLINT, false-positive due to second-order macros. |
| 11081 | 11082 |
| 11082 #endif // V8_OBJECTS_H_ | 11083 #endif // V8_OBJECTS_H_ |
| OLD | NEW |