| 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 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2352 static const uint32_t kMaxGap = 1024; | 2352 static const uint32_t kMaxGap = 1024; |
| 2353 | 2353 |
| 2354 // Maximal length of fast elements array that won't be checked for | 2354 // Maximal length of fast elements array that won't be checked for |
| 2355 // being dense enough on expansion. | 2355 // being dense enough on expansion. |
| 2356 static const int kMaxUncheckedFastElementsLength = 5000; | 2356 static const int kMaxUncheckedFastElementsLength = 5000; |
| 2357 | 2357 |
| 2358 // Same as above but for old arrays. This limit is more strict. We | 2358 // Same as above but for old arrays. This limit is more strict. We |
| 2359 // don't want to be wasteful with long lived objects. | 2359 // don't want to be wasteful with long lived objects. |
| 2360 static const int kMaxUncheckedOldFastElementsLength = 500; | 2360 static const int kMaxUncheckedOldFastElementsLength = 500; |
| 2361 | 2361 |
| 2362 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | |
| 2363 // permissible values (see the DCHECK in heap.cc). | |
| 2364 static const int kInitialMaxFastElementArray = 100000; | |
| 2365 | |
| 2366 // This constant applies only to the initial map of "global.Object" and | 2362 // This constant applies only to the initial map of "global.Object" and |
| 2367 // not to arbitrary other JSObject maps. | 2363 // not to arbitrary other JSObject maps. |
| 2368 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; | 2364 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; |
| 2369 | 2365 |
| 2370 static const int kMaxInstanceSize = 255 * kPointerSize; | 2366 static const int kMaxInstanceSize = 255 * kPointerSize; |
| 2371 // When extending the backing storage for property values, we increase | 2367 // When extending the backing storage for property values, we increase |
| 2372 // its size by more than the 1 entry necessary, so sequentially adding fields | 2368 // its size by more than the 1 entry necessary, so sequentially adding fields |
| 2373 // to the same object requires fewer allocations and copies. | 2369 // to the same object requires fewer allocations and copies. |
| 2374 static const int kFieldsAdded = 3; | 2370 static const int kFieldsAdded = 3; |
| 2375 | 2371 |
| (...skipping 7611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9987 DECLARE_PRINTER(JSArray) | 9983 DECLARE_PRINTER(JSArray) |
| 9988 DECLARE_VERIFIER(JSArray) | 9984 DECLARE_VERIFIER(JSArray) |
| 9989 | 9985 |
| 9990 // Number of element slots to pre-allocate for an empty array. | 9986 // Number of element slots to pre-allocate for an empty array. |
| 9991 static const int kPreallocatedArrayElements = 4; | 9987 static const int kPreallocatedArrayElements = 4; |
| 9992 | 9988 |
| 9993 // Layout description. | 9989 // Layout description. |
| 9994 static const int kLengthOffset = JSObject::kHeaderSize; | 9990 static const int kLengthOffset = JSObject::kHeaderSize; |
| 9995 static const int kSize = kLengthOffset + kPointerSize; | 9991 static const int kSize = kLengthOffset + kPointerSize; |
| 9996 | 9992 |
| 9993 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
| 9994 // permissible values (see the DCHECK in heap.cc). |
| 9995 static const int kInitialMaxFastElementArray = 100000; |
| 9996 |
| 9997 private: | 9997 private: |
| 9998 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); | 9998 DISALLOW_IMPLICIT_CONSTRUCTORS(JSArray); |
| 9999 }; | 9999 }; |
| 10000 | 10000 |
| 10001 | 10001 |
| 10002 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, | 10002 Handle<Object> CacheInitialJSArrayMaps(Handle<Context> native_context, |
| 10003 Handle<Map> initial_map); | 10003 Handle<Map> initial_map); |
| 10004 | 10004 |
| 10005 | 10005 |
| 10006 // JSRegExpResult is just a JSArray with a specific initial map. | 10006 // JSRegExpResult is just a JSArray with a specific initial map. |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10620 | 10620 |
| 10621 Isolate* isolate_; | 10621 Isolate* isolate_; |
| 10622 Handle<FixedArray> keys_; | 10622 Handle<FixedArray> keys_; |
| 10623 Handle<OrderedHashSet> set_; | 10623 Handle<OrderedHashSet> set_; |
| 10624 int length_; | 10624 int length_; |
| 10625 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); | 10625 DISALLOW_COPY_AND_ASSIGN(KeyAccumulator); |
| 10626 }; | 10626 }; |
| 10627 } } // namespace v8::internal | 10627 } } // namespace v8::internal |
| 10628 | 10628 |
| 10629 #endif // V8_OBJECTS_H_ | 10629 #endif // V8_OBJECTS_H_ |
| OLD | NEW |