| 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 6423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6434 | 6434 |
| 6435 #if TRACE_MAPS | 6435 #if TRACE_MAPS |
| 6436 static void TraceTransition(const char* what, Map* from, Map* to, Name* name); | 6436 static void TraceTransition(const char* what, Map* from, Map* to, Name* name); |
| 6437 static void TraceAllTransitions(Map* map); | 6437 static void TraceAllTransitions(Map* map); |
| 6438 #endif | 6438 #endif |
| 6439 | 6439 |
| 6440 static inline Handle<Map> AddMissingTransitionsForTesting( | 6440 static inline Handle<Map> AddMissingTransitionsForTesting( |
| 6441 Handle<Map> split_map, Handle<DescriptorArray> descriptors, | 6441 Handle<Map> split_map, Handle<DescriptorArray> descriptors, |
| 6442 Handle<LayoutDescriptor> full_layout_descriptor); | 6442 Handle<LayoutDescriptor> full_layout_descriptor); |
| 6443 | 6443 |
| 6444 // Fires when the layout of an object with a leaf map changes. |
| 6445 // This includes adding transitions to the leaf map or changing |
| 6446 // the descriptor array. |
| 6447 inline void NotifyLeafMapLayoutChange(); |
| 6448 |
| 6444 private: | 6449 private: |
| 6445 // Returns the map that this (root) map transitions to if its elements_kind | 6450 // Returns the map that this (root) map transitions to if its elements_kind |
| 6446 // is changed to |elements_kind|, or |nullptr| if no such map is cached yet. | 6451 // is changed to |elements_kind|, or |nullptr| if no such map is cached yet. |
| 6447 Map* LookupElementsTransitionMap(ElementsKind elements_kind); | 6452 Map* LookupElementsTransitionMap(ElementsKind elements_kind); |
| 6448 | 6453 |
| 6449 // Tries to replay property transitions starting from this (root) map using | 6454 // Tries to replay property transitions starting from this (root) map using |
| 6450 // the descriptor array of the |map|. The |root_map| is expected to have | 6455 // the descriptor array of the |map|. The |root_map| is expected to have |
| 6451 // proper elements kind and therefore elements kinds transitions are not | 6456 // proper elements kind and therefore elements kinds transitions are not |
| 6452 // taken by this function. Returns |nullptr| if matching transition map is | 6457 // taken by this function. Returns |nullptr| if matching transition map is |
| 6453 // not found. | 6458 // not found. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6487 PropertyAttributes attributes, const char** reason); | 6492 PropertyAttributes attributes, const char** reason); |
| 6488 | 6493 |
| 6489 static Handle<Map> CopyNormalized(Handle<Map> map, | 6494 static Handle<Map> CopyNormalized(Handle<Map> map, |
| 6490 PropertyNormalizationMode mode); | 6495 PropertyNormalizationMode mode); |
| 6491 | 6496 |
| 6492 // TODO(ishell): Move to MapUpdater. | 6497 // TODO(ishell): Move to MapUpdater. |
| 6493 static Handle<Map> CopyGeneralizeAllFields( | 6498 static Handle<Map> CopyGeneralizeAllFields( |
| 6494 Handle<Map> map, ElementsKind elements_kind, int modify_index, | 6499 Handle<Map> map, ElementsKind elements_kind, int modify_index, |
| 6495 PropertyKind kind, PropertyAttributes attributes, const char* reason); | 6500 PropertyKind kind, PropertyAttributes attributes, const char* reason); |
| 6496 | 6501 |
| 6497 // Fires when the layout of an object with a leaf map changes. | |
| 6498 // This includes adding transitions to the leaf map or changing | |
| 6499 // the descriptor array. | |
| 6500 inline void NotifyLeafMapLayoutChange(); | |
| 6501 | |
| 6502 void DeprecateTransitionTree(); | 6502 void DeprecateTransitionTree(); |
| 6503 | 6503 |
| 6504 void ReplaceDescriptors(DescriptorArray* new_descriptors, | 6504 void ReplaceDescriptors(DescriptorArray* new_descriptors, |
| 6505 LayoutDescriptor* new_layout_descriptor); | 6505 LayoutDescriptor* new_layout_descriptor); |
| 6506 | 6506 |
| 6507 | 6507 |
| 6508 // Update field type of the given descriptor to new representation and new | 6508 // Update field type of the given descriptor to new representation and new |
| 6509 // type. The type must be prepared for storing in descriptor array: | 6509 // type. The type must be prepared for storing in descriptor array: |
| 6510 // it must be either a simple type or a map wrapped in a weak cell. | 6510 // it must be either a simple type or a map wrapped in a weak cell. |
| 6511 void UpdateFieldType(int descriptor_number, Handle<Name> name, | 6511 void UpdateFieldType(int descriptor_number, Handle<Name> name, |
| (...skipping 5146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11658 } | 11658 } |
| 11659 }; | 11659 }; |
| 11660 | 11660 |
| 11661 | 11661 |
| 11662 } // NOLINT, false-positive due to second-order macros. | 11662 } // NOLINT, false-positive due to second-order macros. |
| 11663 } // NOLINT, false-positive due to second-order macros. | 11663 } // NOLINT, false-positive due to second-order macros. |
| 11664 | 11664 |
| 11665 #include "src/objects/object-macros-undef.h" | 11665 #include "src/objects/object-macros-undef.h" |
| 11666 | 11666 |
| 11667 #endif // V8_OBJECTS_H_ | 11667 #endif // V8_OBJECTS_H_ |
| OLD | NEW |