| 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 1936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 // Tests for the fast common case for property enumeration. | 1947 // Tests for the fast common case for property enumeration. |
| 1948 bool IsSimpleEnum(); | 1948 bool IsSimpleEnum(); |
| 1949 | 1949 |
| 1950 // Returns the class name ([[Class]] property in the specification). | 1950 // Returns the class name ([[Class]] property in the specification). |
| 1951 String* class_name(); | 1951 String* class_name(); |
| 1952 | 1952 |
| 1953 // Returns the constructor name (the name (possibly, inferred name) of the | 1953 // Returns the constructor name (the name (possibly, inferred name) of the |
| 1954 // function that was used to instantiate the object). | 1954 // function that was used to instantiate the object). |
| 1955 String* constructor_name(); | 1955 String* constructor_name(); |
| 1956 | 1956 |
| 1957 static inline PropertyAttributes GetPropertyAttribute( | 1957 static inline PropertyAttributes GetPropertyAttributes( |
| 1958 Handle<JSReceiver> object, | 1958 Handle<JSReceiver> object, |
| 1959 Handle<Name> name); | 1959 Handle<Name> name); |
| 1960 static PropertyAttributes GetPropertyAttributeWithReceiver( | 1960 static PropertyAttributes GetPropertyAttributes(LookupIterator* it); |
| 1961 Handle<JSReceiver> object, | 1961 static PropertyAttributes GetOwnPropertyAttributes( |
| 1962 Handle<JSReceiver> receiver, | |
| 1963 Handle<Name> name); | |
| 1964 static PropertyAttributes GetOwnPropertyAttribute( | |
| 1965 Handle<JSReceiver> object, | 1962 Handle<JSReceiver> object, |
| 1966 Handle<Name> name); | 1963 Handle<Name> name); |
| 1967 | 1964 |
| 1968 static inline PropertyAttributes GetElementAttribute( | 1965 static inline PropertyAttributes GetElementAttribute( |
| 1969 Handle<JSReceiver> object, | 1966 Handle<JSReceiver> object, |
| 1970 uint32_t index); | 1967 uint32_t index); |
| 1971 static inline PropertyAttributes GetOwnElementAttribute( | 1968 static inline PropertyAttributes GetOwnElementAttribute( |
| 1972 Handle<JSReceiver> object, | 1969 Handle<JSReceiver> object, |
| 1973 uint32_t index); | 1970 uint32_t index); |
| 1974 | 1971 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1995 | 1992 |
| 1996 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS }; | 1993 enum KeyCollectionType { OWN_ONLY, INCLUDE_PROTOS }; |
| 1997 | 1994 |
| 1998 // Computes the enumerable keys for a JSObject. Used for implementing | 1995 // Computes the enumerable keys for a JSObject. Used for implementing |
| 1999 // "for (n in object) { }". | 1996 // "for (n in object) { }". |
| 2000 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( | 1997 MUST_USE_RESULT static MaybeHandle<FixedArray> GetKeys( |
| 2001 Handle<JSReceiver> object, | 1998 Handle<JSReceiver> object, |
| 2002 KeyCollectionType type); | 1999 KeyCollectionType type); |
| 2003 | 2000 |
| 2004 private: | 2001 private: |
| 2005 static PropertyAttributes GetPropertyAttributeForResult( | |
| 2006 Handle<JSReceiver> object, | |
| 2007 Handle<JSReceiver> receiver, | |
| 2008 LookupResult* result, | |
| 2009 Handle<Name> name, | |
| 2010 bool continue_search); | |
| 2011 | |
| 2012 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 2002 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
| 2013 Handle<JSReceiver> receiver, | 2003 Handle<JSReceiver> receiver, |
| 2014 LookupResult* result, | 2004 LookupResult* result, |
| 2015 Handle<Name> key, | 2005 Handle<Name> key, |
| 2016 Handle<Object> value, | 2006 Handle<Object> value, |
| 2017 PropertyAttributes attributes, | 2007 PropertyAttributes attributes, |
| 2018 StrictMode strict_mode, | 2008 StrictMode strict_mode, |
| 2019 StoreFromKeyed store_from_keyed); | 2009 StoreFromKeyed store_from_keyed); |
| 2020 | 2010 |
| 2021 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); | 2011 DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2202 Handle<Object> value, | 2192 Handle<Object> value, |
| 2203 PropertyDetails details); | 2193 PropertyDetails details); |
| 2204 | 2194 |
| 2205 static void OptimizeAsPrototype(Handle<JSObject> object); | 2195 static void OptimizeAsPrototype(Handle<JSObject> object); |
| 2206 | 2196 |
| 2207 // Retrieve interceptors. | 2197 // Retrieve interceptors. |
| 2208 InterceptorInfo* GetNamedInterceptor(); | 2198 InterceptorInfo* GetNamedInterceptor(); |
| 2209 InterceptorInfo* GetIndexedInterceptor(); | 2199 InterceptorInfo* GetIndexedInterceptor(); |
| 2210 | 2200 |
| 2211 // Used from JSReceiver. | 2201 // Used from JSReceiver. |
| 2212 static PropertyAttributes GetPropertyAttributePostInterceptor( | 2202 static Maybe<PropertyAttributes> GetPropertyAttributesWithInterceptor( |
| 2213 Handle<JSObject> object, | 2203 Handle<JSObject> holder, |
| 2214 Handle<JSObject> receiver, | 2204 Handle<Object> receiver, |
| 2215 Handle<Name> name, | 2205 Handle<Name> name); |
| 2216 bool check_prototype); | 2206 static PropertyAttributes GetPropertyAttributesWithFailedAccessCheck( |
| 2217 static PropertyAttributes GetPropertyAttributeWithInterceptor( | 2207 LookupIterator* it); |
| 2218 Handle<JSObject> object, | |
| 2219 Handle<JSObject> receiver, | |
| 2220 Handle<Name> name, | |
| 2221 bool check_prototype); | |
| 2222 static PropertyAttributes GetPropertyAttributeWithFailedAccessCheck( | |
| 2223 Handle<JSObject> object, | |
| 2224 LookupResult* result, | |
| 2225 Handle<Name> name, | |
| 2226 bool check_prototype); | |
| 2227 static PropertyAttributes GetElementAttributeWithReceiver( | 2208 static PropertyAttributes GetElementAttributeWithReceiver( |
| 2228 Handle<JSObject> object, | 2209 Handle<JSObject> object, |
| 2229 Handle<JSReceiver> receiver, | 2210 Handle<JSReceiver> receiver, |
| 2230 uint32_t index, | 2211 uint32_t index, |
| 2231 bool check_prototype); | 2212 bool check_prototype); |
| 2232 | 2213 |
| 2233 // Retrieves an AccessorPair property from the given object. Might return | 2214 // Retrieves an AccessorPair property from the given object. Might return |
| 2234 // undefined if the property doesn't exist or is of a different kind. | 2215 // undefined if the property doesn't exist or is of a different kind. |
| 2235 MUST_USE_RESULT static MaybeHandle<Object> GetAccessor( | 2216 MUST_USE_RESULT static MaybeHandle<Object> GetAccessor( |
| 2236 Handle<JSObject> object, | 2217 Handle<JSObject> object, |
| (...skipping 7719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9956 MUST_USE_RESULT | 9937 MUST_USE_RESULT |
| 9957 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( | 9938 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( |
| 9958 Handle<JSProxy> proxy, | 9939 Handle<JSProxy> proxy, |
| 9959 Handle<JSReceiver> receiver, | 9940 Handle<JSReceiver> receiver, |
| 9960 Handle<Name> name, | 9941 Handle<Name> name, |
| 9961 Handle<Object> value, | 9942 Handle<Object> value, |
| 9962 PropertyAttributes attributes, | 9943 PropertyAttributes attributes, |
| 9963 StrictMode strict_mode, | 9944 StrictMode strict_mode, |
| 9964 bool* done); | 9945 bool* done); |
| 9965 | 9946 |
| 9966 static PropertyAttributes GetPropertyAttributeWithHandler( | 9947 static PropertyAttributes GetPropertyAttributesWithHandler( |
| 9967 Handle<JSProxy> proxy, | 9948 Handle<JSProxy> proxy, |
| 9968 Handle<JSReceiver> receiver, | 9949 Handle<Object> receiver, |
| 9969 Handle<Name> name); | 9950 Handle<Name> name); |
| 9970 static PropertyAttributes GetElementAttributeWithHandler( | 9951 static PropertyAttributes GetElementAttributeWithHandler( |
| 9971 Handle<JSProxy> proxy, | 9952 Handle<JSProxy> proxy, |
| 9972 Handle<JSReceiver> receiver, | 9953 Handle<JSReceiver> receiver, |
| 9973 uint32_t index); | 9954 uint32_t index); |
| 9974 | 9955 |
| 9975 // Turn the proxy into an (empty) JSObject. | 9956 // Turn the proxy into an (empty) JSObject. |
| 9976 static void Fix(Handle<JSProxy> proxy); | 9957 static void Fix(Handle<JSProxy> proxy); |
| 9977 | 9958 |
| 9978 // Initializes the body after the handler slot. | 9959 // Initializes the body after the handler slot. |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11234 } else { | 11215 } else { |
| 11235 value &= ~(1 << bit_position); | 11216 value &= ~(1 << bit_position); |
| 11236 } | 11217 } |
| 11237 return value; | 11218 return value; |
| 11238 } | 11219 } |
| 11239 }; | 11220 }; |
| 11240 | 11221 |
| 11241 } } // namespace v8::internal | 11222 } } // namespace v8::internal |
| 11242 | 11223 |
| 11243 #endif // V8_OBJECTS_H_ | 11224 #endif // V8_OBJECTS_H_ |
| OLD | NEW |