Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: src/objects.h

Issue 2632373002: [runtime] Add DescriptorArray::GeneralizeAllFields(). (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/map-updater.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3226 matching lines...) Expand 10 before | Expand all | Expand 10 after
3237 static inline int GetValueOffset(int descriptor_number); 3237 static inline int GetValueOffset(int descriptor_number);
3238 inline Object** GetDescriptorStartSlot(int descriptor_number); 3238 inline Object** GetDescriptorStartSlot(int descriptor_number);
3239 inline Object** GetDescriptorEndSlot(int descriptor_number); 3239 inline Object** GetDescriptorEndSlot(int descriptor_number);
3240 inline PropertyDetails GetDetails(int descriptor_number); 3240 inline PropertyDetails GetDetails(int descriptor_number);
3241 inline int GetFieldIndex(int descriptor_number); 3241 inline int GetFieldIndex(int descriptor_number);
3242 inline FieldType* GetFieldType(int descriptor_number); 3242 inline FieldType* GetFieldType(int descriptor_number);
3243 3243
3244 inline Name* GetSortedKey(int descriptor_number); 3244 inline Name* GetSortedKey(int descriptor_number);
3245 inline int GetSortedKeyIndex(int descriptor_number); 3245 inline int GetSortedKeyIndex(int descriptor_number);
3246 inline void SetSortedKey(int pointer, int descriptor_number); 3246 inline void SetSortedKey(int pointer, int descriptor_number);
3247 inline void SetRepresentation(int descriptor_number,
3248 Representation representation);
3249 3247
3250 // Accessor for complete descriptor. 3248 // Accessor for complete descriptor.
3251 inline void Get(int descriptor_number, Descriptor* desc); 3249 inline void Get(int descriptor_number, Descriptor* desc);
3252 inline void Set(int descriptor_number, Descriptor* desc); 3250 inline void Set(int descriptor_number, Descriptor* desc);
3253 inline void Set(int descriptor_number, Name* key, Object* value, 3251 inline void Set(int descriptor_number, Name* key, Object* value,
3254 PropertyDetails details); 3252 PropertyDetails details);
3255 void Replace(int descriptor_number, Descriptor* descriptor); 3253 void Replace(int descriptor_number, Descriptor* descriptor);
3256 3254
3255 // Generalizes representation and field type of all field descriptors.
3256 void GeneralizeAllFields();
3257
3257 // Append automatically sets the enumeration index. This should only be used 3258 // Append automatically sets the enumeration index. This should only be used
3258 // to add descriptors in bulk at the end, followed by sorting the descriptor 3259 // to add descriptors in bulk at the end, followed by sorting the descriptor
3259 // array. 3260 // array.
3260 inline void Append(Descriptor* desc); 3261 inline void Append(Descriptor* desc);
3261 3262
3262 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc, 3263 static Handle<DescriptorArray> CopyUpTo(Handle<DescriptorArray> desc,
3263 int enumeration_index, 3264 int enumeration_index,
3264 int slack = 0); 3265 int slack = 0);
3265 3266
3266 static Handle<DescriptorArray> CopyUpToAddAttributes( 3267 static Handle<DescriptorArray> CopyUpToAddAttributes(
(...skipping 2763 matching lines...) Expand 10 before | Expand all | Expand 10 after
6030 inline int GetInObjectPropertyOffset(int index); 6031 inline int GetInObjectPropertyOffset(int index);
6031 6032
6032 int NumberOfFields(); 6033 int NumberOfFields();
6033 6034
6034 // TODO(ishell): candidate with JSObject::MigrateToMap(). 6035 // TODO(ishell): candidate with JSObject::MigrateToMap().
6035 bool InstancesNeedRewriting(Map* target); 6036 bool InstancesNeedRewriting(Map* target);
6036 bool InstancesNeedRewriting(Map* target, int target_number_of_fields, 6037 bool InstancesNeedRewriting(Map* target, int target_number_of_fields,
6037 int target_inobject, int target_unused, 6038 int target_inobject, int target_unused,
6038 int* old_number_of_fields); 6039 int* old_number_of_fields);
6039 // TODO(ishell): moveit! 6040 // TODO(ishell): moveit!
6040 static Handle<Map> GeneralizeAllFieldRepresentations(Handle<Map> map); 6041 static Handle<Map> GeneralizeAllFields(Handle<Map> map);
6041 MUST_USE_RESULT static Handle<FieldType> GeneralizeFieldType( 6042 MUST_USE_RESULT static Handle<FieldType> GeneralizeFieldType(
6042 Representation rep1, Handle<FieldType> type1, Representation rep2, 6043 Representation rep1, Handle<FieldType> type1, Representation rep2,
6043 Handle<FieldType> type2, Isolate* isolate); 6044 Handle<FieldType> type2, Isolate* isolate);
6044 static void GeneralizeField(Handle<Map> map, int modify_index, 6045 static void GeneralizeField(Handle<Map> map, int modify_index,
6045 Representation new_representation, 6046 Representation new_representation,
6046 Handle<FieldType> new_field_type); 6047 Handle<FieldType> new_field_type);
6047 6048
6048 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index, 6049 static Handle<Map> ReconfigureProperty(Handle<Map> map, int modify_index,
6049 PropertyKind new_kind, 6050 PropertyKind new_kind,
6050 PropertyAttributes new_attributes, 6051 PropertyAttributes new_attributes,
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
6489 int index, 6490 int index,
6490 TransitionFlag flag); 6491 TransitionFlag flag);
6491 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty( 6492 static MUST_USE_RESULT MaybeHandle<Map> TryReconfigureExistingProperty(
6492 Handle<Map> map, int descriptor, PropertyKind kind, 6493 Handle<Map> map, int descriptor, PropertyKind kind,
6493 PropertyAttributes attributes, const char** reason); 6494 PropertyAttributes attributes, const char** reason);
6494 6495
6495 static Handle<Map> CopyNormalized(Handle<Map> map, 6496 static Handle<Map> CopyNormalized(Handle<Map> map,
6496 PropertyNormalizationMode mode); 6497 PropertyNormalizationMode mode);
6497 6498
6498 // TODO(ishell): Move to MapUpdater. 6499 // TODO(ishell): Move to MapUpdater.
6499 static Handle<Map> CopyGeneralizeAllRepresentations( 6500 static Handle<Map> CopyGeneralizeAllFields(
6500 Handle<Map> map, ElementsKind elements_kind, int modify_index, 6501 Handle<Map> map, ElementsKind elements_kind, int modify_index,
6501 StoreMode store_mode, PropertyKind kind, PropertyAttributes attributes, 6502 StoreMode store_mode, PropertyKind kind, PropertyAttributes attributes,
6502 const char* reason); 6503 const char* reason);
6503 6504
6504 // Fires when the layout of an object with a leaf map changes. 6505 // Fires when the layout of an object with a leaf map changes.
6505 // This includes adding transitions to the leaf map or changing 6506 // This includes adding transitions to the leaf map or changing
6506 // the descriptor array. 6507 // the descriptor array.
6507 inline void NotifyLeafMapLayoutChange(); 6508 inline void NotifyLeafMapLayoutChange();
6508 6509
6509 void DeprecateTransitionTree(); 6510 void DeprecateTransitionTree();
(...skipping 5140 matching lines...) Expand 10 before | Expand all | Expand 10 after
11650 } 11651 }
11651 }; 11652 };
11652 11653
11653 11654
11654 } // NOLINT, false-positive due to second-order macros. 11655 } // NOLINT, false-positive due to second-order macros.
11655 } // NOLINT, false-positive due to second-order macros. 11656 } // NOLINT, false-positive due to second-order macros.
11656 11657
11657 #include "src/objects/object-macros-undef.h" 11658 #include "src/objects/object-macros-undef.h"
11658 11659
11659 #endif // V8_OBJECTS_H_ 11660 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/map-updater.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698