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 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 | 1299 |
1300 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( | 1300 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( |
1301 Isolate* isolate, Handle<Object> object, uint32_t index, | 1301 Isolate* isolate, Handle<Object> object, uint32_t index, |
1302 LanguageMode language_mode = SLOPPY); | 1302 LanguageMode language_mode = SLOPPY); |
1303 | 1303 |
1304 MUST_USE_RESULT static inline MaybeHandle<Object> SetElement( | 1304 MUST_USE_RESULT static inline MaybeHandle<Object> SetElement( |
1305 Isolate* isolate, Handle<Object> object, uint32_t index, | 1305 Isolate* isolate, Handle<Object> object, uint32_t index, |
1306 Handle<Object> value, LanguageMode language_mode); | 1306 Handle<Object> value, LanguageMode language_mode); |
1307 | 1307 |
1308 // Get the first non-hidden prototype. | 1308 // Get the first non-hidden prototype. |
1309 static inline Handle<Object> GetPrototype(Isolate* isolate, | 1309 static inline MaybeHandle<Object> GetPrototype(Isolate* isolate, |
1310 Handle<Object> receiver); | 1310 Handle<Object> receiver); |
1311 | 1311 |
1312 bool HasInPrototypeChain(Isolate* isolate, Object* object); | 1312 bool HasInPrototypeChain(Isolate* isolate, Object* object); |
1313 | 1313 |
1314 // Returns the permanent hash code associated with this object. May return | 1314 // Returns the permanent hash code associated with this object. May return |
1315 // undefined if not yet created. | 1315 // undefined if not yet created. |
1316 Object* GetHash(); | 1316 Object* GetHash(); |
1317 | 1317 |
1318 // Returns undefined for JSObjects, but returns the hash code for simple | 1318 // Returns undefined for JSObjects, but returns the hash code for simple |
1319 // objects. This avoids a double lookup in the cases where we know we will | 1319 // objects. This avoids a double lookup in the cases where we know we will |
1320 // add the hash to the JSObject if it does not already exist. | 1320 // add the hash to the JSObject if it does not already exist. |
(...skipping 8211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9532 private: | 9532 private: |
9533 DISALLOW_IMPLICIT_CONSTRUCTORS(WeakCell); | 9533 DISALLOW_IMPLICIT_CONSTRUCTORS(WeakCell); |
9534 }; | 9534 }; |
9535 | 9535 |
9536 | 9536 |
9537 // The JSProxy describes EcmaScript Harmony proxies | 9537 // The JSProxy describes EcmaScript Harmony proxies |
9538 class JSProxy: public JSReceiver { | 9538 class JSProxy: public JSReceiver { |
9539 public: | 9539 public: |
9540 // [handler]: The handler property. | 9540 // [handler]: The handler property. |
9541 DECL_ACCESSORS(handler, Object) | 9541 DECL_ACCESSORS(handler, Object) |
9542 | 9542 // [target]: The target property. |
| 9543 DECL_ACCESSORS(target, Object) |
9543 // [hash]: The hash code property (undefined if not initialized yet). | 9544 // [hash]: The hash code property (undefined if not initialized yet). |
9544 DECL_ACCESSORS(hash, Object) | 9545 DECL_ACCESSORS(hash, Object) |
9545 | 9546 |
9546 DECLARE_CAST(JSProxy) | 9547 DECLARE_CAST(JSProxy) |
9547 | 9548 |
| 9549 |
| 9550 static MaybeHandle<Object> GetPrototype(Handle<JSProxy> receiver); |
| 9551 |
9548 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( | 9552 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( |
9549 Handle<JSProxy> proxy, | 9553 Handle<JSProxy> proxy, |
9550 Handle<Object> receiver, | 9554 Handle<Object> receiver, |
9551 Handle<Name> name); | 9555 Handle<Name> name); |
9552 | 9556 |
9553 // If the handler defines an accessor property with a setter, invoke it. | 9557 // If the handler defines an accessor property with a setter, invoke it. |
9554 // If it defines an accessor property without a setter, or a data property | 9558 // If it defines an accessor property without a setter, or a data property |
9555 // that is read-only, fail. In all these cases set '*done' to true. | 9559 // that is read-only, fail. In all these cases set '*done' to true. |
9556 // Otherwise set it to false, in which case the return value is not | 9560 // Otherwise set it to false, in which case the return value is not |
9557 // meaningful. | 9561 // meaningful. |
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10760 } | 10764 } |
10761 return value; | 10765 return value; |
10762 } | 10766 } |
10763 }; | 10767 }; |
10764 | 10768 |
10765 | 10769 |
10766 } // NOLINT, false-positive due to second-order macros. | 10770 } // NOLINT, false-positive due to second-order macros. |
10767 } // NOLINT, false-positive due to second-order macros. | 10771 } // NOLINT, false-positive due to second-order macros. |
10768 | 10772 |
10769 #endif // V8_OBJECTS_H_ | 10773 #endif // V8_OBJECTS_H_ |
OLD | NEW |