OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 10075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10086 DECLARE_PRINTER(JSArray) | 10086 DECLARE_PRINTER(JSArray) |
10087 DECLARE_VERIFIER(JSArray) | 10087 DECLARE_VERIFIER(JSArray) |
10088 | 10088 |
10089 // Number of element slots to pre-allocate for an empty array. | 10089 // Number of element slots to pre-allocate for an empty array. |
10090 static const int kPreallocatedArrayElements = 4; | 10090 static const int kPreallocatedArrayElements = 4; |
10091 | 10091 |
10092 // Layout description. | 10092 // Layout description. |
10093 static const int kLengthOffset = JSObject::kHeaderSize; | 10093 static const int kLengthOffset = JSObject::kHeaderSize; |
10094 static const int kSize = kLengthOffset + kPointerSize; | 10094 static const int kSize = kLengthOffset + kPointerSize; |
10095 | 10095 |
10096 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | 10096 // 600 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which |
10097 // permissible values (see the DCHECK in heap.cc). | 10097 // we do not want to include in objects.h |
10098 static const int kInitialMaxFastElementArray = 100000; | 10098 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with |
| 10099 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. |
| 10100 static const int kInitialMaxFastElementArray = |
| 10101 (600 * KB - FixedArray::kHeaderSize - kSize - AllocationMemento::kSize) / |
| 10102 kPointerSize; |
10099 | 10103 |
10100 private: | 10104 private: |
10101 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10105 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10102 }; | 10106 }; |
10103 | 10107 |
10104 | 10108 |
10105 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10109 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10106 Handle<Map> initial_map); | 10110 Handle<Map> initial_map); |
10107 | 10111 |
10108 | 10112 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10725 Handle<FixedArray> keys_; | 10729 Handle<FixedArray> keys_; |
10726 Handle<OrderedHashSet> set_; | 10730 Handle<OrderedHashSet> set_; |
10727 int length_; | 10731 int length_; |
10728 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10732 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
10729 }; | 10733 }; |
10730 | 10734 |
10731 } // NOLINT, false-positive due to second-order macros. | 10735 } // NOLINT, false-positive due to second-order macros. |
10732 } // NOLINT, false-positive due to second-order macros. | 10736 } // NOLINT, false-positive due to second-order macros. |
10733 | 10737 |
10734 #endif // V8_OBJECTS_H_ | 10738 #endif // V8_OBJECTS_H_ |
OLD | NEW |