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

Side by Side Diff: src/objects.h

Issue 793453004: Reland of "TransitionArray now uses <is_data_property, name, attributes> tuple as a key, which allo… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Post-rebase fixes Created 6 years 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/hydrogen.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 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 enum DebugExtraICState { 274 enum DebugExtraICState {
275 DEBUG_BREAK, 275 DEBUG_BREAK,
276 DEBUG_PREPARE_STEP_IN 276 DEBUG_PREPARE_STEP_IN
277 }; 277 };
278 278
279 279
280 // Indicates whether the transition is simple: the target map of the transition 280 // Indicates whether the transition is simple: the target map of the transition
281 // either extends the current map with a new property, or it modifies the 281 // either extends the current map with a new property, or it modifies the
282 // property that was added last to the current map. 282 // property that was added last to the current map.
283 enum SimpleTransitionFlag { SIMPLE_TRANSITION, FULL_TRANSITION }; 283 enum SimpleTransitionFlag {
284 SIMPLE_PROPERTY_TRANSITION,
285 PROPERTY_TRANSITION,
286 SPECIAL_TRANSITION
287 };
284 288
285 289
286 // Indicates whether we are only interested in the descriptors of a particular 290 // Indicates whether we are only interested in the descriptors of a particular
287 // map, or in all descriptors in the descriptor array. 291 // map, or in all descriptors in the descriptor array.
288 enum DescriptorFlag { 292 enum DescriptorFlag {
289 ALL_DESCRIPTORS, 293 ALL_DESCRIPTORS,
290 OWN_DESCRIPTORS 294 OWN_DESCRIPTORS
291 }; 295 };
292 296
293 // The GC maintains a bit of information, the MarkingParity, which toggles 297 // The GC maintains a bit of information, the MarkingParity, which toggles
(...skipping 5523 matching lines...) Expand 10 before | Expand all | Expand 10 after
5817 5821
5818 // Returns true if the current map doesn't have DICTIONARY_ELEMENTS but if a 5822 // Returns true if the current map doesn't have DICTIONARY_ELEMENTS but if a
5819 // map with DICTIONARY_ELEMENTS was found in the prototype chain. 5823 // map with DICTIONARY_ELEMENTS was found in the prototype chain.
5820 bool DictionaryElementsInPrototypeChainOnly(); 5824 bool DictionaryElementsInPrototypeChainOnly();
5821 5825
5822 inline bool HasTransitionArray() const; 5826 inline bool HasTransitionArray() const;
5823 inline bool HasElementsTransition(); 5827 inline bool HasElementsTransition();
5824 inline Map* elements_transition_map(); 5828 inline Map* elements_transition_map();
5825 5829
5826 inline Map* GetTransition(int transition_index); 5830 inline Map* GetTransition(int transition_index);
5827 inline int SearchTransition(Name* name); 5831 inline int SearchSpecialTransition(Symbol* name);
5832 inline int SearchTransition(PropertyType type, Name* name,
5833 PropertyAttributes attributes);
5828 inline FixedArrayBase* GetInitialElements(); 5834 inline FixedArrayBase* GetInitialElements();
5829 5835
5830 DECL_ACCESSORS(transitions, TransitionArray) 5836 DECL_ACCESSORS(transitions, TransitionArray)
5831 5837
5832 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map); 5838 static inline Handle<String> ExpectedTransitionKey(Handle<Map> map);
5833 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map); 5839 static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map);
5834 5840
5835 // Try to follow an existing transition to a field with attributes NONE. The 5841 // Try to follow an existing transition to a field with attributes NONE. The
5836 // return value indicates whether the transition was successful. 5842 // return value indicates whether the transition was successful.
5837 static inline Handle<Map> FindTransitionToField(Handle<Map> map, 5843 static inline Handle<Map> FindTransitionToField(Handle<Map> map,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
5972 } 5978 }
5973 5979
5974 // Lookup in the map's instance descriptors and fill out the result 5980 // Lookup in the map's instance descriptors and fill out the result
5975 // with the given holder if the name is found. The holder may be 5981 // with the given holder if the name is found. The holder may be
5976 // NULL when this function is used from the compiler. 5982 // NULL when this function is used from the compiler.
5977 inline void LookupDescriptor(JSObject* holder, 5983 inline void LookupDescriptor(JSObject* holder,
5978 Name* name, 5984 Name* name,
5979 LookupResult* result); 5985 LookupResult* result);
5980 5986
5981 inline void LookupTransition(JSObject* holder, Name* name, 5987 inline void LookupTransition(JSObject* holder, Name* name,
5988 PropertyAttributes attributes,
5982 LookupResult* result); 5989 LookupResult* result);
5983 5990
5984 inline PropertyDetails GetLastDescriptorDetails(); 5991 inline PropertyDetails GetLastDescriptorDetails();
5985 5992
5986 // The size of transition arrays are limited so they do not end up in large 5993 // The size of transition arrays are limited so they do not end up in large
5987 // object space. Otherwise ClearNonLiveTransitions would leak memory while 5994 // object space. Otherwise ClearNonLiveTransitions would leak memory while
5988 // applying in-place right trimming. 5995 // applying in-place right trimming.
5989 inline bool CanHaveMoreTransitions(); 5996 inline bool CanHaveMoreTransitions();
5990 5997
5991 int LastAdded() { 5998 int LastAdded() {
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
6362 static Handle<Map> CopyInstallDescriptors( 6369 static Handle<Map> CopyInstallDescriptors(
6363 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors, 6370 Handle<Map> map, int new_descriptor, Handle<DescriptorArray> descriptors,
6364 Handle<LayoutDescriptor> layout_descriptor); 6371 Handle<LayoutDescriptor> layout_descriptor);
6365 static Handle<Map> CopyAddDescriptor(Handle<Map> map, 6372 static Handle<Map> CopyAddDescriptor(Handle<Map> map,
6366 Descriptor* descriptor, 6373 Descriptor* descriptor,
6367 TransitionFlag flag); 6374 TransitionFlag flag);
6368 static Handle<Map> CopyReplaceDescriptors( 6375 static Handle<Map> CopyReplaceDescriptors(
6369 Handle<Map> map, Handle<DescriptorArray> descriptors, 6376 Handle<Map> map, Handle<DescriptorArray> descriptors,
6370 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag, 6377 Handle<LayoutDescriptor> layout_descriptor, TransitionFlag flag,
6371 MaybeHandle<Name> maybe_name, const char* reason, 6378 MaybeHandle<Name> maybe_name, const char* reason,
6372 SimpleTransitionFlag simple_flag = FULL_TRANSITION); 6379 SimpleTransitionFlag simple_flag);
6380
6373 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, 6381 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map,
6374 Handle<DescriptorArray> descriptors, 6382 Handle<DescriptorArray> descriptors,
6375 Descriptor* descriptor, 6383 Descriptor* descriptor,
6376 int index, 6384 int index,
6377 TransitionFlag flag); 6385 TransitionFlag flag);
6378 6386
6379 static Handle<Map> CopyNormalized(Handle<Map> map, 6387 static Handle<Map> CopyNormalized(Handle<Map> map,
6380 PropertyNormalizationMode mode); 6388 PropertyNormalizationMode mode);
6381 6389
6382 // Fires when the layout of an object with a leaf map changes. 6390 // Fires when the layout of an object with a leaf map changes.
6383 // This includes adding transitions to the leaf map or changing 6391 // This includes adding transitions to the leaf map or changing
6384 // the descriptor array. 6392 // the descriptor array.
6385 inline void NotifyLeafMapLayoutChange(); 6393 inline void NotifyLeafMapLayoutChange();
6386 6394
6387 static Handle<Map> TransitionElementsToSlow(Handle<Map> object, 6395 static Handle<Map> TransitionElementsToSlow(Handle<Map> object,
6388 ElementsKind to_kind); 6396 ElementsKind to_kind);
6389 6397
6390 // Zaps the contents of backing data structures. Note that the 6398 // Zaps the contents of backing data structures. Note that the
6391 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects 6399 // heap verifier (i.e. VerifyMarkingVisitor) relies on zapping of objects
6392 // holding weak references when incremental marking is used, because it also 6400 // holding weak references when incremental marking is used, because it also
6393 // iterates over objects that are otherwise unreachable. 6401 // iterates over objects that are otherwise unreachable.
6394 // In general we only want to call these functions in release mode when 6402 // In general we only want to call these functions in release mode when
6395 // heap verification is turned on. 6403 // heap verification is turned on.
6396 void ZapPrototypeTransitions(); 6404 void ZapPrototypeTransitions();
6397 void ZapTransitions(); 6405 void ZapTransitions();
6398 6406
6399 void DeprecateTransitionTree(); 6407 void DeprecateTransitionTree();
6400 bool DeprecateTarget(Name* key, DescriptorArray* new_descriptors, 6408 bool DeprecateTarget(PropertyType type, Name* key,
6409 PropertyAttributes attributes,
6410 DescriptorArray* new_descriptors,
6401 LayoutDescriptor* new_layout_descriptor); 6411 LayoutDescriptor* new_layout_descriptor);
6402 6412
6403 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors); 6413 Map* FindLastMatchMap(int verbatim, int length, DescriptorArray* descriptors);
6404 6414
6405 void UpdateFieldType(int descriptor_number, Handle<Name> name, 6415 void UpdateFieldType(int descriptor_number, Handle<Name> name,
6406 Representation new_representation, 6416 Representation new_representation,
6407 Handle<HeapType> new_type); 6417 Handle<HeapType> new_type);
6408 6418
6409 void PrintGeneralization(FILE* file, 6419 void PrintGeneralization(FILE* file,
6410 const char* reason, 6420 const char* reason,
(...skipping 4601 matching lines...) Expand 10 before | Expand all | Expand 10 after
11012 } else { 11022 } else {
11013 value &= ~(1 << bit_position); 11023 value &= ~(1 << bit_position);
11014 } 11024 }
11015 return value; 11025 return value;
11016 } 11026 }
11017 }; 11027 };
11018 11028
11019 } } // namespace v8::internal 11029 } } // namespace v8::internal
11020 11030
11021 #endif // V8_OBJECTS_H_ 11031 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698