| 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 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 // Internal properties (e.g. the hidden properties dictionary) might | 1943 // Internal properties (e.g. the hidden properties dictionary) might |
| 1944 // be added even though the receiver is non-extensible. | 1944 // be added even though the receiver is non-extensible. |
| 1945 enum ExtensibilityCheck { | 1945 enum ExtensibilityCheck { |
| 1946 PERFORM_EXTENSIBILITY_CHECK, | 1946 PERFORM_EXTENSIBILITY_CHECK, |
| 1947 OMIT_EXTENSIBILITY_CHECK | 1947 OMIT_EXTENSIBILITY_CHECK |
| 1948 }; | 1948 }; |
| 1949 | 1949 |
| 1950 // Casting. | 1950 // Casting. |
| 1951 static inline JSReceiver* cast(Object* obj); | 1951 static inline JSReceiver* cast(Object* obj); |
| 1952 | 1952 |
| 1953 // Implementation of [[Put]], see ECMA-262 5th edition, section 8.12.5. | 1953 // Implementation of [[Put]], ECMA-262 5th edition, section 8.12.5. |
| 1954 static Handle<Object> SetProperty(Handle<JSReceiver> object, | 1954 static Handle<Object> SetProperty(Handle<JSReceiver> object, |
| 1955 Handle<Name> key, | 1955 Handle<Name> key, |
| 1956 Handle<Object> value, | 1956 Handle<Object> value, |
| 1957 PropertyAttributes attributes, | 1957 PropertyAttributes attributes, |
| 1958 StrictModeFlag strict_mode, | 1958 StrictModeFlag strict_mode, |
| 1959 StoreFromKeyed store_mode = | 1959 StoreFromKeyed store_mode = |
| 1960 MAY_BE_STORE_FROM_KEYED); | 1960 MAY_BE_STORE_FROM_KEYED); |
| 1961 static Handle<Object> SetElement(Handle<JSReceiver> object, | 1961 static Handle<Object> SetElement(Handle<JSReceiver> object, |
| 1962 uint32_t index, | 1962 uint32_t index, |
| 1963 Handle<Object> value, | 1963 Handle<Object> value, |
| 1964 PropertyAttributes attributes, | 1964 PropertyAttributes attributes, |
| 1965 StrictModeFlag strict_mode); | 1965 StrictModeFlag strict_mode); |
| 1966 | 1966 |
| 1967 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, | 1967 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, |
| 1968 Object* value); | 1968 Object* value); |
| 1969 | 1969 |
| 1970 // Implementation of [[Delete]], see ECMA-262 5th edition, section 8.12.7. | 1970 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. |
| 1971 static inline bool HasProperty(Handle<JSReceiver> object, Handle<Name> name); |
| 1972 static inline bool HasLocalProperty(Handle<JSReceiver>, Handle<Name> name); |
| 1973 static inline bool HasElement(Handle<JSReceiver> object, uint32_t index); |
| 1974 static inline bool HasLocalElement(Handle<JSReceiver> object, uint32_t index); |
| 1975 |
| 1976 // Implementation of [[Delete]], ECMA-262 5th edition, section 8.12.7. |
| 1971 static Handle<Object> DeleteProperty(Handle<JSReceiver> object, | 1977 static Handle<Object> DeleteProperty(Handle<JSReceiver> object, |
| 1972 Handle<Name> name, | 1978 Handle<Name> name, |
| 1973 DeleteMode mode = NORMAL_DELETION); | 1979 DeleteMode mode = NORMAL_DELETION); |
| 1974 static Handle<Object> DeleteElement(Handle<JSReceiver> object, | 1980 static Handle<Object> DeleteElement(Handle<JSReceiver> object, |
| 1975 uint32_t index, | 1981 uint32_t index, |
| 1976 DeleteMode mode = NORMAL_DELETION); | 1982 DeleteMode mode = NORMAL_DELETION); |
| 1977 | 1983 |
| 1978 // Tests for the fast common case for property enumeration. | 1984 // Tests for the fast common case for property enumeration. |
| 1979 bool IsSimpleEnum(); | 1985 bool IsSimpleEnum(); |
| 1980 | 1986 |
| 1981 // Returns the class name ([[Class]] property in the specification). | 1987 // Returns the class name ([[Class]] property in the specification). |
| 1982 String* class_name(); | 1988 String* class_name(); |
| 1983 | 1989 |
| 1984 // Returns the constructor name (the name (possibly, inferred name) of the | 1990 // Returns the constructor name (the name (possibly, inferred name) of the |
| 1985 // function that was used to instantiate the object). | 1991 // function that was used to instantiate the object). |
| 1986 String* constructor_name(); | 1992 String* constructor_name(); |
| 1987 | 1993 |
| 1988 inline PropertyAttributes GetPropertyAttribute(Name* name); | 1994 inline PropertyAttributes GetPropertyAttribute(Name* name); |
| 1989 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver, | 1995 PropertyAttributes GetPropertyAttributeWithReceiver(JSReceiver* receiver, |
| 1990 Name* name); | 1996 Name* name); |
| 1991 PropertyAttributes GetLocalPropertyAttribute(Name* name); | 1997 PropertyAttributes GetLocalPropertyAttribute(Name* name); |
| 1992 | 1998 |
| 1993 inline PropertyAttributes GetElementAttribute(uint32_t index); | 1999 inline PropertyAttributes GetElementAttribute(uint32_t index); |
| 1994 inline PropertyAttributes GetLocalElementAttribute(uint32_t index); | 2000 inline PropertyAttributes GetLocalElementAttribute(uint32_t index); |
| 1995 | 2001 |
| 1996 // Can cause a GC. | |
| 1997 inline bool HasProperty(Name* name); | |
| 1998 inline bool HasLocalProperty(Name* name); | |
| 1999 inline bool HasElement(uint32_t index); | |
| 2000 inline bool HasLocalElement(uint32_t index); | |
| 2001 | |
| 2002 // Return the object's prototype (might be Heap::null_value()). | 2002 // Return the object's prototype (might be Heap::null_value()). |
| 2003 inline Object* GetPrototype(); | 2003 inline Object* GetPrototype(); |
| 2004 | 2004 |
| 2005 // Return the constructor function (may be Heap::null_value()). | 2005 // Return the constructor function (may be Heap::null_value()). |
| 2006 inline Object* GetConstructor(); | 2006 inline Object* GetConstructor(); |
| 2007 | 2007 |
| 2008 // Retrieves a permanent object identity hash code. The undefined value might | 2008 // Retrieves a permanent object identity hash code. The undefined value might |
| 2009 // be returned in case no hash was created yet and OMIT_CREATION was used. | 2009 // be returned in case no hash was created yet and OMIT_CREATION was used. |
| 2010 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2010 inline MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 2011 | 2011 |
| (...skipping 7055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9067 public: | 9067 public: |
| 9068 // [handler]: The handler property. | 9068 // [handler]: The handler property. |
| 9069 DECL_ACCESSORS(handler, Object) | 9069 DECL_ACCESSORS(handler, Object) |
| 9070 | 9070 |
| 9071 // [hash]: The hash code property (undefined if not initialized yet). | 9071 // [hash]: The hash code property (undefined if not initialized yet). |
| 9072 DECL_ACCESSORS(hash, Object) | 9072 DECL_ACCESSORS(hash, Object) |
| 9073 | 9073 |
| 9074 // Casting. | 9074 // Casting. |
| 9075 static inline JSProxy* cast(Object* obj); | 9075 static inline JSProxy* cast(Object* obj); |
| 9076 | 9076 |
| 9077 bool HasPropertyWithHandler(Name* name); | |
| 9078 bool HasElementWithHandler(uint32_t index); | |
| 9079 | |
| 9080 MUST_USE_RESULT MaybeObject* GetPropertyWithHandler( | 9077 MUST_USE_RESULT MaybeObject* GetPropertyWithHandler( |
| 9081 Object* receiver, | 9078 Object* receiver, |
| 9082 Name* name); | 9079 Name* name); |
| 9083 MUST_USE_RESULT MaybeObject* GetElementWithHandler( | 9080 MUST_USE_RESULT MaybeObject* GetElementWithHandler( |
| 9084 Object* receiver, | 9081 Object* receiver, |
| 9085 uint32_t index); | 9082 uint32_t index); |
| 9086 | 9083 |
| 9087 // If the handler defines an accessor property with a setter, invoke it. | 9084 // If the handler defines an accessor property with a setter, invoke it. |
| 9088 // If it defines an accessor property without a setter, or a data property | 9085 // If it defines an accessor property without a setter, or a data property |
| 9089 // that is read-only, throw. In all these cases set '*done' to true, | 9086 // that is read-only, throw. In all these cases set '*done' to true, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9145 Handle<Name> name, | 9142 Handle<Name> name, |
| 9146 Handle<Object> value, | 9143 Handle<Object> value, |
| 9147 PropertyAttributes attributes, | 9144 PropertyAttributes attributes, |
| 9148 StrictModeFlag strict_mode); | 9145 StrictModeFlag strict_mode); |
| 9149 static Handle<Object> SetElementWithHandler(Handle<JSProxy> proxy, | 9146 static Handle<Object> SetElementWithHandler(Handle<JSProxy> proxy, |
| 9150 Handle<JSReceiver> receiver, | 9147 Handle<JSReceiver> receiver, |
| 9151 uint32_t index, | 9148 uint32_t index, |
| 9152 Handle<Object> value, | 9149 Handle<Object> value, |
| 9153 StrictModeFlag strict_mode); | 9150 StrictModeFlag strict_mode); |
| 9154 | 9151 |
| 9152 static bool HasPropertyWithHandler(Handle<JSProxy> proxy, Handle<Name> name); |
| 9153 static bool HasElementWithHandler(Handle<JSProxy> proxy, uint32_t index); |
| 9154 |
| 9155 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, | 9155 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, |
| 9156 Handle<Name> name, | 9156 Handle<Name> name, |
| 9157 DeleteMode mode); | 9157 DeleteMode mode); |
| 9158 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, | 9158 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, |
| 9159 uint32_t index, | 9159 uint32_t index, |
| 9160 DeleteMode mode); | 9160 DeleteMode mode); |
| 9161 | 9161 |
| 9162 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 9162 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 9163 static Handle<Object> GetIdentityHash(Handle<JSProxy> proxy, | 9163 static Handle<Object> GetIdentityHash(Handle<JSProxy> proxy, |
| 9164 CreationFlag flag); | 9164 CreationFlag flag); |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10247 } else { | 10247 } else { |
| 10248 value &= ~(1 << bit_position); | 10248 value &= ~(1 << bit_position); |
| 10249 } | 10249 } |
| 10250 return value; | 10250 return value; |
| 10251 } | 10251 } |
| 10252 }; | 10252 }; |
| 10253 | 10253 |
| 10254 } } // namespace v8::internal | 10254 } } // namespace v8::internal |
| 10255 | 10255 |
| 10256 #endif // V8_OBJECTS_H_ | 10256 #endif // V8_OBJECTS_H_ |
| OLD | NEW |