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 10030 matching lines...) Loading... |
10041 DECLARE_PRINTER(JSArray) | 10041 DECLARE_PRINTER(JSArray) |
10042 DECLARE_VERIFIER(JSArray) | 10042 DECLARE_VERIFIER(JSArray) |
10043 | 10043 |
10044 // Number of element slots to pre-allocate for an empty array. | 10044 // Number of element slots to pre-allocate for an empty array. |
10045 static const int kPreallocatedArrayElements = 4; | 10045 static const int kPreallocatedArrayElements = 4; |
10046 | 10046 |
10047 // Layout description. | 10047 // Layout description. |
10048 static const int kLengthOffset = JSObject::kHeaderSize; | 10048 static const int kLengthOffset = JSObject::kHeaderSize; |
10049 static const int kSize = kLengthOffset + kPointerSize; | 10049 static const int kSize = kLengthOffset + kPointerSize; |
10050 | 10050 |
10051 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | 10051 // 128 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which |
10052 // permissible values (see the DCHECK in heap.cc). | 10052 // we do not want to include in objects.h |
10053 static const int kInitialMaxFastElementArray = 100000; | 10053 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with |
| 10054 // kInitialMaxFastElementArray which is checked in a DCHECK in heap.cc. |
| 10055 static const int kInitialMaxFastElementArray = |
| 10056 (128 * KB * (i::kPointerSize / 4) - FixedArray::kHeaderSize - kSize - |
| 10057 AllocationMemento::kSize) / |
| 10058 kPointerSize; |
10054 | 10059 |
10055 private: | 10060 private: |
10056 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10061 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10057 }; | 10062 }; |
10058 | 10063 |
10059 | 10064 |
10060 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10065 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10061 Handle<Map> initial_map); | 10066 Handle<Map> initial_map); |
10062 | 10067 |
10063 | 10068 |
(...skipping 616 matching lines...) Loading... |
10680 Handle<FixedArray> keys_; | 10685 Handle<FixedArray> keys_; |
10681 Handle<OrderedHashSet> set_; | 10686 Handle<OrderedHashSet> set_; |
10682 int length_; | 10687 int length_; |
10683 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10688 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
10684 }; | 10689 }; |
10685 | 10690 |
10686 } // NOLINT, false-positive due to second-order macros. | 10691 } // NOLINT, false-positive due to second-order macros. |
10687 } // NOLINT, false-positive due to second-order macros. | 10692 } // NOLINT, false-positive due to second-order macros. |
10688 | 10693 |
10689 #endif // V8_OBJECTS_H_ | 10694 #endif // V8_OBJECTS_H_ |
OLD | NEW |