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

Side by Side Diff: src/objects.h

Issue 10909007: Sharing of descriptor arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 OMIT_CREATION 170 OMIT_CREATION
171 }; 171 };
172 172
173 173
174 // Indicates whether transitions can be added to a source map or not. 174 // Indicates whether transitions can be added to a source map or not.
175 enum TransitionFlag { 175 enum TransitionFlag {
176 INSERT_TRANSITION, 176 INSERT_TRANSITION,
177 OMIT_TRANSITION 177 OMIT_TRANSITION
178 }; 178 };
179 179
180 // Indicates whether we are only interested in the descriptors of a particular
181 // map, or in all descriptors in the descriptor array.
182 enum DescriptorFlag {
183 ALL_DESCRIPTORS,
184 OWN_DESCRIPTORS
185 };
186
180 187
181 // Instance size sentinel for objects of variable size. 188 // Instance size sentinel for objects of variable size.
182 const int kVariableSizeSentinel = 0; 189 const int kVariableSizeSentinel = 0;
183 190
184 const int kStubMajorKeyBits = 6; 191 const int kStubMajorKeyBits = 6;
185 const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits; 192 const int kStubMinorKeyBits = kBitsPerInt - kSmiTagSize - kStubMajorKeyBits;
186 193
187 // All Maps have a field instance_type containing a InstanceType. 194 // All Maps have a field instance_type containing a InstanceType.
188 // It describes the type of the instances. 195 // It describes the type of the instances.
189 // 196 //
(...skipping 2282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2472 inline bool IsEmpty(); 2479 inline bool IsEmpty();
2473 2480
2474 // Returns the number of descriptors in the array. 2481 // Returns the number of descriptors in the array.
2475 int number_of_descriptors() { 2482 int number_of_descriptors() {
2476 ASSERT(length() >= kFirstIndex || IsEmpty()); 2483 ASSERT(length() >= kFirstIndex || IsEmpty());
2477 int len = length(); 2484 int len = length();
2478 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kDescriptorSize; 2485 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kDescriptorSize;
2479 } 2486 }
2480 2487
2481 inline int number_of_entries() { return number_of_descriptors(); } 2488 inline int number_of_entries() { return number_of_descriptors(); }
2482 inline int NextEnumerationIndex() { return number_of_descriptors() + 1; }
2483 2489
2484 bool HasEnumCache() { 2490 bool HasEnumCache() {
2485 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi(); 2491 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi();
2486 } 2492 }
2487 2493
2494 void CopyEnumCacheFrom(DescriptorArray* array) {
2495 set(kEnumCacheIndex, array->get(kEnumCacheIndex));
2496 }
2497
2488 Object* GetEnumCache() { 2498 Object* GetEnumCache() {
2489 ASSERT(HasEnumCache()); 2499 ASSERT(HasEnumCache());
2490 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); 2500 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex));
2491 return bridge->get(kEnumCacheBridgeCacheIndex); 2501 return bridge->get(kEnumCacheBridgeCacheIndex);
2492 } 2502 }
2493 2503
2494 Object** GetEnumCacheSlot() { 2504 Object** GetEnumCacheSlot() {
2495 ASSERT(HasEnumCache()); 2505 ASSERT(HasEnumCache());
2496 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), 2506 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
2497 kEnumCacheOffset); 2507 kEnumCacheOffset);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2532 const WhitenessWitness&, 2542 const WhitenessWitness&,
2533 int number_of_set_descriptors); 2543 int number_of_set_descriptors);
2534 2544
2535 // Transfer a complete descriptor from the src descriptor array to this 2545 // Transfer a complete descriptor from the src descriptor array to this
2536 // descriptor array. 2546 // descriptor array.
2537 void CopyFrom(int dst_index, 2547 void CopyFrom(int dst_index,
2538 DescriptorArray* src, 2548 DescriptorArray* src,
2539 int src_index, 2549 int src_index,
2540 const WhitenessWitness&); 2550 const WhitenessWitness&);
2541 2551
2552 MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index);
2553
2542 // Sort the instance descriptors by the hash codes of their keys. 2554 // Sort the instance descriptors by the hash codes of their keys.
2543 void Sort(); 2555 void Sort();
2544 inline void SwapSortedKeys(int first, int second);
2545 2556
2546 // Search the instance descriptors for given name. 2557 // Search the instance descriptors for given name.
2547 INLINE(int Search(String* name)); 2558 INLINE(int Search(String* name, int number_of_own_descriptors));
2548 2559
2549 // As the above, but uses DescriptorLookupCache and updates it when 2560 // As the above, but uses DescriptorLookupCache and updates it when
2550 // necessary. 2561 // necessary.
2551 INLINE(int SearchWithCache(String* name)); 2562 INLINE(int SearchWithCache(String* name, Map* map));
2552
2553 // Tells whether the name is present int the array.
2554 bool Contains(String* name) { return kNotFound != Search(name); }
2555 2563
2556 // Allocates a DescriptorArray, but returns the singleton 2564 // Allocates a DescriptorArray, but returns the singleton
2557 // empty descriptor array object if number_of_descriptors is 0. 2565 // empty descriptor array object if number_of_descriptors is 0.
2558 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors); 2566 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors);
2559 2567
2560 // Casting. 2568 // Casting.
2561 static inline DescriptorArray* cast(Object* obj); 2569 static inline DescriptorArray* cast(Object* obj);
2562 2570
2563 // Constant for denoting key was not found. 2571 // Constant for denoting key was not found.
2564 static const int kNotFound = -1; 2572 static const int kNotFound = -1;
(...skipping 22 matching lines...) Expand all
2587 #ifdef OBJECT_PRINT 2595 #ifdef OBJECT_PRINT
2588 // Print all the descriptors. 2596 // Print all the descriptors.
2589 inline void PrintDescriptors() { 2597 inline void PrintDescriptors() {
2590 PrintDescriptors(stdout); 2598 PrintDescriptors(stdout);
2591 } 2599 }
2592 void PrintDescriptors(FILE* out); 2600 void PrintDescriptors(FILE* out);
2593 #endif 2601 #endif
2594 2602
2595 #ifdef DEBUG 2603 #ifdef DEBUG
2596 // Is the descriptor array sorted and without duplicates? 2604 // Is the descriptor array sorted and without duplicates?
2597 bool IsSortedNoDuplicates(); 2605 bool IsSortedNoDuplicates(int valid_descriptors = -1);
2598 2606
2599 // Is the descriptor array consistent with the back pointers in targets? 2607 // Is the descriptor array consistent with the back pointers in targets?
2600 bool IsConsistentWithBackPointers(Map* current_map); 2608 bool IsConsistentWithBackPointers(Map* current_map);
2601 2609
2602 // Are two DescriptorArrays equal? 2610 // Are two DescriptorArrays equal?
2603 bool IsEqualTo(DescriptorArray* other); 2611 bool IsEqualTo(DescriptorArray* other);
2604 #endif 2612 #endif
2605 2613
2606 // The maximum number of descriptors we want in a descriptor array (should 2614 // The maximum number of descriptors we want in a descriptor array (should
2607 // fit in a page). 2615 // fit in a page).
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 (descriptor_number * kDescriptorSize) + 2648 (descriptor_number * kDescriptorSize) +
2641 kDescriptorDetails; 2649 kDescriptorDetails;
2642 } 2650 }
2643 2651
2644 static int ToValueIndex(int descriptor_number) { 2652 static int ToValueIndex(int descriptor_number) {
2645 return kFirstIndex + 2653 return kFirstIndex +
2646 (descriptor_number * kDescriptorSize) + 2654 (descriptor_number * kDescriptorSize) +
2647 kDescriptorValue; 2655 kDescriptorValue;
2648 } 2656 }
2649 2657
2650 // Swap operation on FixedArray without using write barriers.
2651 static inline void NoIncrementalWriteBarrierSwap(
2652 FixedArray* array, int first, int second);
2653
2654 // Swap first and second descriptor. 2658 // Swap first and second descriptor.
2655 inline void NoIncrementalWriteBarrierSwapDescriptors( 2659 inline void SwapSortedKeys(int first, int second);
2656 int first, int second);
2657 2660
2658 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); 2661 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray);
2659 }; 2662 };
2660 2663
2661 2664
2662 template<typename T> 2665 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES };
2663 inline int LinearSearch(T* array, String* name, int len); 2666
2667 template<SearchMode search_mode, typename T>
2668 inline int LinearSearch(T* array, String* name, int len, int valid_entries);
2664 2669
2665 2670
2666 template<typename T> 2671 template<SearchMode search_mode, typename T>
2667 inline int Search(T* array, String* name); 2672 inline int Search(T* array, String* name, int valid_entries = 0);
2668 2673
2669 2674
2670 // HashTable is a subclass of FixedArray that implements a hash table 2675 // HashTable is a subclass of FixedArray that implements a hash table
2671 // that uses open addressing and quadratic probing. 2676 // that uses open addressing and quadratic probing.
2672 // 2677 //
2673 // In order for the quadratic probing to work, elements that have not 2678 // In order for the quadratic probing to work, elements that have not
2674 // yet been used and elements that have been deleted are 2679 // yet been used and elements that have been deleted are
2675 // distinguished. Probing continues when deleted elements are 2680 // distinguished. Probing continues when deleted elements are
2676 // encountered and stops when unused elements are encountered. 2681 // encountered and stops when unused elements are encountered.
2677 // 2682 //
(...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after
4663 4668
4664 // Bit field 3. 4669 // Bit field 3.
4665 inline int bit_field3(); 4670 inline int bit_field3();
4666 inline void set_bit_field3(int value); 4671 inline void set_bit_field3(int value);
4667 4672
4668 class EnumLengthBits: public BitField<int, 0, 11> {}; 4673 class EnumLengthBits: public BitField<int, 0, 11> {};
4669 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; 4674 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {};
4670 class IsShared: public BitField<bool, 22, 1> {}; 4675 class IsShared: public BitField<bool, 22, 1> {};
4671 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; 4676 class FunctionWithPrototype: public BitField<bool, 23, 1> {};
4672 class DictionaryMap: public BitField<bool, 24, 1> {}; 4677 class DictionaryMap: public BitField<bool, 24, 1> {};
4678 class OwnsDescriptors: public BitField<bool, 25, 1> {};
4673 4679
4674 // Tells whether the object in the prototype property will be used 4680 // Tells whether the object in the prototype property will be used
4675 // for instances created from this function. If the prototype 4681 // for instances created from this function. If the prototype
4676 // property is set to a value that is not a JSObject, the prototype 4682 // property is set to a value that is not a JSObject, the prototype
4677 // property will not be used to create instances of the function. 4683 // property will not be used to create instances of the function.
4678 // See ECMA-262, 13.2.2. 4684 // See ECMA-262, 13.2.2.
4679 inline void set_non_instance_prototype(bool value); 4685 inline void set_non_instance_prototype(bool value);
4680 inline bool has_non_instance_prototype(); 4686 inline bool has_non_instance_prototype();
4681 4687
4682 // Tells whether function has special prototype property. If not, prototype 4688 // Tells whether function has special prototype property. If not, prototype
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
4783 } 4789 }
4784 4790
4785 inline bool has_slow_elements_kind() { 4791 inline bool has_slow_elements_kind() {
4786 return elements_kind() == DICTIONARY_ELEMENTS 4792 return elements_kind() == DICTIONARY_ELEMENTS
4787 || elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS; 4793 || elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS;
4788 } 4794 }
4789 4795
4790 static bool IsValidElementsTransition(ElementsKind from_kind, 4796 static bool IsValidElementsTransition(ElementsKind from_kind,
4791 ElementsKind to_kind); 4797 ElementsKind to_kind);
4792 4798
4799 bool StoresOwnDescriptors() { return HasTransitionArray(); }
4793 inline bool HasTransitionArray(); 4800 inline bool HasTransitionArray();
4794 inline bool HasElementsTransition(); 4801 inline bool HasElementsTransition();
4795 inline Map* elements_transition_map(); 4802 inline Map* elements_transition_map();
4796 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( 4803 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map(
4797 Map* transitioned_map); 4804 Map* transitioned_map);
4798 inline void SetTransition(int index, Map* target); 4805 inline void SetTransition(int transition_index, Map* target);
4806 inline Map* GetTransition(int transition_index);
4799 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target); 4807 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target);
4800 DECL_ACCESSORS(transitions, TransitionArray) 4808 DECL_ACCESSORS(transitions, TransitionArray)
4801 inline void ClearTransitions(Heap* heap, 4809 inline void ClearTransitions(Heap* heap,
4802 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); 4810 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
4803 4811
4804 // Tells whether the map is attached to SharedFunctionInfo 4812 // Tells whether the map is attached to SharedFunctionInfo
4805 // (for inobject slack tracking). 4813 // (for inobject slack tracking).
4806 inline void set_attached_to_shared_function_info(bool value); 4814 inline void set_attached_to_shared_function_info(bool value);
4807 4815
4808 inline bool attached_to_shared_function_info(); 4816 inline bool attached_to_shared_function_info();
(...skipping 19 matching lines...) Expand all
4828 // [prototype]: implicit prototype object. 4836 // [prototype]: implicit prototype object.
4829 DECL_ACCESSORS(prototype, Object) 4837 DECL_ACCESSORS(prototype, Object)
4830 4838
4831 // [constructor]: points back to the function responsible for this map. 4839 // [constructor]: points back to the function responsible for this map.
4832 DECL_ACCESSORS(constructor, Object) 4840 DECL_ACCESSORS(constructor, Object)
4833 4841
4834 inline JSFunction* unchecked_constructor(); 4842 inline JSFunction* unchecked_constructor();
4835 4843
4836 // [instance descriptors]: describes the object. 4844 // [instance descriptors]: describes the object.
4837 inline DescriptorArray* instance_descriptors(); 4845 inline DescriptorArray* instance_descriptors();
4846 inline JSGlobalPropertyCell* descriptors_pointer();
4838 MUST_USE_RESULT inline MaybeObject* SetDescriptors( 4847 MUST_USE_RESULT inline MaybeObject* SetDescriptors(
4839 DescriptorArray* descriptors, 4848 DescriptorArray* descriptors);
4840 WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
4841 static void SetDescriptors(Handle<Map> map, 4849 static void SetDescriptors(Handle<Map> map,
4842 Handle<DescriptorArray> descriptors); 4850 Handle<DescriptorArray> descriptors);
4843 MUST_USE_RESULT inline MaybeObject* InitializeDescriptors( 4851 MUST_USE_RESULT inline MaybeObject* InitializeDescriptors(
4844 DescriptorArray* descriptors); 4852 DescriptorArray* descriptors);
4845 4853
4846 // [stub cache]: contains stubs compiled for this map. 4854 // [stub cache]: contains stubs compiled for this map.
4847 DECL_ACCESSORS(code_cache, Object) 4855 DECL_ACCESSORS(code_cache, Object)
4848 4856
4849 // [back pointer]: points back to the parent map from which a transition 4857 // [back pointer]: points back to the parent map from which a transition
4850 // leads to this map. The field overlaps with prototype transitions and the 4858 // leads to this map. The field overlaps with prototype transitions and the
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
4911 int number_of_own_descriptors = NumberOfOwnDescriptors(); 4919 int number_of_own_descriptors = NumberOfOwnDescriptors();
4912 ASSERT(number_of_own_descriptors > 0); 4920 ASSERT(number_of_own_descriptors > 0);
4913 return number_of_own_descriptors - 1; 4921 return number_of_own_descriptors - 1;
4914 } 4922 }
4915 4923
4916 int NumberOfOwnDescriptors() { 4924 int NumberOfOwnDescriptors() {
4917 return NumberOfOwnDescriptorsBits::decode(bit_field3()); 4925 return NumberOfOwnDescriptorsBits::decode(bit_field3());
4918 } 4926 }
4919 4927
4920 void SetNumberOfOwnDescriptors(int number) { 4928 void SetNumberOfOwnDescriptors(int number) {
4929 ASSERT(number <= instance_descriptors()->number_of_descriptors());
4921 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number)); 4930 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
4922 } 4931 }
4923 4932
4933 inline JSGlobalPropertyCell* RetrieveDescriptorsPointer();
4934
4924 int EnumLength() { 4935 int EnumLength() {
4925 return EnumLengthBits::decode(bit_field3()); 4936 return EnumLengthBits::decode(bit_field3());
4926 } 4937 }
4927 4938
4928 void SetEnumLength(int index) { 4939 void SetEnumLength(int length) {
4929 set_bit_field3(EnumLengthBits::update(bit_field3(), index)); 4940 if (length != kInvalidEnumCache) {
4941 ASSERT(length >= 0);
4942 ASSERT(length == 0 || instance_descriptors()->HasEnumCache());
4943 ASSERT(length <= NumberOfOwnDescriptors());
4944 }
4945 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
4930 } 4946 }
4931 4947
4948
4949 inline bool owns_descriptors();
4950 inline void set_owns_descriptors(bool is_shared);
4951
4932 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); 4952 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size);
4933 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); 4953 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors();
4934 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); 4954 MUST_USE_RESULT MaybeObject* CopyDropDescriptors();
4935 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( 4955 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors(
4936 DescriptorArray* descriptors, 4956 DescriptorArray* descriptors,
4937 String* name, 4957 String* name,
4938 TransitionFlag flag); 4958 TransitionFlag flag);
4959 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor);
4939 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, 4960 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor,
4940 TransitionFlag flag); 4961 TransitionFlag flag);
4941 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, 4962 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor,
4942 TransitionFlag flag); 4963 TransitionFlag flag);
4943 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, 4964 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor,
4944 int index, 4965 int index,
4945 TransitionFlag flag); 4966 TransitionFlag flag);
4946 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, 4967 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind,
4947 TransitionFlag flag); 4968 TransitionFlag flag);
4948 4969
4949 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, 4970 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode,
4950 NormalizedMapSharingMode sharing); 4971 NormalizedMapSharingMode sharing);
4951 4972
4952 inline void AppendDescriptor(Descriptor* desc, 4973 inline void AppendDescriptor(Descriptor* desc,
4953 const DescriptorArray::WhitenessWitness&); 4974 const DescriptorArray::WhitenessWitness&);
4954 4975
4955 // Returns a copy of the map, with all transitions dropped from the 4976 // Returns a copy of the map, with all transitions dropped from the
4956 // instance descriptors. 4977 // instance descriptors.
4957 MUST_USE_RESULT MaybeObject* Copy(); 4978 MUST_USE_RESULT MaybeObject* Copy();
4958 4979
4959 // Returns the property index for name (only valid for FAST MODE). 4980 // Returns the property index for name (only valid for FAST MODE).
4960 int PropertyIndexFor(String* name); 4981 int PropertyIndexFor(String* name);
4961 4982
4962 // Returns the next free property index (only valid for FAST MODE). 4983 // Returns the next free property index (only valid for FAST MODE).
4963 int NextFreePropertyIndex(); 4984 int NextFreePropertyIndex();
4964 4985
4965 // Returns the number of properties described in instance_descriptors 4986 // Returns the number of properties described in instance_descriptors
4966 // filtering out properties with the specified attributes. 4987 // filtering out properties with the specified attributes.
4967 int NumberOfDescribedProperties(PropertyAttributes filter = NONE); 4988 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS,
4989 PropertyAttributes filter = NONE);
4968 4990
4969 // Casting. 4991 // Casting.
4970 static inline Map* cast(Object* obj); 4992 static inline Map* cast(Object* obj);
4971 4993
4972 // Locate an accessor in the instance descriptor. 4994 // Locate an accessor in the instance descriptor.
4973 AccessorDescriptor* FindAccessor(String* name); 4995 AccessorDescriptor* FindAccessor(String* name);
4974 4996
4975 // Code cache operations. 4997 // Code cache operations.
4976 4998
4977 // Clears the code cache. 4999 // Clears the code cache.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
5061 // and the values are the maps the are transitioned to. 5083 // and the values are the maps the are transitioned to.
5062 static const int kMaxCachedPrototypeTransitions = 256; 5084 static const int kMaxCachedPrototypeTransitions = 256;
5063 5085
5064 Map* GetPrototypeTransition(Object* prototype); 5086 Map* GetPrototypeTransition(Object* prototype);
5065 5087
5066 MUST_USE_RESULT MaybeObject* PutPrototypeTransition(Object* prototype, 5088 MUST_USE_RESULT MaybeObject* PutPrototypeTransition(Object* prototype,
5067 Map* map); 5089 Map* map);
5068 5090
5069 static const int kMaxPreAllocatedPropertyFields = 255; 5091 static const int kMaxPreAllocatedPropertyFields = 255;
5070 5092
5071 // Constant for denoting that the Enum Cache field was not yet used. 5093 // Constant for denoting that the enum cache is not yet initialized.
5072 static const int kInvalidEnumCache = EnumLengthBits::kMax; 5094 static const int kInvalidEnumCache = EnumLengthBits::kMax;
5073 5095
5074 // Layout description. 5096 // Layout description.
5075 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; 5097 static const int kInstanceSizesOffset = HeapObject::kHeaderSize;
5076 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; 5098 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize;
5077 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; 5099 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize;
5078 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; 5100 static const int kConstructorOffset = kPrototypeOffset + kPointerSize;
5079 // Storage for the transition array is overloaded to directly contain a back 5101 // Storage for the transition array is overloaded to directly contain a back
5080 // pointer if unused. When the map has transitions, the back pointer is 5102 // pointer if unused. When the map has transitions, the back pointer is
5081 // transferred to the transition array and accessed through an extra 5103 // transferred to the transition array and accessed through an extra
(...skipping 3868 matching lines...) Expand 10 before | Expand all | Expand 10 after
8950 } else { 8972 } else {
8951 value &= ~(1 << bit_position); 8973 value &= ~(1 << bit_position);
8952 } 8974 }
8953 return value; 8975 return value;
8954 } 8976 }
8955 }; 8977 };
8956 8978
8957 } } // namespace v8::internal 8979 } } // namespace v8::internal
8958 8980
8959 #endif // V8_OBJECTS_H_ 8981 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698