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 <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 MUST_USE_RESULT static Maybe<bool> HasProperty(LookupIterator* it); | 1804 MUST_USE_RESULT static Maybe<bool> HasProperty(LookupIterator* it); |
1805 MUST_USE_RESULT static inline Maybe<bool> HasProperty( | 1805 MUST_USE_RESULT static inline Maybe<bool> HasProperty( |
1806 Handle<JSReceiver> object, Handle<Name> name); | 1806 Handle<JSReceiver> object, Handle<Name> name); |
1807 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>, | 1807 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>, |
1808 Handle<Name> name); | 1808 Handle<Name> name); |
1809 MUST_USE_RESULT static inline Maybe<bool> HasElement( | 1809 MUST_USE_RESULT static inline Maybe<bool> HasElement( |
1810 Handle<JSReceiver> object, uint32_t index); | 1810 Handle<JSReceiver> object, uint32_t index); |
1811 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement( | 1811 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement( |
1812 Handle<JSReceiver> object, uint32_t index); | 1812 Handle<JSReceiver> object, uint32_t index); |
1813 | 1813 |
1814 // Implementation of [[Delete]], ECMA-262 5th edition, section 8.12.7. | 1814 // Implementation of ES6 [[Delete]] |
1815 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyOrElement( | 1815 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( |
1816 Handle<JSReceiver> object, Handle<Name> name, | 1816 Handle<JSReceiver> object, Handle<Name> name, |
1817 LanguageMode language_mode = SLOPPY); | 1817 LanguageMode language_mode = SLOPPY); |
1818 MUST_USE_RESULT static MaybeHandle<Object> DeleteProperty( | 1818 MUST_USE_RESULT static Maybe<bool> DeleteProperty( |
1819 Handle<JSReceiver> object, Handle<Name> name, | 1819 Handle<JSReceiver> object, Handle<Name> name, |
1820 LanguageMode language_mode = SLOPPY); | 1820 LanguageMode language_mode = SLOPPY); |
1821 MUST_USE_RESULT static MaybeHandle<Object> DeleteProperty( | 1821 MUST_USE_RESULT static Maybe<bool> DeleteProperty(LookupIterator* it, |
1822 LookupIterator* it, LanguageMode language_mode); | 1822 LanguageMode language_mode); |
1823 MUST_USE_RESULT static MaybeHandle<Object> DeleteElement( | 1823 MUST_USE_RESULT static Maybe<bool> DeleteElement( |
1824 Handle<JSReceiver> object, uint32_t index, | 1824 Handle<JSReceiver> object, uint32_t index, |
1825 LanguageMode language_mode = SLOPPY); | 1825 LanguageMode language_mode = SLOPPY); |
1826 | 1826 |
1827 MUST_USE_RESULT static Object* DefineProperty(Isolate* isolate, | 1827 MUST_USE_RESULT static Object* DefineProperty(Isolate* isolate, |
1828 Handle<Object> object, | 1828 Handle<Object> object, |
1829 Handle<Object> name, | 1829 Handle<Object> name, |
1830 Handle<Object> attributes); | 1830 Handle<Object> attributes); |
1831 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, | 1831 MUST_USE_RESULT static Object* DefineProperties(Isolate* isolate, |
1832 Handle<Object> object, | 1832 Handle<Object> object, |
1833 Handle<Object> properties); | 1833 Handle<Object> properties); |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 | 2503 |
2504 MUST_USE_RESULT static Maybe<bool> SetPropertyWithFailedAccessCheck( | 2504 MUST_USE_RESULT static Maybe<bool> SetPropertyWithFailedAccessCheck( |
2505 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); | 2505 LookupIterator* it, Handle<Object> value, ShouldThrow should_throw); |
2506 | 2506 |
2507 // Add a property to a slow-case object. | 2507 // Add a property to a slow-case object. |
2508 static void AddSlowProperty(Handle<JSObject> object, | 2508 static void AddSlowProperty(Handle<JSObject> object, |
2509 Handle<Name> name, | 2509 Handle<Name> name, |
2510 Handle<Object> value, | 2510 Handle<Object> value, |
2511 PropertyAttributes attributes); | 2511 PropertyAttributes attributes); |
2512 | 2512 |
2513 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithInterceptor( | 2513 MUST_USE_RESULT static Maybe<bool> DeletePropertyWithInterceptor( |
2514 LookupIterator* it); | 2514 LookupIterator* it); |
2515 | 2515 |
2516 bool ReferencesObjectFromElements(FixedArray* elements, | 2516 bool ReferencesObjectFromElements(FixedArray* elements, |
2517 ElementsKind kind, | 2517 ElementsKind kind, |
2518 Object* object); | 2518 Object* object); |
2519 | 2519 |
2520 // Return the hash table backing store or the inline stored identity hash, | 2520 // Return the hash table backing store or the inline stored identity hash, |
2521 // whatever is found. | 2521 // whatever is found. |
2522 MUST_USE_RESULT Object* GetHiddenPropertiesHashTable(); | 2522 MUST_USE_RESULT Object* GetHiddenPropertiesHashTable(); |
2523 | 2523 |
(...skipping 7015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9539 | 9539 |
9540 // ES6 9.5.5 | 9540 // ES6 9.5.5 |
9541 static bool GetOwnPropertyDescriptor(LookupIterator* it, | 9541 static bool GetOwnPropertyDescriptor(LookupIterator* it, |
9542 PropertyDescriptor* desc); | 9542 PropertyDescriptor* desc); |
9543 | 9543 |
9544 // ES6 9.5.6 | 9544 // ES6 9.5.6 |
9545 static bool DefineOwnProperty(Isolate* isolate, Handle<JSProxy> object, | 9545 static bool DefineOwnProperty(Isolate* isolate, Handle<JSProxy> object, |
9546 Handle<Object> key, PropertyDescriptor* desc, | 9546 Handle<Object> key, PropertyDescriptor* desc, |
9547 ShouldThrow should_throw); | 9547 ShouldThrow should_throw); |
9548 | 9548 |
| 9549 // ES6 9.5.10 (when passed SLOPPY) |
| 9550 MUST_USE_RESULT static Maybe<bool> DeletePropertyOrElement( |
| 9551 Handle<JSProxy> proxy, Handle<Name> name, LanguageMode language_mode); |
| 9552 |
9549 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( | 9553 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( |
9550 Handle<JSProxy> proxy, | 9554 Handle<JSProxy> proxy, |
9551 Handle<Object> receiver, | 9555 Handle<Object> receiver, |
9552 Handle<Name> name); | 9556 Handle<Name> name); |
9553 | 9557 |
9554 // If the handler defines an accessor property with a setter, invoke it. | 9558 // If the handler defines an accessor property with a setter, invoke it. |
9555 // If it defines an accessor property without a setter, or a data property | 9559 // If it defines an accessor property without a setter, or a data property |
9556 // that is read-only, fail. In all these cases set '*done' to true. | 9560 // that is read-only, fail. In all these cases set '*done' to true. |
9557 // Otherwise set it to false, in which case the return value is not | 9561 // Otherwise set it to false, in which case the return value is not |
9558 // meaningful. | 9562 // meaningful. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9594 | 9598 |
9595 // Invoke a trap by name. If the trap does not exist on this's handler, | 9599 // Invoke a trap by name. If the trap does not exist on this's handler, |
9596 // but derived_trap is non-NULL, invoke that instead. May cause GC. | 9600 // but derived_trap is non-NULL, invoke that instead. May cause GC. |
9597 MUST_USE_RESULT static MaybeHandle<Object> CallTrap( | 9601 MUST_USE_RESULT static MaybeHandle<Object> CallTrap( |
9598 Handle<JSProxy> proxy, const char* name, Handle<Object> derived_trap, | 9602 Handle<JSProxy> proxy, const char* name, Handle<Object> derived_trap, |
9599 int argc, Handle<Object> args[]); | 9603 int argc, Handle<Object> args[]); |
9600 | 9604 |
9601 MUST_USE_RESULT static Maybe<bool> HasPropertyWithHandler( | 9605 MUST_USE_RESULT static Maybe<bool> HasPropertyWithHandler( |
9602 Handle<JSProxy> proxy, Handle<Name> name); | 9606 Handle<JSProxy> proxy, Handle<Name> name); |
9603 | 9607 |
9604 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithHandler( | |
9605 Handle<JSProxy> proxy, Handle<Name> name, LanguageMode language_mode); | |
9606 | |
9607 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9608 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
9608 }; | 9609 }; |
9609 | 9610 |
9610 | 9611 |
9611 class JSFunctionProxy: public JSProxy { | 9612 class JSFunctionProxy: public JSProxy { |
9612 public: | 9613 public: |
9613 // [call_trap]: The call trap. | 9614 // [call_trap]: The call trap. |
9614 DECL_ACCESSORS(call_trap, JSReceiver) | 9615 DECL_ACCESSORS(call_trap, JSReceiver) |
9615 | 9616 |
9616 // [construct_trap]: The construct trap. | 9617 // [construct_trap]: The construct trap. |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10732 } | 10733 } |
10733 return value; | 10734 return value; |
10734 } | 10735 } |
10735 }; | 10736 }; |
10736 | 10737 |
10737 | 10738 |
10738 } // NOLINT, false-positive due to second-order macros. | 10739 } // NOLINT, false-positive due to second-order macros. |
10739 } // NOLINT, false-positive due to second-order macros. | 10740 } // NOLINT, false-positive due to second-order macros. |
10740 | 10741 |
10741 #endif // V8_OBJECTS_H_ | 10742 #endif // V8_OBJECTS_H_ |
OLD | NEW |