| 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 6043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6054 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); | 6054 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); |
| 6055 | 6055 |
| 6056 // Returns true if given field is unboxed double. | 6056 // Returns true if given field is unboxed double. |
| 6057 inline bool IsUnboxedDoubleField(FieldIndex index); | 6057 inline bool IsUnboxedDoubleField(FieldIndex index); |
| 6058 | 6058 |
| 6059 #if TRACE_MAPS | 6059 #if TRACE_MAPS |
| 6060 static void TraceTransition(const char* what, Map* from, Map* to, Name* name); | 6060 static void TraceTransition(const char* what, Map* from, Map* to, Name* name); |
| 6061 static void TraceAllTransitions(Map* map); | 6061 static void TraceAllTransitions(Map* map); |
| 6062 #endif | 6062 #endif |
| 6063 | 6063 |
| 6064 static inline Handle<Map> CopyInstallDescriptorsForTesting( | 6064 static inline Handle<Map> AddMissingTransitionsForTesting( |
| 6065 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, | 6065 Handle<Map> split_map, Handle<DescriptorArray> descriptors, |
| 6066 Handle<LayoutDescriptor> layout_descriptor); | 6066 Handle<LayoutDescriptor> full_layout_descriptor); |
| 6067 | 6067 |
| 6068 private: | 6068 private: |
| 6069 static void ConnectTransition(Handle<Map> parent, Handle<Map> child, | 6069 static void ConnectTransition(Handle<Map> parent, Handle<Map> child, |
| 6070 Handle<Name> name, SimpleTransitionFlag flag); | 6070 Handle<Name> name, SimpleTransitionFlag flag); |
| 6071 | 6071 |
| 6072 bool EquivalentToForTransition(Map* other); | 6072 bool EquivalentToForTransition(Map* other); |
| 6073 static Handle<Map> RawCopy(Handle<Map> map, int instance_size); | 6073 static Handle<Map> RawCopy(Handle<Map> map, int instance_size); |
| 6074 static Handle<Map> ShareDescriptor(Handle<Map> map, | 6074 static Handle<Map> ShareDescriptor(Handle<Map> map, |
| 6075 Handle<DescriptorArray> descriptors, | 6075 Handle<DescriptorArray> descriptors, |
| 6076 Descriptor* descriptor); | 6076 Descriptor* descriptor); |
| 6077 static Handle<Map> CopyInstallDescriptors( | 6077 static Handle<Map> AddMissingTransitions( |
| 6078 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, | 6078 Handle<Map> map, Handle<DescriptorArray> descriptors, |
| 6079 Handle<LayoutDescriptor> layout_descriptor); | 6079 Handle<LayoutDescriptor> full_layout_descriptor); |
| 6080 static void InstallDescriptors( |
| 6081 Handle<Map> parent_map, Handle<Map> child_map, int new_descriptor, |
| 6082 Handle<DescriptorArray> descriptors, |
| 6083 Handle<LayoutDescriptor> full_layout_descriptor); |
| 6080 static Handle<Map> CopyAddDescriptor(Handle<Map> map, | 6084 static Handle<Map> CopyAddDescriptor(Handle<Map> map, |
| 6081 Descriptor* descriptor, | 6085 Descriptor* descriptor, |
| 6082 TransitionFlag flag); | 6086 TransitionFlag flag); |
| 6083 static Handle<Map> CopyReplaceDescriptors( | 6087 static Handle<Map> CopyReplaceDescriptors( |
| 6084 Handle<Map> map, Handle<DescriptorArray> descriptors, | 6088 Handle<Map> map, Handle<DescriptorArray> descriptors, |
| 6085 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, | 6089 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, |
| 6086 MaybeHandle<Name> maybe_name, const char* reason, | 6090 MaybeHandle<Name> maybe_name, const char* reason, |
| 6087 SimpleTransitionFlag simple_flag); | 6091 SimpleTransitionFlag simple_flag); |
| 6088 | 6092 |
| 6089 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, | 6093 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, |
| 6090 Handle<DescriptorArray> descriptors, | 6094 Handle<DescriptorArray> descriptors, |
| 6091 Descriptor* descriptor, | 6095 Descriptor* descriptor, |
| 6092 int index, | 6096 int index, |
| 6093 TransitionFlag flag); | 6097 TransitionFlag flag); |
| 6094 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty( | 6098 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty( |
| 6095 Handle<Map> map, int descriptor, PropertyKind kind, | 6099 Handle<Map> map, int descriptor, PropertyKind kind, |
| 6096 PropertyAttributes attributes, const char** reason); | 6100 PropertyAttributes attributes, const char** reason); |
| 6097 | 6101 |
| 6098 static Handle<Map> CopyNormalized(Handle<Map> map, | 6102 static Handle<Map> CopyNormalized(Handle<Map> map, |
| 6099 PropertyNormalizationMode mode); | 6103 PropertyNormalizationMode mode); |
| 6100 | 6104 |
| 6101 // Fires when the layout of an object with a leaf map changes. | 6105 // Fires when the layout of an object with a leaf map changes. |
| 6102 // This includes adding transitions to the leaf map or changing | 6106 // This includes adding transitions to the leaf map or changing |
| 6103 // the descriptor array. | 6107 // the descriptor array. |
| 6104 inline void NotifyLeafMapLayoutChange(); | 6108 inline void NotifyLeafMapLayoutChange(); |
| 6105 | 6109 |
| 6106 void DeprecateTransitionTree(); | 6110 void DeprecateTransitionTree(); |
| 6107 bool DeprecateTarget(PropertyKind kind, Name* key, | 6111 |
| 6108 PropertyAttributes attributes, | 6112 void ReplaceDescriptors(DescriptorArray* new_descriptors, |
| 6109 DescriptorArray* new_descriptors, | 6113 LayoutDescriptor* new_layout_descriptor); |
| 6110 LayoutDescriptor* new_layout_descriptor); | 6114 |
| 6111 | 6115 |
| 6112 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); | 6116 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); |
| 6113 | 6117 |
| 6114 // Update field type of the given descriptor to new representation and new | 6118 // Update field type of the given descriptor to new representation and new |
| 6115 // type. The type must be prepared for storing in descriptor array: | 6119 // type. The type must be prepared for storing in descriptor array: |
| 6116 // it must be either a simple type or a map wrapped in a weak cell. | 6120 // it must be either a simple type or a map wrapped in a weak cell. |
| 6117 void UpdateFieldType(int descriptor_number, Handle<Name> name, | 6121 void UpdateFieldType(int descriptor_number, Handle<Name> name, |
| 6118 Representation new_representation, | 6122 Representation new_representation, |
| 6119 Handle<Object> new_wrapped_type); | 6123 Handle<Object> new_wrapped_type); |
| 6120 | 6124 |
| (...skipping 4557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10678 } | 10682 } |
| 10679 return value; | 10683 return value; |
| 10680 } | 10684 } |
| 10681 }; | 10685 }; |
| 10682 | 10686 |
| 10683 | 10687 |
| 10684 } // NOLINT, false-positive due to second-order macros. | 10688 } // NOLINT, false-positive due to second-order macros. |
| 10685 } // NOLINT, false-positive due to second-order macros. | 10689 } // NOLINT, false-positive due to second-order macros. |
| 10686 | 10690 |
| 10687 #endif // V8_OBJECTS_H_ | 10691 #endif // V8_OBJECTS_H_ |
| OLD | NEW |