| 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 3218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3229 inline int GetSortedKeyIndex(int descriptor_number); | 3229 inline int GetSortedKeyIndex(int descriptor_number); |
| 3230 inline void SetSortedKey(int pointer, int descriptor_number); | 3230 inline void SetSortedKey(int pointer, int descriptor_number); |
| 3231 | 3231 |
| 3232 // Accessor for complete descriptor. | 3232 // Accessor for complete descriptor. |
| 3233 inline void Get(int descriptor_number, Descriptor* desc); | 3233 inline void Get(int descriptor_number, Descriptor* desc); |
| 3234 inline void Set(int descriptor_number, Descriptor* desc); | 3234 inline void Set(int descriptor_number, Descriptor* desc); |
| 3235 inline void Set(int descriptor_number, Name* key, Object* value, | 3235 inline void Set(int descriptor_number, Name* key, Object* value, |
| 3236 PropertyDetails details); | 3236 PropertyDetails details); |
| 3237 void Replace(int descriptor_number, Descriptor* descriptor); | 3237 void Replace(int descriptor_number, Descriptor* descriptor); |
| 3238 | 3238 |
| 3239 // Generalizes representation and field type of all field descriptors. | 3239 // Generalizes constness, representation and field type of all field |
| 3240 // descriptors. |
| 3240 void GeneralizeAllFields(); | 3241 void GeneralizeAllFields(); |
| 3241 | 3242 |
| 3242 // Append automatically sets the enumeration index. This should only be used | 3243 // Append automatically sets the enumeration index. This should only be used |
| 3243 // to add descriptors in bulk at the end, followed by sorting the descriptor | 3244 // to add descriptors in bulk at the end, followed by sorting the descriptor |
| 3244 // array. | 3245 // array. |
| 3245 inline void Append(Descriptor* desc); | 3246 inline void Append(Descriptor* desc); |
| 3246 | 3247 |
| 3247 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, | 3248 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, |
| 3248 int enumeration_index, | 3249 int enumeration_index, |
| 3249 int slack = 0); | 3250 int slack = 0); |
| (...skipping 2769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6019 bool InstancesNeedRewriting(Map* target); | 6020 bool InstancesNeedRewriting(Map* target); |
| 6020 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, | 6021 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, |
| 6021 int target_inobject, int target_unused, | 6022 int target_inobject, int target_unused, |
| 6022 int* old_number_of_fields); | 6023 int* old_number_of_fields); |
| 6023 // TODO(ishell): moveit! | 6024 // TODO(ishell): moveit! |
| 6024 static Handle<Map> GeneralizeAllFields(Handle<Map> map); | 6025 static Handle<Map> GeneralizeAllFields(Handle<Map> map); |
| 6025 MUST_USE_RESULT static Handle<FieldType> GeneralizeFieldType( | 6026 MUST_USE_RESULT static Handle<FieldType> GeneralizeFieldType( |
| 6026 Representation rep1, Handle<FieldType> type1, Representation rep2, | 6027 Representation rep1, Handle<FieldType> type1, Representation rep2, |
| 6027 Handle<FieldType> type2, Isolate* isolate); | 6028 Handle<FieldType> type2, Isolate* isolate); |
| 6028 static void GeneralizeField(Handle<Map> map, int modify_index, | 6029 static void GeneralizeField(Handle<Map> map, int modify_index, |
| 6030 PropertyConstness new_constness, |
| 6029 Representation new_representation, | 6031 Representation new_representation, |
| 6030 Handle<FieldType> new_field_type); | 6032 Handle<FieldType> new_field_type); |
| 6031 | 6033 |
| 6032 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index, | 6034 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index, |
| 6033 PropertyKind new_kind, | 6035 PropertyKind new_kind, |
| 6034 PropertyAttributes new_attributes, | 6036 PropertyAttributes new_attributes, |
| 6035 Representation new_representation, | 6037 Representation new_representation, |
| 6036 Handle<FieldType> new_field_type); | 6038 Handle<FieldType> new_field_type); |
| 6037 | 6039 |
| 6038 static Handle<Map> ReconfigureElementsKind(Handle<Map> map, | 6040 static Handle<Map> ReconfigureElementsKind(Handle<Map> map, |
| 6039 ElementsKind new_elements_kind); | 6041 ElementsKind new_elements_kind); |
| 6040 | 6042 |
| 6041 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, | 6043 static Handle<Map> PrepareForDataProperty(Handle<Map> old_map, |
| 6042 int descriptor_number, | 6044 int descriptor_number, |
| 6045 PropertyConstness constness, |
| 6043 Handle<Object> value); | 6046 Handle<Object> value); |
| 6044 | 6047 |
| 6045 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, | 6048 static Handle<Map> Normalize(Handle<Map> map, PropertyNormalizationMode mode, |
| 6046 const char* reason); | 6049 const char* reason); |
| 6047 | 6050 |
| 6048 // Tells whether the map is used for JSObjects in dictionary mode (ie | 6051 // Tells whether the map is used for JSObjects in dictionary mode (ie |
| 6049 // normalized objects, ie objects for which HasFastProperties returns false). | 6052 // normalized objects, ie objects for which HasFastProperties returns false). |
| 6050 // A map can never be used for both dictionary mode and fast mode JSObjects. | 6053 // A map can never be used for both dictionary mode and fast mode JSObjects. |
| 6051 // False by default and for HeapObjects that are not JSObjects. | 6054 // False by default and for HeapObjects that are not JSObjects. |
| 6052 inline void set_dictionary_map(bool value); | 6055 inline void set_dictionary_map(bool value); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6157 static Handle<Map> CopyDropDescriptors(Handle<Map> map); | 6160 static Handle<Map> CopyDropDescriptors(Handle<Map> map); |
| 6158 static Handle<Map> CopyInsertDescriptor(Handle<Map> map, | 6161 static Handle<Map> CopyInsertDescriptor(Handle<Map> map, |
| 6159 Descriptor* descriptor, | 6162 Descriptor* descriptor, |
| 6160 TransitionFlag flag); | 6163 TransitionFlag flag); |
| 6161 | 6164 |
| 6162 static Handle<Object> WrapFieldType(Handle<FieldType> type); | 6165 static Handle<Object> WrapFieldType(Handle<FieldType> type); |
| 6163 static FieldType* UnwrapFieldType(Object* wrapped_type); | 6166 static FieldType* UnwrapFieldType(Object* wrapped_type); |
| 6164 | 6167 |
| 6165 MUST_USE_RESULT static MaybeHandle<Map> CopyWithField( | 6168 MUST_USE_RESULT static MaybeHandle<Map> CopyWithField( |
| 6166 Handle<Map> map, Handle<Name> name, Handle<FieldType> type, | 6169 Handle<Map> map, Handle<Name> name, Handle<FieldType> type, |
| 6167 PropertyAttributes attributes, Representation representation, | 6170 PropertyAttributes attributes, PropertyConstness constness, |
| 6168 TransitionFlag flag); | 6171 Representation representation, TransitionFlag flag); |
| 6169 | 6172 |
| 6170 MUST_USE_RESULT static MaybeHandle<Map> CopyWithConstant( | 6173 MUST_USE_RESULT static MaybeHandle<Map> CopyWithConstant( |
| 6171 Handle<Map> map, | 6174 Handle<Map> map, |
| 6172 Handle<Name> name, | 6175 Handle<Name> name, |
| 6173 Handle<Object> constant, | 6176 Handle<Object> constant, |
| 6174 PropertyAttributes attributes, | 6177 PropertyAttributes attributes, |
| 6175 TransitionFlag flag); | 6178 TransitionFlag flag); |
| 6176 | 6179 |
| 6177 // Returns a new map with all transitions dropped from the given map and | 6180 // Returns a new map with all transitions dropped from the given map and |
| 6178 // the ElementsKind set. | 6181 // the ElementsKind set. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 6199 | 6202 |
| 6200 | 6203 |
| 6201 // Maximal number of fast properties. Used to restrict the number of map | 6204 // Maximal number of fast properties. Used to restrict the number of map |
| 6202 // transitions to avoid an explosion in the number of maps for objects used as | 6205 // transitions to avoid an explosion in the number of maps for objects used as |
| 6203 // dictionaries. | 6206 // dictionaries. |
| 6204 inline bool TooManyFastProperties(StoreFromKeyed store_mode); | 6207 inline bool TooManyFastProperties(StoreFromKeyed store_mode); |
| 6205 static Handle<Map> TransitionToDataProperty(Handle<Map> map, | 6208 static Handle<Map> TransitionToDataProperty(Handle<Map> map, |
| 6206 Handle<Name> name, | 6209 Handle<Name> name, |
| 6207 Handle<Object> value, | 6210 Handle<Object> value, |
| 6208 PropertyAttributes attributes, | 6211 PropertyAttributes attributes, |
| 6212 PropertyConstness constness, |
| 6209 StoreFromKeyed store_mode); | 6213 StoreFromKeyed store_mode); |
| 6210 static Handle<Map> TransitionToAccessorProperty( | 6214 static Handle<Map> TransitionToAccessorProperty( |
| 6211 Isolate* isolate, Handle<Map> map, Handle<Name> name, int descriptor, | 6215 Isolate* isolate, Handle<Map> map, Handle<Name> name, int descriptor, |
| 6212 Handle<Object> getter, Handle<Object> setter, | 6216 Handle<Object> getter, Handle<Object> setter, |
| 6213 PropertyAttributes attributes); | 6217 PropertyAttributes attributes); |
| 6214 static Handle<Map> ReconfigureExistingProperty(Handle<Map> map, | 6218 static Handle<Map> ReconfigureExistingProperty(Handle<Map> map, |
| 6215 int descriptor, | 6219 int descriptor, |
| 6216 PropertyKind kind, | 6220 PropertyKind kind, |
| 6217 PropertyAttributes attributes); | 6221 PropertyAttributes attributes); |
| 6218 | 6222 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6490 void DeprecateTransitionTree(); | 6494 void DeprecateTransitionTree(); |
| 6491 | 6495 |
| 6492 void ReplaceDescriptors(DescriptorArray* new_descriptors, | 6496 void ReplaceDescriptors(DescriptorArray* new_descriptors, |
| 6493 LayoutDescriptor* new_layout_descriptor); | 6497 LayoutDescriptor* new_layout_descriptor); |
| 6494 | 6498 |
| 6495 | 6499 |
| 6496 // Update field type of the given descriptor to new representation and new | 6500 // Update field type of the given descriptor to new representation and new |
| 6497 // type. The type must be prepared for storing in descriptor array: | 6501 // type. The type must be prepared for storing in descriptor array: |
| 6498 // it must be either a simple type or a map wrapped in a weak cell. | 6502 // it must be either a simple type or a map wrapped in a weak cell. |
| 6499 void UpdateFieldType(int descriptor_number, Handle<Name> name, | 6503 void UpdateFieldType(int descriptor_number, Handle<Name> name, |
| 6504 PropertyConstness new_constness, |
| 6500 Representation new_representation, | 6505 Representation new_representation, |
| 6501 Handle<Object> new_wrapped_type); | 6506 Handle<Object> new_wrapped_type); |
| 6502 | 6507 |
| 6503 // TODO(ishell): Move to MapUpdater. | 6508 // TODO(ishell): Move to MapUpdater. |
| 6504 void PrintReconfiguration(FILE* file, int modify_index, PropertyKind kind, | 6509 void PrintReconfiguration(FILE* file, int modify_index, PropertyKind kind, |
| 6505 PropertyAttributes attributes); | 6510 PropertyAttributes attributes); |
| 6506 // TODO(ishell): Move to MapUpdater. | 6511 // TODO(ishell): Move to MapUpdater. |
| 6507 void PrintGeneralization(FILE* file, const char* reason, int modify_index, | 6512 void PrintGeneralization(FILE* file, const char* reason, int modify_index, |
| 6508 int split, int descriptors, bool constant_to_field, | 6513 int split, int descriptors, bool constant_to_field, |
| 6509 Representation old_representation, | 6514 Representation old_representation, |
| (...skipping 5215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11725 } | 11730 } |
| 11726 }; | 11731 }; |
| 11727 | 11732 |
| 11728 | 11733 |
| 11729 } // NOLINT, false-positive due to second-order macros. | 11734 } // NOLINT, false-positive due to second-order macros. |
| 11730 } // NOLINT, false-positive due to second-order macros. | 11735 } // NOLINT, false-positive due to second-order macros. |
| 11731 | 11736 |
| 11732 #include "src/objects/object-macros-undef.h" | 11737 #include "src/objects/object-macros-undef.h" |
| 11733 | 11738 |
| 11734 #endif // V8_OBJECTS_H_ | 11739 #endif // V8_OBJECTS_H_ |
| OLD | NEW |