OLD | NEW |
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 "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 OMIT_EXTENSIBILITY_CHECK | 1927 OMIT_EXTENSIBILITY_CHECK |
1928 }; | 1928 }; |
1929 | 1929 |
1930 DECLARE_CAST(JSReceiver) | 1930 DECLARE_CAST(JSReceiver) |
1931 | 1931 |
1932 // Implementation of [[Put]], ECMA-262 5th edition, section 8.12.5. | 1932 // Implementation of [[Put]], ECMA-262 5th edition, section 8.12.5. |
1933 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 1933 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
1934 Handle<JSReceiver> object, | 1934 Handle<JSReceiver> object, |
1935 Handle<Name> key, | 1935 Handle<Name> key, |
1936 Handle<Object> value, | 1936 Handle<Object> value, |
1937 PropertyAttributes attributes, | |
1938 StrictMode strict_mode, | 1937 StrictMode strict_mode, |
1939 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 1938 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
1940 MUST_USE_RESULT static MaybeHandle<Object> SetElement( | 1939 MUST_USE_RESULT static MaybeHandle<Object> SetElement( |
1941 Handle<JSReceiver> object, | 1940 Handle<JSReceiver> object, |
1942 uint32_t index, | 1941 uint32_t index, |
1943 Handle<Object> value, | 1942 Handle<Object> value, |
1944 PropertyAttributes attributes, | 1943 PropertyAttributes attributes, |
1945 StrictMode strict_mode); | 1944 StrictMode strict_mode); |
1946 | 1945 |
1947 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. | 1946 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( | 2012 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( |
2014 Handle<JSReceiver> object, | 2013 Handle<JSReceiver> object, |
2015 KeyCollectionType type); | 2014 KeyCollectionType type); |
2016 | 2015 |
2017 private: | 2016 private: |
2018 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 2017 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
2019 Handle<JSReceiver> receiver, | 2018 Handle<JSReceiver> receiver, |
2020 LookupResult* result, | 2019 LookupResult* result, |
2021 Handle<Name> key, | 2020 Handle<Name> key, |
2022 Handle<Object> value, | 2021 Handle<Object> value, |
2023 PropertyAttributes attributes, | |
2024 StrictMode strict_mode, | 2022 StrictMode strict_mode, |
2025 StoreFromKeyed store_from_keyed); | 2023 StoreFromKeyed store_from_keyed); |
2026 | 2024 |
2027 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); | 2025 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
2028 }; | 2026 }; |
2029 | 2027 |
2030 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. | 2028 // Forward declaration for JSObject::GetOrCreateHiddenPropertiesHashTable. |
2031 class ObjectHashTable; | 2029 class ObjectHashTable; |
2032 | 2030 |
2033 // Forward declaration for JSObject::Copy. | 2031 // Forward declaration for JSObject::Copy. |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2132 // As PrepareElementsForSort, but only on objects where elements is | 2130 // As PrepareElementsForSort, but only on objects where elements is |
2133 // a dictionary, and it will stay a dictionary. Collates undefined and | 2131 // a dictionary, and it will stay a dictionary. Collates undefined and |
2134 // unexisting elements below limit from position zero of the elements. | 2132 // unexisting elements below limit from position zero of the elements. |
2135 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, | 2133 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, |
2136 uint32_t limit); | 2134 uint32_t limit); |
2137 | 2135 |
2138 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithInterceptor( | 2136 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithInterceptor( |
2139 Handle<JSObject> object, | 2137 Handle<JSObject> object, |
2140 Handle<Name> name, | 2138 Handle<Name> name, |
2141 Handle<Object> value, | 2139 Handle<Object> value, |
2142 PropertyAttributes attributes, | |
2143 StrictMode strict_mode); | 2140 StrictMode strict_mode); |
2144 | 2141 |
2145 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyForResult( | 2142 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyForResult( |
2146 Handle<JSObject> object, | 2143 Handle<JSObject> object, |
2147 LookupResult* result, | 2144 LookupResult* result, |
2148 Handle<Name> name, | 2145 Handle<Name> name, |
2149 Handle<Object> value, | 2146 Handle<Object> value, |
2150 PropertyAttributes attributes, | |
2151 StrictMode strict_mode, | 2147 StrictMode strict_mode, |
2152 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 2148 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
2153 | 2149 |
2154 // SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to | 2150 // SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to |
2155 // grant an exemption to ExecutableAccessor callbacks in some cases. | 2151 // grant an exemption to ExecutableAccessor callbacks in some cases. |
2156 enum ExecutableAccessorInfoHandling { | 2152 enum ExecutableAccessorInfoHandling { |
2157 DEFAULT_HANDLING, | 2153 DEFAULT_HANDLING, |
2158 DONT_FORCE_FIELD | 2154 DONT_FORCE_FIELD |
2159 }; | 2155 }; |
2160 | 2156 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 bool check_prototype = true); | 2733 bool check_prototype = true); |
2738 | 2734 |
2739 // Searches the prototype chain for property 'name'. If it is found and | 2735 // Searches the prototype chain for property 'name'. If it is found and |
2740 // has a setter, invoke it and set '*done' to true. If it is found and is | 2736 // has a setter, invoke it and set '*done' to true. If it is found and is |
2741 // read-only, reject and set '*done' to true. Otherwise, set '*done' to | 2737 // read-only, reject and set '*done' to true. Otherwise, set '*done' to |
2742 // false. Can throw and return an empty handle with '*done==true'. | 2738 // false. Can throw and return an empty handle with '*done==true'. |
2743 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyViaPrototypes( | 2739 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyViaPrototypes( |
2744 Handle<JSObject> object, | 2740 Handle<JSObject> object, |
2745 Handle<Name> name, | 2741 Handle<Name> name, |
2746 Handle<Object> value, | 2742 Handle<Object> value, |
2747 PropertyAttributes attributes, | |
2748 StrictMode strict_mode, | 2743 StrictMode strict_mode, |
2749 bool* done); | 2744 bool* done); |
2750 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyPostInterceptor( | 2745 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyPostInterceptor( |
2751 Handle<JSObject> object, | 2746 Handle<JSObject> object, |
2752 Handle<Name> name, | 2747 Handle<Name> name, |
2753 Handle<Object> value, | 2748 Handle<Object> value, |
2754 PropertyAttributes attributes, | |
2755 StrictMode strict_mode); | 2749 StrictMode strict_mode); |
2756 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyUsingTransition( | 2750 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyUsingTransition( |
2757 Handle<JSObject> object, | 2751 Handle<JSObject> object, |
2758 LookupResult* lookup, | 2752 LookupResult* lookup, |
2759 Handle<Name> name, | 2753 Handle<Name> name, |
2760 Handle<Object> value, | 2754 Handle<Object> value, |
2761 PropertyAttributes attributes); | 2755 PropertyAttributes attributes); |
2762 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( | 2756 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( |
2763 Handle<JSObject> object, | 2757 Handle<JSObject> object, |
2764 LookupResult* result, | 2758 LookupResult* result, |
(...skipping 7187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9952 // If the handler defines an accessor property with a setter, invoke it. | 9946 // If the handler defines an accessor property with a setter, invoke it. |
9953 // If it defines an accessor property without a setter, or a data property | 9947 // If it defines an accessor property without a setter, or a data property |
9954 // that is read-only, throw. In all these cases set '*done' to true, | 9948 // that is read-only, throw. In all these cases set '*done' to true, |
9955 // otherwise set it to false. | 9949 // otherwise set it to false. |
9956 MUST_USE_RESULT | 9950 MUST_USE_RESULT |
9957 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( | 9951 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( |
9958 Handle<JSProxy> proxy, | 9952 Handle<JSProxy> proxy, |
9959 Handle<JSReceiver> receiver, | 9953 Handle<JSReceiver> receiver, |
9960 Handle<Name> name, | 9954 Handle<Name> name, |
9961 Handle<Object> value, | 9955 Handle<Object> value, |
9962 PropertyAttributes attributes, | |
9963 StrictMode strict_mode, | 9956 StrictMode strict_mode, |
9964 bool* done); | 9957 bool* done); |
9965 | 9958 |
9966 static PropertyAttributes GetPropertyAttributesWithHandler( | 9959 static PropertyAttributes GetPropertyAttributesWithHandler( |
9967 Handle<JSProxy> proxy, | 9960 Handle<JSProxy> proxy, |
9968 Handle<Object> receiver, | 9961 Handle<Object> receiver, |
9969 Handle<Name> name); | 9962 Handle<Name> name); |
9970 static PropertyAttributes GetElementAttributeWithHandler( | 9963 static PropertyAttributes GetElementAttributeWithHandler( |
9971 Handle<JSProxy> proxy, | 9964 Handle<JSProxy> proxy, |
9972 Handle<JSReceiver> receiver, | 9965 Handle<JSReceiver> receiver, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10008 kSize> BodyDescriptor; | 10001 kSize> BodyDescriptor; |
10009 | 10002 |
10010 private: | 10003 private: |
10011 friend class JSReceiver; | 10004 friend class JSReceiver; |
10012 | 10005 |
10013 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithHandler( | 10006 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithHandler( |
10014 Handle<JSProxy> proxy, | 10007 Handle<JSProxy> proxy, |
10015 Handle<JSReceiver> receiver, | 10008 Handle<JSReceiver> receiver, |
10016 Handle<Name> name, | 10009 Handle<Name> name, |
10017 Handle<Object> value, | 10010 Handle<Object> value, |
10018 PropertyAttributes attributes, | |
10019 StrictMode strict_mode); | 10011 StrictMode strict_mode); |
10020 MUST_USE_RESULT static inline MaybeHandle<Object> SetElementWithHandler( | 10012 MUST_USE_RESULT static inline MaybeHandle<Object> SetElementWithHandler( |
10021 Handle<JSProxy> proxy, | 10013 Handle<JSProxy> proxy, |
10022 Handle<JSReceiver> receiver, | 10014 Handle<JSReceiver> receiver, |
10023 uint32_t index, | 10015 uint32_t index, |
10024 Handle<Object> value, | 10016 Handle<Object> value, |
10025 StrictMode strict_mode); | 10017 StrictMode strict_mode); |
10026 | 10018 |
10027 static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name); | 10019 static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name); |
10028 static inline bool HasElementWithHandler(Handle<JSProxy> proxy, | 10020 static inline bool HasElementWithHandler(Handle<JSProxy> proxy, |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11229 } else { | 11221 } else { |
11230 value &= ~(1 << bit_position); | 11222 value &= ~(1 << bit_position); |
11231 } | 11223 } |
11232 return value; | 11224 return value; |
11233 } | 11225 } |
11234 }; | 11226 }; |
11235 | 11227 |
11236 } } // namespace v8::internal | 11228 } } // namespace v8::internal |
11237 | 11229 |
11238 #endif // V8_OBJECTS_H_ | 11230 #endif // V8_OBJECTS_H_ |
OLD | NEW |