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...) Expand 10 before | Expand all | Expand 10 after 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 // 128 * KB is the Page::kMaxRegularHeapObjectSize defined in spaces.h which | 10051 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
10052 // we do not want to include in objects.h | 10052 // permissible values (see the DCHECK in heap.cc). |
10053 // Note that Page::kMaxRegularHeapObjectSize has to be in sync with | 10053 static const int kInitialMaxFastElementArray = 100000; |
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; | |
10059 | 10054 |
10060 private: | 10055 private: |
10061 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 10056 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
10062 }; | 10057 }; |
10063 | 10058 |
10064 | 10059 |
10065 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10060 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
10066 Handle<Map> initial_map); | 10061 Handle<Map> initial_map); |
10067 | 10062 |
10068 | 10063 |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10685 Handle<FixedArray> keys_; | 10680 Handle<FixedArray> keys_; |
10686 Handle<OrderedHashSet> set_; | 10681 Handle<OrderedHashSet> set_; |
10687 int length_; | 10682 int length_; |
10688 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10683 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
10689 }; | 10684 }; |
10690 | 10685 |
10691 } // NOLINT, false-positive due to second-order macros. | 10686 } // NOLINT, false-positive due to second-order macros. |
10692 } // NOLINT, false-positive due to second-order macros. | 10687 } // NOLINT, false-positive due to second-order macros. |
10693 | 10688 |
10694 #endif // V8_OBJECTS_H_ | 10689 #endif // V8_OBJECTS_H_ |
OLD | NEW |