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 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 }; | 1944 }; |
1945 | 1945 |
1946 // Casting. | 1946 // Casting. |
1947 static inline JSReceiver* cast(Object* obj); | 1947 static inline JSReceiver* cast(Object* obj); |
1948 | 1948 |
1949 static Handle<Object> SetProperty(Handle<JSReceiver> object, | 1949 static Handle<Object> SetProperty(Handle<JSReceiver> object, |
1950 Handle<Name> key, | 1950 Handle<Name> key, |
1951 Handle<Object> value, | 1951 Handle<Object> value, |
1952 PropertyAttributes attributes, | 1952 PropertyAttributes attributes, |
1953 StrictModeFlag strict_mode); | 1953 StrictModeFlag strict_mode); |
| 1954 static Handle<Object> SetElement(Handle<JSReceiver> object, |
| 1955 uint32_t index, |
| 1956 Handle<Object> value, |
| 1957 PropertyAttributes attributes, |
| 1958 StrictModeFlag strict_mode); |
1954 | 1959 |
1955 MUST_USE_RESULT static MaybeObject* SetPropertyOrFail( | 1960 MUST_USE_RESULT static MaybeObject* SetPropertyOrFail( |
1956 Handle<JSReceiver> object, | 1961 Handle<JSReceiver> object, |
1957 Handle<Name> key, | 1962 Handle<Name> key, |
1958 Handle<Object> value, | 1963 Handle<Object> value, |
1959 PropertyAttributes attributes, | 1964 PropertyAttributes attributes, |
1960 StrictModeFlag strict_mode, | 1965 StrictModeFlag strict_mode, |
1961 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED); | 1966 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED); |
1962 | 1967 |
1963 // Can cause GC. | 1968 // Can cause GC. |
(...skipping 13 matching lines...) Expand all Loading... |
1977 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, | 1982 MUST_USE_RESULT MaybeObject* SetPropertyWithDefinedSetter(JSReceiver* setter, |
1978 Object* value); | 1983 Object* value); |
1979 | 1984 |
1980 static Handle<Object> DeleteProperty(Handle<JSReceiver> object, | 1985 static Handle<Object> DeleteProperty(Handle<JSReceiver> object, |
1981 Handle<Name> name, | 1986 Handle<Name> name, |
1982 DeleteMode mode = NORMAL_DELETION); | 1987 DeleteMode mode = NORMAL_DELETION); |
1983 static Handle<Object> DeleteElement(Handle<JSReceiver> object, | 1988 static Handle<Object> DeleteElement(Handle<JSReceiver> object, |
1984 uint32_t index, | 1989 uint32_t index, |
1985 DeleteMode mode = NORMAL_DELETION); | 1990 DeleteMode mode = NORMAL_DELETION); |
1986 | 1991 |
1987 // Set the index'th array element. | |
1988 // Can cause GC, or return failure if GC is required. | |
1989 MUST_USE_RESULT MaybeObject* SetElement(uint32_t index, | |
1990 Object* value, | |
1991 PropertyAttributes attributes, | |
1992 StrictModeFlag strict_mode, | |
1993 bool check_prototype); | |
1994 | |
1995 // Tests for the fast common case for property enumeration. | 1992 // Tests for the fast common case for property enumeration. |
1996 bool IsSimpleEnum(); | 1993 bool IsSimpleEnum(); |
1997 | 1994 |
1998 // Returns the class name ([[Class]] property in the specification). | 1995 // Returns the class name ([[Class]] property in the specification). |
1999 String* class_name(); | 1996 String* class_name(); |
2000 | 1997 |
2001 // Returns the constructor name (the name (possibly, inferred name) of the | 1998 // Returns the constructor name (the name (possibly, inferred name) of the |
2002 // function that was used to instantiate the object). | 1999 // function that was used to instantiate the object). |
2003 String* constructor_name(); | 2000 String* constructor_name(); |
2004 | 2001 |
(...skipping 7117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9122 MUST_USE_RESULT MaybeObject* GetElementWithHandler( | 9119 MUST_USE_RESULT MaybeObject* GetElementWithHandler( |
9123 Object* receiver, | 9120 Object* receiver, |
9124 uint32_t index); | 9121 uint32_t index); |
9125 | 9122 |
9126 MUST_USE_RESULT MaybeObject* SetPropertyWithHandler( | 9123 MUST_USE_RESULT MaybeObject* SetPropertyWithHandler( |
9127 JSReceiver* receiver, | 9124 JSReceiver* receiver, |
9128 Name* name, | 9125 Name* name, |
9129 Object* value, | 9126 Object* value, |
9130 PropertyAttributes attributes, | 9127 PropertyAttributes attributes, |
9131 StrictModeFlag strict_mode); | 9128 StrictModeFlag strict_mode); |
9132 MUST_USE_RESULT MaybeObject* SetElementWithHandler( | |
9133 JSReceiver* receiver, | |
9134 uint32_t index, | |
9135 Object* value, | |
9136 StrictModeFlag strict_mode); | |
9137 | 9129 |
9138 // If the handler defines an accessor property with a setter, invoke it. | 9130 // If the handler defines an accessor property with a setter, invoke it. |
9139 // If it defines an accessor property without a setter, or a data property | 9131 // If it defines an accessor property without a setter, or a data property |
9140 // that is read-only, throw. In all these cases set '*done' to true, | 9132 // that is read-only, throw. In all these cases set '*done' to true, |
9141 // otherwise set it to false. | 9133 // otherwise set it to false. |
9142 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypesWithHandler( | 9134 MUST_USE_RESULT MaybeObject* SetPropertyViaPrototypesWithHandler( |
9143 JSReceiver* receiver, | 9135 JSReceiver* receiver, |
9144 Name* name, | 9136 Name* name, |
9145 Object* value, | 9137 Object* value, |
9146 PropertyAttributes attributes, | 9138 PropertyAttributes attributes, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9185 | 9177 |
9186 STATIC_CHECK(kPaddingSize >= 0); | 9178 STATIC_CHECK(kPaddingSize >= 0); |
9187 | 9179 |
9188 typedef FixedBodyDescriptor<kHandlerOffset, | 9180 typedef FixedBodyDescriptor<kHandlerOffset, |
9189 kPaddingOffset, | 9181 kPaddingOffset, |
9190 kSize> BodyDescriptor; | 9182 kSize> BodyDescriptor; |
9191 | 9183 |
9192 private: | 9184 private: |
9193 friend class JSReceiver; | 9185 friend class JSReceiver; |
9194 | 9186 |
9195 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> object, | 9187 static Handle<Object> SetElementWithHandler(Handle<JSProxy> proxy, |
| 9188 Handle<JSReceiver> receiver, |
| 9189 uint32_t index, |
| 9190 Handle<Object> value, |
| 9191 StrictModeFlag strict_mode); |
| 9192 |
| 9193 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, |
9196 Handle<Name> name, | 9194 Handle<Name> name, |
9197 DeleteMode mode); | 9195 DeleteMode mode); |
9198 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> object, | 9196 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, |
9199 uint32_t index, | 9197 uint32_t index, |
9200 DeleteMode mode); | 9198 DeleteMode mode); |
9201 | 9199 |
9202 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9200 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
9203 }; | 9201 }; |
9204 | 9202 |
9205 | 9203 |
9206 class JSFunctionProxy: public JSProxy { | 9204 class JSFunctionProxy: public JSProxy { |
9207 public: | 9205 public: |
9208 // [call_trap]: The call trap. | 9206 // [call_trap]: The call trap. |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10275 } else { | 10273 } else { |
10276 value &= ~(1 << bit_position); | 10274 value &= ~(1 << bit_position); |
10277 } | 10275 } |
10278 return value; | 10276 return value; |
10279 } | 10277 } |
10280 }; | 10278 }; |
10281 | 10279 |
10282 } } // namespace v8::internal | 10280 } } // namespace v8::internal |
10283 | 10281 |
10284 #endif // V8_OBJECTS_H_ | 10282 #endif // V8_OBJECTS_H_ |
OLD | NEW |