| OLD | NEW |
| 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 Loading... |
| 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 2284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2474 inline bool IsEmpty(); | 2481 inline bool IsEmpty(); |
| 2475 | 2482 |
| 2476 // Returns the number of descriptors in the array. | 2483 // Returns the number of descriptors in the array. |
| 2477 int number_of_descriptors() { | 2484 int number_of_descriptors() { |
| 2478 ASSERT(length() >= kFirstIndex || IsEmpty()); | 2485 ASSERT(length() >= kFirstIndex || IsEmpty()); |
| 2479 int len = length(); | 2486 int len = length(); |
| 2480 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kDescriptorSize; | 2487 return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kDescriptorSize; |
| 2481 } | 2488 } |
| 2482 | 2489 |
| 2483 inline int number_of_entries() { return number_of_descriptors(); } | 2490 inline int number_of_entries() { return number_of_descriptors(); } |
| 2484 inline int NextEnumerationIndex() { return number_of_descriptors() + 1; } | |
| 2485 | 2491 |
| 2486 bool HasEnumCache() { | 2492 bool HasEnumCache() { |
| 2487 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi(); | 2493 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi(); |
| 2488 } | 2494 } |
| 2489 | 2495 |
| 2496 void CopyEnumCacheFrom(DescriptorArray* array) { |
| 2497 set(kEnumCacheIndex, array->get(kEnumCacheIndex)); |
| 2498 } |
| 2499 |
| 2490 Object* GetEnumCache() { | 2500 Object* GetEnumCache() { |
| 2491 ASSERT(HasEnumCache()); | 2501 ASSERT(HasEnumCache()); |
| 2492 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); | 2502 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex)); |
| 2493 return bridge->get(kEnumCacheBridgeCacheIndex); | 2503 return bridge->get(kEnumCacheBridgeCacheIndex); |
| 2494 } | 2504 } |
| 2495 | 2505 |
| 2496 Object** GetEnumCacheSlot() { | 2506 Object** GetEnumCacheSlot() { |
| 2497 ASSERT(HasEnumCache()); | 2507 ASSERT(HasEnumCache()); |
| 2498 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), | 2508 return HeapObject::RawField(reinterpret_cast<HeapObject*>(this), |
| 2499 kEnumCacheOffset); | 2509 kEnumCacheOffset); |
| 2500 } | 2510 } |
| 2501 | 2511 |
| 2512 void ClearEnumCache(); |
| 2513 |
| 2502 // Initialize or change the enum cache, | 2514 // Initialize or change the enum cache, |
| 2503 // using the supplied storage for the small "bridge". | 2515 // using the supplied storage for the small "bridge". |
| 2504 void SetEnumCache(FixedArray* bridge_storage, | 2516 void SetEnumCache(FixedArray* bridge_storage, |
| 2505 FixedArray* new_cache, | 2517 FixedArray* new_cache, |
| 2506 Object* new_index_cache); | 2518 Object* new_index_cache); |
| 2507 | 2519 |
| 2508 // Accessors for fetching instance descriptor at descriptor number. | 2520 // Accessors for fetching instance descriptor at descriptor number. |
| 2509 inline String* GetKey(int descriptor_number); | 2521 inline String* GetKey(int descriptor_number); |
| 2510 inline Object** GetKeySlot(int descriptor_number); | 2522 inline Object** GetKeySlot(int descriptor_number); |
| 2511 inline Object* GetValue(int descriptor_number); | 2523 inline Object* GetValue(int descriptor_number); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2534 const WhitenessWitness&, | 2546 const WhitenessWitness&, |
| 2535 int number_of_set_descriptors); | 2547 int number_of_set_descriptors); |
| 2536 | 2548 |
| 2537 // Transfer a complete descriptor from the src descriptor array to this | 2549 // Transfer a complete descriptor from the src descriptor array to this |
| 2538 // descriptor array. | 2550 // descriptor array. |
| 2539 void CopyFrom(int dst_index, | 2551 void CopyFrom(int dst_index, |
| 2540 DescriptorArray* src, | 2552 DescriptorArray* src, |
| 2541 int src_index, | 2553 int src_index, |
| 2542 const WhitenessWitness&); | 2554 const WhitenessWitness&); |
| 2543 | 2555 |
| 2556 MUST_USE_RESULT MaybeObject* CopyUpTo(int enumeration_index); |
| 2557 |
| 2544 // Sort the instance descriptors by the hash codes of their keys. | 2558 // Sort the instance descriptors by the hash codes of their keys. |
| 2545 void Sort(); | 2559 void Sort(); |
| 2546 inline void SwapSortedKeys(int first, int second); | |
| 2547 | 2560 |
| 2548 // Search the instance descriptors for given name. | 2561 // Search the instance descriptors for given name. |
| 2549 INLINE(int Search(String* name)); | 2562 INLINE(int Search(String* name, int number_of_own_descriptors)); |
| 2550 | 2563 |
| 2551 // As the above, but uses DescriptorLookupCache and updates it when | 2564 // As the above, but uses DescriptorLookupCache and updates it when |
| 2552 // necessary. | 2565 // necessary. |
| 2553 INLINE(int SearchWithCache(String* name)); | 2566 INLINE(int SearchWithCache(String* name, Map* map)); |
| 2554 | |
| 2555 // Tells whether the name is present int the array. | |
| 2556 bool Contains(String* name) { return kNotFound != Search(name); } | |
| 2557 | 2567 |
| 2558 // Allocates a DescriptorArray, but returns the singleton | 2568 // Allocates a DescriptorArray, but returns the singleton |
| 2559 // empty descriptor array object if number_of_descriptors is 0. | 2569 // empty descriptor array object if number_of_descriptors is 0. |
| 2560 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors); | 2570 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors); |
| 2561 | 2571 |
| 2562 // Casting. | 2572 // Casting. |
| 2563 static inline DescriptorArray* cast(Object* obj); | 2573 static inline DescriptorArray* cast(Object* obj); |
| 2564 | 2574 |
| 2565 // Constant for denoting key was not found. | 2575 // Constant for denoting key was not found. |
| 2566 static const int kNotFound = -1; | 2576 static const int kNotFound = -1; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2589 #ifdef OBJECT_PRINT | 2599 #ifdef OBJECT_PRINT |
| 2590 // Print all the descriptors. | 2600 // Print all the descriptors. |
| 2591 inline void PrintDescriptors() { | 2601 inline void PrintDescriptors() { |
| 2592 PrintDescriptors(stdout); | 2602 PrintDescriptors(stdout); |
| 2593 } | 2603 } |
| 2594 void PrintDescriptors(FILE* out); | 2604 void PrintDescriptors(FILE* out); |
| 2595 #endif | 2605 #endif |
| 2596 | 2606 |
| 2597 #ifdef DEBUG | 2607 #ifdef DEBUG |
| 2598 // Is the descriptor array sorted and without duplicates? | 2608 // Is the descriptor array sorted and without duplicates? |
| 2599 bool IsSortedNoDuplicates(); | 2609 bool IsSortedNoDuplicates(int valid_descriptors = -1); |
| 2600 | 2610 |
| 2601 // Is the descriptor array consistent with the back pointers in targets? | 2611 // Is the descriptor array consistent with the back pointers in targets? |
| 2602 bool IsConsistentWithBackPointers(Map* current_map); | 2612 bool IsConsistentWithBackPointers(Map* current_map); |
| 2603 | 2613 |
| 2604 // Are two DescriptorArrays equal? | 2614 // Are two DescriptorArrays equal? |
| 2605 bool IsEqualTo(DescriptorArray* other); | 2615 bool IsEqualTo(DescriptorArray* other); |
| 2606 #endif | 2616 #endif |
| 2607 | 2617 |
| 2608 // The maximum number of descriptors we want in a descriptor array (should | 2618 // The maximum number of descriptors we want in a descriptor array (should |
| 2609 // fit in a page). | 2619 // fit in a page). |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2642 (descriptor_number * kDescriptorSize) + | 2652 (descriptor_number * kDescriptorSize) + |
| 2643 kDescriptorDetails; | 2653 kDescriptorDetails; |
| 2644 } | 2654 } |
| 2645 | 2655 |
| 2646 static int ToValueIndex(int descriptor_number) { | 2656 static int ToValueIndex(int descriptor_number) { |
| 2647 return kFirstIndex + | 2657 return kFirstIndex + |
| 2648 (descriptor_number * kDescriptorSize) + | 2658 (descriptor_number * kDescriptorSize) + |
| 2649 kDescriptorValue; | 2659 kDescriptorValue; |
| 2650 } | 2660 } |
| 2651 | 2661 |
| 2652 // Swap operation on FixedArray without using write barriers. | |
| 2653 static inline void NoIncrementalWriteBarrierSwap( | |
| 2654 FixedArray* array, int first, int second); | |
| 2655 | |
| 2656 // Swap first and second descriptor. | 2662 // Swap first and second descriptor. |
| 2657 inline void NoIncrementalWriteBarrierSwapDescriptors( | 2663 inline void SwapSortedKeys(int first, int second); |
| 2658 int first, int second); | |
| 2659 | 2664 |
| 2660 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 2665 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| 2661 }; | 2666 }; |
| 2662 | 2667 |
| 2663 | 2668 |
| 2664 template<typename T> | 2669 enum SearchMode { ALL_ENTRIES, VALID_ENTRIES }; |
| 2665 inline int LinearSearch(T* array, String* name, int len); | 2670 |
| 2671 template<SearchMode search_mode, typename T> |
| 2672 inline int LinearSearch(T* array, String* name, int len, int valid_entries); |
| 2666 | 2673 |
| 2667 | 2674 |
| 2668 template<typename T> | 2675 template<SearchMode search_mode, typename T> |
| 2669 inline int Search(T* array, String* name); | 2676 inline int Search(T* array, String* name, int valid_entries = 0); |
| 2670 | 2677 |
| 2671 | 2678 |
| 2672 // HashTable is a subclass of FixedArray that implements a hash table | 2679 // HashTable is a subclass of FixedArray that implements a hash table |
| 2673 // that uses open addressing and quadratic probing. | 2680 // that uses open addressing and quadratic probing. |
| 2674 // | 2681 // |
| 2675 // In order for the quadratic probing to work, elements that have not | 2682 // In order for the quadratic probing to work, elements that have not |
| 2676 // yet been used and elements that have been deleted are | 2683 // yet been used and elements that have been deleted are |
| 2677 // distinguished. Probing continues when deleted elements are | 2684 // distinguished. Probing continues when deleted elements are |
| 2678 // encountered and stops when unused elements are encountered. | 2685 // encountered and stops when unused elements are encountered. |
| 2679 // | 2686 // |
| (...skipping 1985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4665 | 4672 |
| 4666 // Bit field 3. | 4673 // Bit field 3. |
| 4667 inline int bit_field3(); | 4674 inline int bit_field3(); |
| 4668 inline void set_bit_field3(int value); | 4675 inline void set_bit_field3(int value); |
| 4669 | 4676 |
| 4670 class EnumLengthBits: public BitField<int, 0, 11> {}; | 4677 class EnumLengthBits: public BitField<int, 0, 11> {}; |
| 4671 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; | 4678 class NumberOfOwnDescriptorsBits: public BitField<int, 11, 11> {}; |
| 4672 class IsShared: public BitField<bool, 22, 1> {}; | 4679 class IsShared: public BitField<bool, 22, 1> {}; |
| 4673 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; | 4680 class FunctionWithPrototype: public BitField<bool, 23, 1> {}; |
| 4674 class DictionaryMap: public BitField<bool, 24, 1> {}; | 4681 class DictionaryMap: public BitField<bool, 24, 1> {}; |
| 4682 class OwnsDescriptors: public BitField<bool, 25, 1> {}; |
| 4675 | 4683 |
| 4676 // Tells whether the object in the prototype property will be used | 4684 // Tells whether the object in the prototype property will be used |
| 4677 // for instances created from this function. If the prototype | 4685 // for instances created from this function. If the prototype |
| 4678 // property is set to a value that is not a JSObject, the prototype | 4686 // property is set to a value that is not a JSObject, the prototype |
| 4679 // property will not be used to create instances of the function. | 4687 // property will not be used to create instances of the function. |
| 4680 // See ECMA-262, 13.2.2. | 4688 // See ECMA-262, 13.2.2. |
| 4681 inline void set_non_instance_prototype(bool value); | 4689 inline void set_non_instance_prototype(bool value); |
| 4682 inline bool has_non_instance_prototype(); | 4690 inline bool has_non_instance_prototype(); |
| 4683 | 4691 |
| 4684 // Tells whether function has special prototype property. If not, prototype | 4692 // Tells whether function has special prototype property. If not, prototype |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4785 } | 4793 } |
| 4786 | 4794 |
| 4787 inline bool has_slow_elements_kind() { | 4795 inline bool has_slow_elements_kind() { |
| 4788 return elements_kind() == DICTIONARY_ELEMENTS | 4796 return elements_kind() == DICTIONARY_ELEMENTS |
| 4789 || elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS; | 4797 || elements_kind() == NON_STRICT_ARGUMENTS_ELEMENTS; |
| 4790 } | 4798 } |
| 4791 | 4799 |
| 4792 static bool IsValidElementsTransition(ElementsKind from_kind, | 4800 static bool IsValidElementsTransition(ElementsKind from_kind, |
| 4793 ElementsKind to_kind); | 4801 ElementsKind to_kind); |
| 4794 | 4802 |
| 4803 bool StoresOwnDescriptors() { return HasTransitionArray(); } |
| 4795 inline bool HasTransitionArray(); | 4804 inline bool HasTransitionArray(); |
| 4796 inline bool HasElementsTransition(); | 4805 inline bool HasElementsTransition(); |
| 4797 inline Map* elements_transition_map(); | 4806 inline Map* elements_transition_map(); |
| 4798 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( | 4807 MUST_USE_RESULT inline MaybeObject* set_elements_transition_map( |
| 4799 Map* transitioned_map); | 4808 Map* transitioned_map); |
| 4800 inline void SetTransition(int index, Map* target); | 4809 inline void SetTransition(int transition_index, Map* target); |
| 4810 inline Map* GetTransition(int transition_index); |
| 4801 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target); | 4811 MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target); |
| 4802 DECL_ACCESSORS(transitions, TransitionArray) | 4812 DECL_ACCESSORS(transitions, TransitionArray) |
| 4803 inline void ClearTransitions(Heap* heap, | 4813 inline void ClearTransitions(Heap* heap, |
| 4804 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 4814 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 4805 | 4815 |
| 4806 // Tells whether the map is attached to SharedFunctionInfo | 4816 // Tells whether the map is attached to SharedFunctionInfo |
| 4807 // (for inobject slack tracking). | 4817 // (for inobject slack tracking). |
| 4808 inline void set_attached_to_shared_function_info(bool value); | 4818 inline void set_attached_to_shared_function_info(bool value); |
| 4809 | 4819 |
| 4810 inline bool attached_to_shared_function_info(); | 4820 inline bool attached_to_shared_function_info(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4830 // [prototype]: implicit prototype object. | 4840 // [prototype]: implicit prototype object. |
| 4831 DECL_ACCESSORS(prototype, Object) | 4841 DECL_ACCESSORS(prototype, Object) |
| 4832 | 4842 |
| 4833 // [constructor]: points back to the function responsible for this map. | 4843 // [constructor]: points back to the function responsible for this map. |
| 4834 DECL_ACCESSORS(constructor, Object) | 4844 DECL_ACCESSORS(constructor, Object) |
| 4835 | 4845 |
| 4836 inline JSFunction* unchecked_constructor(); | 4846 inline JSFunction* unchecked_constructor(); |
| 4837 | 4847 |
| 4838 // [instance descriptors]: describes the object. | 4848 // [instance descriptors]: describes the object. |
| 4839 inline DescriptorArray* instance_descriptors(); | 4849 inline DescriptorArray* instance_descriptors(); |
| 4850 inline JSGlobalPropertyCell* descriptors_pointer(); |
| 4840 MUST_USE_RESULT inline MaybeObject* SetDescriptors( | 4851 MUST_USE_RESULT inline MaybeObject* SetDescriptors( |
| 4841 DescriptorArray* descriptors, | 4852 DescriptorArray* descriptors); |
| 4842 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | |
| 4843 static void SetDescriptors(Handle<Map> map, | 4853 static void SetDescriptors(Handle<Map> map, |
| 4844 Handle<DescriptorArray> descriptors); | 4854 Handle<DescriptorArray> descriptors); |
| 4845 MUST_USE_RESULT inline MaybeObject* InitializeDescriptors( | 4855 MUST_USE_RESULT inline MaybeObject* InitializeDescriptors( |
| 4846 DescriptorArray* descriptors); | 4856 DescriptorArray* descriptors); |
| 4847 | 4857 |
| 4848 // [stub cache]: contains stubs compiled for this map. | 4858 // [stub cache]: contains stubs compiled for this map. |
| 4849 DECL_ACCESSORS(code_cache, Object) | 4859 DECL_ACCESSORS(code_cache, Object) |
| 4850 | 4860 |
| 4851 // [back pointer]: points back to the parent map from which a transition | 4861 // [back pointer]: points back to the parent map from which a transition |
| 4852 // leads to this map. The field overlaps with prototype transitions and the | 4862 // leads to this map. The field overlaps with prototype transitions and the |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4913 int number_of_own_descriptors = NumberOfOwnDescriptors(); | 4923 int number_of_own_descriptors = NumberOfOwnDescriptors(); |
| 4914 ASSERT(number_of_own_descriptors > 0); | 4924 ASSERT(number_of_own_descriptors > 0); |
| 4915 return number_of_own_descriptors - 1; | 4925 return number_of_own_descriptors - 1; |
| 4916 } | 4926 } |
| 4917 | 4927 |
| 4918 int NumberOfOwnDescriptors() { | 4928 int NumberOfOwnDescriptors() { |
| 4919 return NumberOfOwnDescriptorsBits::decode(bit_field3()); | 4929 return NumberOfOwnDescriptorsBits::decode(bit_field3()); |
| 4920 } | 4930 } |
| 4921 | 4931 |
| 4922 void SetNumberOfOwnDescriptors(int number) { | 4932 void SetNumberOfOwnDescriptors(int number) { |
| 4933 ASSERT(number <= instance_descriptors()->number_of_descriptors()); |
| 4923 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number)); | 4934 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number)); |
| 4924 } | 4935 } |
| 4925 | 4936 |
| 4937 inline JSGlobalPropertyCell* RetrieveDescriptorsPointer(); |
| 4938 |
| 4926 int EnumLength() { | 4939 int EnumLength() { |
| 4927 return EnumLengthBits::decode(bit_field3()); | 4940 return EnumLengthBits::decode(bit_field3()); |
| 4928 } | 4941 } |
| 4929 | 4942 |
| 4930 void SetEnumLength(int index) { | 4943 void SetEnumLength(int length) { |
| 4931 set_bit_field3(EnumLengthBits::update(bit_field3(), index)); | 4944 if (length != kInvalidEnumCache) { |
| 4945 ASSERT(length >= 0); |
| 4946 ASSERT(length == 0 || instance_descriptors()->HasEnumCache()); |
| 4947 ASSERT(length <= NumberOfOwnDescriptors()); |
| 4948 } |
| 4949 set_bit_field3(EnumLengthBits::update(bit_field3(), length)); |
| 4932 } | 4950 } |
| 4933 | 4951 |
| 4952 |
| 4953 inline bool owns_descriptors(); |
| 4954 inline void set_owns_descriptors(bool is_shared); |
| 4955 |
| 4934 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); | 4956 MUST_USE_RESULT MaybeObject* RawCopy(int instance_size); |
| 4935 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); | 4957 MUST_USE_RESULT MaybeObject* CopyWithPreallocatedFieldDescriptors(); |
| 4936 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); | 4958 MUST_USE_RESULT MaybeObject* CopyDropDescriptors(); |
| 4937 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( | 4959 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptors( |
| 4938 DescriptorArray* descriptors, | 4960 DescriptorArray* descriptors, |
| 4939 String* name, | 4961 String* name, |
| 4940 TransitionFlag flag); | 4962 TransitionFlag flag); |
| 4963 MUST_USE_RESULT MaybeObject* ShareDescriptor(Descriptor* descriptor); |
| 4941 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, | 4964 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor, |
| 4942 TransitionFlag flag); | 4965 TransitionFlag flag); |
| 4943 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, | 4966 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor, |
| 4944 TransitionFlag flag); | 4967 TransitionFlag flag); |
| 4945 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, | 4968 MUST_USE_RESULT MaybeObject* CopyReplaceDescriptor(Descriptor* descriptor, |
| 4946 int index, | 4969 int index, |
| 4947 TransitionFlag flag); | 4970 TransitionFlag flag); |
| 4948 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, | 4971 MUST_USE_RESULT MaybeObject* CopyAsElementsKind(ElementsKind kind, |
| 4949 TransitionFlag flag); | 4972 TransitionFlag flag); |
| 4950 | 4973 |
| 4951 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, | 4974 MUST_USE_RESULT MaybeObject* CopyNormalized(PropertyNormalizationMode mode, |
| 4952 NormalizedMapSharingMode sharing); | 4975 NormalizedMapSharingMode sharing); |
| 4953 | 4976 |
| 4954 inline void AppendDescriptor(Descriptor* desc, | 4977 inline void AppendDescriptor(Descriptor* desc, |
| 4955 const DescriptorArray::WhitenessWitness&); | 4978 const DescriptorArray::WhitenessWitness&); |
| 4956 | 4979 |
| 4957 // Returns a copy of the map, with all transitions dropped from the | 4980 // Returns a copy of the map, with all transitions dropped from the |
| 4958 // instance descriptors. | 4981 // instance descriptors. |
| 4959 MUST_USE_RESULT MaybeObject* Copy(); | 4982 MUST_USE_RESULT MaybeObject* Copy(); |
| 4960 | 4983 |
| 4961 // Returns the property index for name (only valid for FAST MODE). | 4984 // Returns the property index for name (only valid for FAST MODE). |
| 4962 int PropertyIndexFor(String* name); | 4985 int PropertyIndexFor(String* name); |
| 4963 | 4986 |
| 4964 // Returns the next free property index (only valid for FAST MODE). | 4987 // Returns the next free property index (only valid for FAST MODE). |
| 4965 int NextFreePropertyIndex(); | 4988 int NextFreePropertyIndex(); |
| 4966 | 4989 |
| 4967 // Returns the number of properties described in instance_descriptors | 4990 // Returns the number of properties described in instance_descriptors |
| 4968 // filtering out properties with the specified attributes. | 4991 // filtering out properties with the specified attributes. |
| 4969 int NumberOfDescribedProperties(PropertyAttributes filter = NONE); | 4992 int NumberOfDescribedProperties(DescriptorFlag which = OWN_DESCRIPTORS, |
| 4993 PropertyAttributes filter = NONE); |
| 4970 | 4994 |
| 4971 // Casting. | 4995 // Casting. |
| 4972 static inline Map* cast(Object* obj); | 4996 static inline Map* cast(Object* obj); |
| 4973 | 4997 |
| 4974 // Locate an accessor in the instance descriptor. | 4998 // Locate an accessor in the instance descriptor. |
| 4975 AccessorDescriptor* FindAccessor(String* name); | 4999 AccessorDescriptor* FindAccessor(String* name); |
| 4976 | 5000 |
| 4977 // Code cache operations. | 5001 // Code cache operations. |
| 4978 | 5002 |
| 4979 // Clears the code cache. | 5003 // Clears the code cache. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5063 // and the values are the maps the are transitioned to. | 5087 // and the values are the maps the are transitioned to. |
| 5064 static const int kMaxCachedPrototypeTransitions = 256; | 5088 static const int kMaxCachedPrototypeTransitions = 256; |
| 5065 | 5089 |
| 5066 Map* GetPrototypeTransition(Object* prototype); | 5090 Map* GetPrototypeTransition(Object* prototype); |
| 5067 | 5091 |
| 5068 MUST_USE_RESULT MaybeObject* PutPrototypeTransition(Object* prototype, | 5092 MUST_USE_RESULT MaybeObject* PutPrototypeTransition(Object* prototype, |
| 5069 Map* map); | 5093 Map* map); |
| 5070 | 5094 |
| 5071 static const int kMaxPreAllocatedPropertyFields = 255; | 5095 static const int kMaxPreAllocatedPropertyFields = 255; |
| 5072 | 5096 |
| 5073 // Constant for denoting that the Enum Cache field was not yet used. | 5097 // Constant for denoting that the enum cache is not yet initialized. |
| 5074 static const int kInvalidEnumCache = EnumLengthBits::kMax; | 5098 static const int kInvalidEnumCache = EnumLengthBits::kMax; |
| 5075 | 5099 |
| 5076 // Layout description. | 5100 // Layout description. |
| 5077 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; | 5101 static const int kInstanceSizesOffset = HeapObject::kHeaderSize; |
| 5078 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; | 5102 static const int kInstanceAttributesOffset = kInstanceSizesOffset + kIntSize; |
| 5079 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; | 5103 static const int kPrototypeOffset = kInstanceAttributesOffset + kIntSize; |
| 5080 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; | 5104 static const int kConstructorOffset = kPrototypeOffset + kPointerSize; |
| 5081 // Storage for the transition array is overloaded to directly contain a back | 5105 // Storage for the transition array is overloaded to directly contain a back |
| 5082 // pointer if unused. When the map has transitions, the back pointer is | 5106 // pointer if unused. When the map has transitions, the back pointer is |
| 5083 // transferred to the transition array and accessed through an extra | 5107 // transferred to the transition array and accessed through an extra |
| (...skipping 3868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8952 } else { | 8976 } else { |
| 8953 value &= ~(1 << bit_position); | 8977 value &= ~(1 << bit_position); |
| 8954 } | 8978 } |
| 8955 return value; | 8979 return value; |
| 8956 } | 8980 } |
| 8957 }; | 8981 }; |
| 8958 | 8982 |
| 8959 } } // namespace v8::internal | 8983 } } // namespace v8::internal |
| 8960 | 8984 |
| 8961 #endif // V8_OBJECTS_H_ | 8985 #endif // V8_OBJECTS_H_ |
| OLD | NEW |