Chromium Code Reviews| 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 2611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2622 static const int kMaxUncheckedFastElementsLength = 5000; | 2622 static const int kMaxUncheckedFastElementsLength = 5000; |
| 2623 | 2623 |
| 2624 // Same as above but for old arrays. This limit is more strict. We | 2624 // Same as above but for old arrays. This limit is more strict. We |
| 2625 // don't want to be wasteful with long lived objects. | 2625 // don't want to be wasteful with long lived objects. |
| 2626 static const int kMaxUncheckedOldFastElementsLength = 500; | 2626 static const int kMaxUncheckedOldFastElementsLength = 500; |
| 2627 | 2627 |
| 2628 // Note that Page::kMaxRegularHeapObjectSize puts a limit on | 2628 // Note that Page::kMaxRegularHeapObjectSize puts a limit on |
| 2629 // permissible values (see the ASSERT in heap.cc). | 2629 // permissible values (see the ASSERT in heap.cc). |
| 2630 static const int kInitialMaxFastElementArray = 100000; | 2630 static const int kInitialMaxFastElementArray = 100000; |
| 2631 | 2631 |
| 2632 static const int kInitialUnusedPropertiesCount = 4; | |
|
Michael Starzinger
2014/05/22 10:37:49
nit: Can we have a short comment above this consta
| |
| 2632 static const int kFastPropertiesSoftLimit = 12; | 2633 static const int kFastPropertiesSoftLimit = 12; |
| 2633 static const int kMaxFastProperties = 128; | 2634 static const int kMaxFastProperties = 128; |
| 2634 static const int kMaxInstanceSize = 255 * kPointerSize; | 2635 static const int kMaxInstanceSize = 255 * kPointerSize; |
| 2635 // When extending the backing storage for property values, we increase | 2636 // When extending the backing storage for property values, we increase |
| 2636 // its size by more than the 1 entry necessary, so sequentially adding fields | 2637 // its size by more than the 1 entry necessary, so sequentially adding fields |
| 2637 // to the same object requires fewer allocations and copies. | 2638 // to the same object requires fewer allocations and copies. |
| 2638 static const int kFieldsAdded = 3; | 2639 static const int kFieldsAdded = 3; |
| 2639 | 2640 |
| 2640 // Layout description. | 2641 // Layout description. |
| 2641 static const int kPropertiesOffset = HeapObject::kHeaderSize; | 2642 static const int kPropertiesOffset = HeapObject::kHeaderSize; |
| (...skipping 4277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6919 // [expected_nof_properties]: Expected number of properties for the function. | 6920 // [expected_nof_properties]: Expected number of properties for the function. |
| 6920 inline int expected_nof_properties(); | 6921 inline int expected_nof_properties(); |
| 6921 inline void set_expected_nof_properties(int value); | 6922 inline void set_expected_nof_properties(int value); |
| 6922 | 6923 |
| 6923 // [feedback_vector] - accumulates ast node feedback from full-codegen and | 6924 // [feedback_vector] - accumulates ast node feedback from full-codegen and |
| 6924 // (increasingly) from crankshafted code where sufficient feedback isn't | 6925 // (increasingly) from crankshafted code where sufficient feedback isn't |
| 6925 // available. Currently the field is duplicated in | 6926 // available. Currently the field is duplicated in |
| 6926 // TypeFeedbackInfo::feedback_vector, but the allocation is done here. | 6927 // TypeFeedbackInfo::feedback_vector, but the allocation is done here. |
| 6927 DECL_ACCESSORS(feedback_vector, FixedArray) | 6928 DECL_ACCESSORS(feedback_vector, FixedArray) |
| 6928 | 6929 |
| 6929 // Invoked before pointers in SharedFunctionInfo are being marked. | |
| 6930 // Also clears the optimized code map. | |
| 6931 inline void BeforeVisitingPointers(); | |
| 6932 | |
| 6933 // [instance class name]: class name for instances. | 6930 // [instance class name]: class name for instances. |
| 6934 DECL_ACCESSORS(instance_class_name, Object) | 6931 DECL_ACCESSORS(instance_class_name, Object) |
| 6935 | 6932 |
| 6936 // [function data]: This field holds some additional data for function. | 6933 // [function data]: This field holds some additional data for function. |
| 6937 // Currently it either has FunctionTemplateInfo to make benefit the API | 6934 // Currently it either has FunctionTemplateInfo to make benefit the API |
| 6938 // or Smi identifying a builtin function. | 6935 // or Smi identifying a builtin function. |
| 6939 // In the long run we don't want all functions to have this field but | 6936 // In the long run we don't want all functions to have this field but |
| 6940 // we can fix that when we have a better model for storing hidden data | 6937 // we can fix that when we have a better model for storing hidden data |
| 6941 // on objects. | 6938 // on objects. |
| 6942 DECL_ACCESSORS(function_data, Object) | 6939 DECL_ACCESSORS(function_data, Object) |
| (...skipping 4118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 11061 } else { | 11058 } else { |
| 11062 value &= ~(1 << bit_position); | 11059 value &= ~(1 << bit_position); |
| 11063 } | 11060 } |
| 11064 return value; | 11061 return value; |
| 11065 } | 11062 } |
| 11066 }; | 11063 }; |
| 11067 | 11064 |
| 11068 } } // namespace v8::internal | 11065 } } // namespace v8::internal |
| 11069 | 11066 |
| 11070 #endif // V8_OBJECTS_H_ | 11067 #endif // V8_OBJECTS_H_ |
| OLD | NEW |