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

Side by Side Diff: src/objects.h

Issue 1221713003: Distinguish slow from fast sloppy arguments (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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
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 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 inline bool HasFixedArrayElements(); 1819 inline bool HasFixedArrayElements();
1820 inline bool HasFixedInt8Elements(); 1820 inline bool HasFixedInt8Elements();
1821 inline bool HasFixedUint8Elements(); 1821 inline bool HasFixedUint8Elements();
1822 inline bool HasFixedInt16Elements(); 1822 inline bool HasFixedInt16Elements();
1823 inline bool HasFixedUint16Elements(); 1823 inline bool HasFixedUint16Elements();
1824 inline bool HasFixedInt32Elements(); 1824 inline bool HasFixedInt32Elements();
1825 inline bool HasFixedUint32Elements(); 1825 inline bool HasFixedUint32Elements();
1826 inline bool HasFixedFloat32Elements(); 1826 inline bool HasFixedFloat32Elements();
1827 inline bool HasFixedFloat64Elements(); 1827 inline bool HasFixedFloat64Elements();
1828 1828
1829 bool HasFastArgumentsElements(); 1829 inline bool HasFastArgumentsElements();
1830 bool HasDictionaryArgumentsElements(); 1830 inline bool HasSlowArgumentsElements();
1831 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements. 1831 inline SeededNumberDictionary* element_dictionary(); // Gets slow elements.
1832 1832
1833 // Requires: HasFastElements(). 1833 // Requires: HasFastElements().
1834 static Handle<FixedArray> EnsureWritableFastElements( 1834 static Handle<FixedArray> EnsureWritableFastElements(
1835 Handle<JSObject> object); 1835 Handle<JSObject> object);
1836 1836
1837 // Collects elements starting at index 0. 1837 // Collects elements starting at index 0.
1838 // Undefined values are placed after non-undefined values. 1838 // Undefined values are placed after non-undefined values.
1839 // Returns the number of non-undefined values. 1839 // Returns the number of non-undefined values.
1840 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object, 1840 static Handle<Object> PrepareElementsForSort(Handle<JSObject> object,
(...skipping 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after
5695 5695
5696 inline bool has_fast_double_elements() { 5696 inline bool has_fast_double_elements() {
5697 return IsFastDoubleElementsKind(elements_kind()); 5697 return IsFastDoubleElementsKind(elements_kind());
5698 } 5698 }
5699 5699
5700 inline bool has_fast_elements() { 5700 inline bool has_fast_elements() {
5701 return IsFastElementsKind(elements_kind()); 5701 return IsFastElementsKind(elements_kind());
5702 } 5702 }
5703 5703
5704 inline bool has_sloppy_arguments_elements() { 5704 inline bool has_sloppy_arguments_elements() {
5705 return elements_kind() == SLOPPY_ARGUMENTS_ELEMENTS; 5705 return elements_kind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS ||
Igor Sheludko 2015/07/02 13:28:42 return IsSloppyArgumentsElements(elements_kind());
Toon Verwaest 2015/07/02 13:49:02 Done.
5706 elements_kind() == SLOW_SLOPPY_ARGUMENTS_ELEMENTS;
5706 } 5707 }
5707 5708
5708 inline bool has_external_array_elements() { 5709 inline bool has_external_array_elements() {
5709 return IsExternalArrayElementsKind(elements_kind()); 5710 return IsExternalArrayElementsKind(elements_kind());
5710 } 5711 }
5711 5712
5712 inline bool has_fixed_typed_array_elements() { 5713 inline bool has_fixed_typed_array_elements() {
5713 return IsFixedTypedArrayElementsKind(elements_kind()); 5714 return IsFixedTypedArrayElementsKind(elements_kind());
5714 } 5715 }
5715 5716
5716 inline bool has_dictionary_elements() { 5717 inline bool has_dictionary_elements() {
5717 return IsDictionaryElementsKind(elements_kind()); 5718 return IsDictionaryElementsKind(elements_kind());
5718 } 5719 }
5719 5720
5720 inline bool has_slow_elements_kind() {
5721 return elements_kind() == DICTIONARY_ELEMENTS
5722 || elements_kind() == SLOPPY_ARGUMENTS_ELEMENTS;
5723 }
5724
5725 static bool IsValidElementsTransition(ElementsKind from_kind, 5721 static bool IsValidElementsTransition(ElementsKind from_kind,
5726 ElementsKind to_kind); 5722 ElementsKind to_kind);
5727 5723
5728 // Returns true if the current map doesn't have DICTIONARY_ELEMENTS but if a 5724 // Returns true if the current map doesn't have DICTIONARY_ELEMENTS but if a
5729 // map with DICTIONARY_ELEMENTS was found in the prototype chain. 5725 // map with DICTIONARY_ELEMENTS was found in the prototype chain.
5730 bool DictionaryElementsInPrototypeChainOnly(); 5726 bool DictionaryElementsInPrototypeChainOnly();
5731 5727
5732 inline Map* ElementsTransitionMap(); 5728 inline Map* ElementsTransitionMap();
5733 5729
5734 inline FixedArrayBase* GetInitialElements(); 5730 inline FixedArrayBase* GetInitialElements();
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
6039 6035
6040 // Returns the map that this map transitions to if its elements_kind 6036 // Returns the map that this map transitions to if its elements_kind
6041 // is changed to |elements_kind|, or NULL if no such map is cached yet. 6037 // is changed to |elements_kind|, or NULL if no such map is cached yet.
6042 // |safe_to_add_transitions| is set to false if adding transitions is not 6038 // |safe_to_add_transitions| is set to false if adding transitions is not
6043 // allowed. 6039 // allowed.
6044 Map* LookupElementsTransitionMap(ElementsKind elements_kind); 6040 Map* LookupElementsTransitionMap(ElementsKind elements_kind);
6045 6041
6046 // Returns the transitioned map for this map with the most generic 6042 // Returns the transitioned map for this map with the most generic
6047 // elements_kind that's found in |candidates|, or null handle if no match is 6043 // elements_kind that's found in |candidates|, or null handle if no match is
6048 // found at all. 6044 // found at all.
6049 Handle<Map> FindTransitionedMap(MapHandleList* candidates); 6045 static Handle<Map> FindTransitionedMap(Handle<Map> map,
6046 MapHandleList* candidates);
6050 6047
6051 bool CanTransition() { 6048 bool CanTransition() {
6052 // Only JSObject and subtypes have map transitions and back pointers. 6049 // Only JSObject and subtypes have map transitions and back pointers.
6053 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE); 6050 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
6054 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6051 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6055 } 6052 }
6056 6053
6057 bool IsJSObjectMap() { 6054 bool IsJSObjectMap() {
6058 return instance_type() >= FIRST_JS_OBJECT_TYPE; 6055 return instance_type() >= FIRST_JS_OBJECT_TYPE;
6059 } 6056 }
(...skipping 4757 matching lines...) Expand 10 before | Expand all | Expand 10 after
10817 } else { 10814 } else {
10818 value &= ~(1 << bit_position); 10815 value &= ~(1 << bit_position);
10819 } 10816 }
10820 return value; 10817 return value;
10821 } 10818 }
10822 }; 10819 };
10823 10820
10824 } } // namespace v8::internal 10821 } } // namespace v8::internal
10825 10822
10826 #endif // V8_OBJECTS_H_ 10823 #endif // V8_OBJECTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698