OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 // UPDATE_WEAK_WRITE_BARRIER skips the marking part of the write barrier and | 234 // UPDATE_WEAK_WRITE_BARRIER skips the marking part of the write barrier and |
235 // only performs the generational part. | 235 // only performs the generational part. |
236 // UPDATE_WRITE_BARRIER is doing the full barrier, marking and generational. | 236 // UPDATE_WRITE_BARRIER is doing the full barrier, marking and generational. |
237 enum WriteBarrierMode { | 237 enum WriteBarrierMode { |
238 SKIP_WRITE_BARRIER, | 238 SKIP_WRITE_BARRIER, |
239 UPDATE_WEAK_WRITE_BARRIER, | 239 UPDATE_WEAK_WRITE_BARRIER, |
240 UPDATE_WRITE_BARRIER | 240 UPDATE_WRITE_BARRIER |
241 }; | 241 }; |
242 | 242 |
243 | 243 |
244 // Indicates whether a value can be loaded as a constant. | |
245 enum StoreMode { ALLOW_IN_DESCRIPTOR, FORCE_FIELD }; | |
246 | |
247 | |
248 // PropertyNormalizationMode is used to specify whether to keep | 244 // PropertyNormalizationMode is used to specify whether to keep |
249 // inobject properties when normalizing properties of a JSObject. | 245 // inobject properties when normalizing properties of a JSObject. |
250 enum PropertyNormalizationMode { | 246 enum PropertyNormalizationMode { |
251 CLEAR_INOBJECT_PROPERTIES, | 247 CLEAR_INOBJECT_PROPERTIES, |
252 KEEP_INOBJECT_PROPERTIES | 248 KEEP_INOBJECT_PROPERTIES |
253 }; | 249 }; |
254 | 250 |
255 | 251 |
256 // Indicates how aggressively the prototype should be optimized. FAST_PROTOTYPE | 252 // Indicates how aggressively the prototype should be optimized. FAST_PROTOTYPE |
257 // will give the fastest result by tailoring the map to the prototype, but that | 253 // will give the fastest result by tailoring the map to the prototype, but that |
(...skipping 5785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6043 Representation rep1, Handle<FieldType> type1, Representation rep2, | 6039 Representation rep1, Handle<FieldType> type1, Representation rep2, |
6044 Handle<FieldType> type2, Isolate* isolate); | 6040 Handle<FieldType> type2, Isolate* isolate); |
6045 static void GeneralizeField(Handle<Map> map, int modify_index, | 6041 static void GeneralizeField(Handle<Map> map, int modify_index, |
6046 Representation new_representation, | 6042 Representation new_representation, |
6047 Handle<FieldType> new_field_type); | 6043 Handle<FieldType> new_field_type); |
6048 | 6044 |
6049 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index, | 6045 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index, |
6050 PropertyKind new_kind, | 6046 PropertyKind new_kind, |
6051 PropertyAttributes new_attributes, | 6047 PropertyAttributes new_attributes, |
6052 Representation new_representation, | 6048 Representation new_representation, |
6053 Handle<FieldType> new_field_type, | 6049 Handle<FieldType> new_field_type); |
6054 StoreMode store_mode); | |
6055 | 6050 |
6056 static Handle<Map> ReconfigureElementsKind(Handle<Map> map, | 6051 static Handle<Map> ReconfigureElementsKind(Handle<Map> map, |
6057 ElementsKind new_elements_kind); | 6052 ElementsKind new_elements_kind); |
6058 | 6053 |
6059 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, | 6054 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, |
6060 int descriptor_number, | 6055 int descriptor_number, |
6061 Handle<Object> value); | 6056 Handle<Object> value); |
6062 | 6057 |
6063 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, | 6058 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, |
6064 const char* reason); | 6059 const char* reason); |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6492 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty( | 6487 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty( |
6493 Handle<Map> map, int descriptor, PropertyKind kind, | 6488 Handle<Map> map, int descriptor, PropertyKind kind, |
6494 PropertyAttributes attributes, const char** reason); | 6489 PropertyAttributes attributes, const char** reason); |
6495 | 6490 |
6496 static Handle<Map> CopyNormalized(Handle<Map> map, | 6491 static Handle<Map> CopyNormalized(Handle<Map> map, |
6497 PropertyNormalizationMode mode); | 6492 PropertyNormalizationMode mode); |
6498 | 6493 |
6499 // TODO(ishell): Move to MapUpdater. | 6494 // TODO(ishell): Move to MapUpdater. |
6500 static Handle<Map> CopyGeneralizeAllFields( | 6495 static Handle<Map> CopyGeneralizeAllFields( |
6501 Handle<Map> map, ElementsKind elements_kind, int modify_index, | 6496 Handle<Map> map, ElementsKind elements_kind, int modify_index, |
6502 StoreMode store_mode, PropertyKind kind, PropertyAttributes attributes, | 6497 PropertyKind kind, PropertyAttributes attributes, const char* reason); |
6503 const char* reason); | |
6504 | 6498 |
6505 // Fires when the layout of an object with a leaf map changes. | 6499 // Fires when the layout of an object with a leaf map changes. |
6506 // This includes adding transitions to the leaf map or changing | 6500 // This includes adding transitions to the leaf map or changing |
6507 // the descriptor array. | 6501 // the descriptor array. |
6508 inline void NotifyLeafMapLayoutChange(); | 6502 inline void NotifyLeafMapLayoutChange(); |
6509 | 6503 |
6510 void DeprecateTransitionTree(); | 6504 void DeprecateTransitionTree(); |
6511 | 6505 |
6512 void ReplaceDescriptors(DescriptorArray* new_descriptors, | 6506 void ReplaceDescriptors(DescriptorArray* new_descriptors, |
6513 LayoutDescriptor* new_layout_descriptor); | 6507 LayoutDescriptor* new_layout_descriptor); |
(...skipping 5137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11651 } | 11645 } |
11652 }; | 11646 }; |
11653 | 11647 |
11654 | 11648 |
11655 } // NOLINT, false-positive due to second-order macros. | 11649 } // NOLINT, false-positive due to second-order macros. |
11656 } // NOLINT, false-positive due to second-order macros. | 11650 } // NOLINT, false-positive due to second-order macros. |
11657 | 11651 |
11658 #include "src/objects/object-macros-undef.h" | 11652 #include "src/objects/object-macros-undef.h" |
11659 | 11653 |
11660 #endif // V8_OBJECTS_H_ | 11654 #endif // V8_OBJECTS_H_ |
OLD | NEW |