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 10566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10577 DECLARE_PRINTER(JSArray) | 10577 DECLARE_PRINTER(JSArray) |
10578 DECLARE_VERIFIER(JSArray) | 10578 DECLARE_VERIFIER(JSArray) |
10579 | 10579 |
10580 // Number of element slots to pre-allocate for an empty array. | 10580 // Number of element slots to pre-allocate for an empty array. |
10581 static const int kPreallocatedArrayElements = 4; | 10581 static const int kPreallocatedArrayElements = 4; |
10582 | 10582 |
10583 // Layout description. | 10583 // Layout description. |
10584 static const int kLengthOffset = JSObject::kHeaderSize; | 10584 static const int kLengthOffset = JSObject::kHeaderSize; |
10585 static const int kSize = kLengthOffset + kPointerSize; | 10585 static const int kSize = kLengthOffset + kPointerSize; |
10586 | 10586 |
10587 // 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which | 10587 // (512 * KB - 384) is the Page::kMaxRegularHeapObjectSize defined in spaces.h |
10588 // we do not want to include in objects.h | 10588 // which we do not want to include in objects.h |
10589 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with | 10589 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with |
10590 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. | 10590 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. |
10591 static const int kInitialMaxFastElementArray = | 10591 static const int kInitialMaxFastElementArray = |
10592 (600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / | 10592 (512 * KB - 384 - FixedArray::kHeaderSize - kSize - |
| 10593 AllocationMemento::kSize) / |
10593 kPointerSize; | 10594 kPointerSize; |
10594 | 10595 |
10595 private: | 10596 private: |
10596 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10597 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10597 }; | 10598 }; |
10598 | 10599 |
10599 | 10600 |
10600 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10601 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10601 Handle<Map> initial_map); | 10602 Handle<Map> initial_map); |
10602 | 10603 |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11200 } | 11201 } |
11201 return value; | 11202 return value; |
11202 } | 11203 } |
11203 }; | 11204 }; |
11204 | 11205 |
11205 | 11206 |
11206 } // NOLINT, false-positive due to second-order macros. | 11207 } // NOLINT, false-positive due to second-order macros. |
11207 } // NOLINT, false-positive due to second-order macros. | 11208 } // NOLINT, false-positive due to second-order macros. |
11208 | 11209 |
11209 #endif // V8_OBJECTS_H_ | 11210 #endif // V8_OBJECTS_H_ |
OLD | NEW |