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 "allocation.h" | 8 #include "allocation.h" |
9 #include "assert-scope.h" | 9 #include "assert-scope.h" |
10 #include "builtins.h" | 10 #include "builtins.h" |
(...skipping 2617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2628 static const int kMaxUncheckedFastElementsLength = 5000; | 2628 static const int kMaxUncheckedFastElementsLength = 5000; |
2629 | 2629 |
2630 // Same as above but for old arrays. This limit is more strict. We | 2630 // Same as above but for old arrays. This limit is more strict. We |
2631 // don't want to be wasteful with long lived objects. | 2631 // don't want to be wasteful with long lived objects. |
2632 static const int kMaxUncheckedOldFastElementsLength = 500; | 2632 static const int kMaxUncheckedOldFastElementsLength = 500; |
2633 | 2633 |
2634 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | 2634 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
2635 // permissible values (see the ASSERT in heap.cc). | 2635 // permissible values (see the ASSERT in heap.cc). |
2636 static const int kInitialMaxFastElementArray = 100000; | 2636 static const int kInitialMaxFastElementArray = 100000; |
2637 | 2637 |
| 2638 // This constant applies only to the initial map of "$Object" aka |
| 2639 // "global.Object" and not to arbitrary other JSObject maps. |
| 2640 static const int kInitialGlobalObjectUnusedPropertiesCount = 4; |
| 2641 |
2638 static const int kFastPropertiesSoftLimit = 12; | 2642 static const int kFastPropertiesSoftLimit = 12; |
2639 static const int kMaxFastProperties = 128; | 2643 static const int kMaxFastProperties = 128; |
2640 static const int kMaxInstanceSize = 255 * kPointerSize; | 2644 static const int kMaxInstanceSize = 255 * kPointerSize; |
2641 // When extending the backing storage for property values, we increase | 2645 // When extending the backing storage for property values, we increase |
2642 // its size by more than the 1 entry necessary, so sequentially adding fields | 2646 // its size by more than the 1 entry necessary, so sequentially adding fields |
2643 // to the same object requires fewer allocations and copies. | 2647 // to the same object requires fewer allocations and copies. |
2644 static const int kFieldsAdded = 3; | 2648 static const int kFieldsAdded = 3; |
2645 | 2649 |
2646 // Layout description. | 2650 // Layout description. |
2647 static const int kPropertiesOffset = HeapObject::kHeaderSize; | 2651 static const int kPropertiesOffset = HeapObject::kHeaderSize; |
(...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6959 // [expected_nof_properties]: Expected number of properties for the function. | 6963 // [expected_nof_properties]: Expected number of properties for the function. |
6960 inline int expected_nof_properties(); | 6964 inline int expected_nof_properties(); |
6961 inline void set_expected_nof_properties(int value); | 6965 inline void set_expected_nof_properties(int value); |
6962 | 6966 |
6963 // [feedback_vector] - accumulates ast node feedback from full-codegen and | 6967 // [feedback_vector] - accumulates ast node feedback from full-codegen and |
6964 // (increasingly) from crankshafted code where sufficient feedback isn't | 6968 // (increasingly) from crankshafted code where sufficient feedback isn't |
6965 // available. Currently the field is duplicated in | 6969 // available. Currently the field is duplicated in |
6966 // TypeFeedbackInfo::feedback_vector, but the allocation is done here. | 6970 // TypeFeedbackInfo::feedback_vector, but the allocation is done here. |
6967 DECL_ACCESSORS(feedback_vector, FixedArray) | 6971 DECL_ACCESSORS(feedback_vector, FixedArray) |
6968 | 6972 |
6969 // Invoked before pointers in SharedFunctionInfo are being marked. | |
6970 // Also clears the optimized code map. | |
6971 inline void BeforeVisitingPointers(); | |
6972 | |
6973 // [instance class name]: class name for instances. | 6973 // [instance class name]: class name for instances. |
6974 DECL_ACCESSORS(instance_class_name, Object) | 6974 DECL_ACCESSORS(instance_class_name, Object) |
6975 | 6975 |
6976 // [function data]: This field holds some additional data for function. | 6976 // [function data]: This field holds some additional data for function. |
6977 // Currently it either has FunctionTemplateInfo to make benefit the API | 6977 // Currently it either has FunctionTemplateInfo to make benefit the API |
6978 // or Smi identifying a builtin function. | 6978 // or Smi identifying a builtin function. |
6979 // In the long run we don't want all functions to have this field but | 6979 // In the long run we don't want all functions to have this field but |
6980 // we can fix that when we have a better model for storing hidden data | 6980 // we can fix that when we have a better model for storing hidden data |
6981 // on objects. | 6981 // on objects. |
6982 DECL_ACCESSORS(function_data, Object) | 6982 DECL_ACCESSORS(function_data, Object) |
(...skipping 4086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11069 } else { | 11069 } else { |
11070 value &= ~(1 << bit_position); | 11070 value &= ~(1 << bit_position); |
11071 } | 11071 } |
11072 return value; | 11072 return value; |
11073 } | 11073 } |
11074 }; | 11074 }; |
11075 | 11075 |
11076 } } // namespace v8::internal | 11076 } } // namespace v8::internal |
11077 | 11077 |
11078 #endif // V8_OBJECTS_H_ | 11078 #endif // V8_OBJECTS_H_ |
OLD | NEW |