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