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 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1526 MUST_USE_RESULT MaybeObject* ToObject(Context* native_context); | 1526 MUST_USE_RESULT MaybeObject* ToObject(Context* native_context); |
1527 | 1527 |
1528 // Converts this to a Smi if possible. | 1528 // Converts this to a Smi if possible. |
1529 // Failure is returned otherwise. | 1529 // Failure is returned otherwise. |
1530 static MUST_USE_RESULT inline Handle<Object> ToSmi(Isolate* isolate, | 1530 static MUST_USE_RESULT inline Handle<Object> ToSmi(Isolate* isolate, |
1531 Handle<Object> object); | 1531 Handle<Object> object); |
1532 MUST_USE_RESULT inline MaybeObject* ToSmi(); | 1532 MUST_USE_RESULT inline MaybeObject* ToSmi(); |
1533 | 1533 |
1534 void Lookup(Name* name, LookupResult* result); | 1534 void Lookup(Name* name, LookupResult* result); |
1535 | 1535 |
1536 // Property access. | |
1537 MUST_USE_RESULT inline MaybeObject* GetProperty(Name* key); | |
1538 | |
1539 // TODO(yangguo): this should eventually replace the non-handlified version. | 1536 // TODO(yangguo): this should eventually replace the non-handlified version. |
Igor Sheludko
2014/04/11 10:52:13
I think this TODO is obsolete now.
| |
1540 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithReceiver( | 1537 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithReceiver( |
1541 Handle<Object> object, | 1538 Handle<Object> object, |
1542 Handle<Object> receiver, | 1539 Handle<Object> receiver, |
1543 Handle<Name> name, | 1540 Handle<Name> name, |
1544 PropertyAttributes* attributes); | 1541 PropertyAttributes* attributes); |
1545 MUST_USE_RESULT MaybeObject* GetPropertyWithReceiver( | |
1546 Object* receiver, | |
1547 Name* key, | |
1548 PropertyAttributes* attributes); | |
1549 | |
1550 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyOrElement( | 1542 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyOrElement( |
1551 Handle<Object> object, | 1543 Handle<Object> object, |
1552 Handle<Name> key); | 1544 Handle<Name> key); |
1553 | 1545 |
1554 static Handle<Object> GetProperty(Handle<Object> object, | 1546 MUST_USE_RESULT static MaybeHandle<Object> GetProperty(Handle<Object> object, |
1555 Handle<Name> key); | 1547 Handle<Name> key); |
1556 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( | 1548 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( |
1557 Handle<Object> object, | 1549 Handle<Object> object, |
1558 Handle<Object> receiver, | 1550 Handle<Object> receiver, |
1559 LookupResult* result, | 1551 LookupResult* result, |
1560 Handle<Name> key, | 1552 Handle<Name> key, |
1561 PropertyAttributes* attributes); | 1553 PropertyAttributes* attributes); |
1562 | 1554 |
1563 MUST_USE_RESULT MaybeObject* GetProperty(Object* receiver, | |
1564 LookupResult* result, | |
1565 Name* key, | |
1566 PropertyAttributes* attributes); | |
1567 | |
1568 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithDefinedGetter( | 1555 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithDefinedGetter( |
1569 Handle<Object> object, | 1556 Handle<Object> object, |
1570 Handle<Object> receiver, | 1557 Handle<Object> receiver, |
1571 Handle<JSReceiver> getter); | 1558 Handle<JSReceiver> getter); |
1572 | 1559 |
1573 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( | 1560 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( |
1574 Isolate* isolate, | 1561 Isolate* isolate, |
1575 Handle<Object> object, | 1562 Handle<Object> object, |
1576 uint32_t index); | 1563 uint32_t index); |
1577 | 1564 |
1578 // For use when we know that no exception can be thrown. | |
1579 static inline Handle<Object> GetElementNoExceptionThrown( | |
1580 Isolate* isolate, | |
1581 Handle<Object> object, | |
1582 uint32_t index); | |
1583 | |
1584 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithReceiver( | 1565 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithReceiver( |
1585 Isolate* isolate, | 1566 Isolate* isolate, |
1586 Handle<Object> object, | 1567 Handle<Object> object, |
1587 Handle<Object> receiver, | 1568 Handle<Object> receiver, |
1588 uint32_t index); | 1569 uint32_t index); |
1589 | 1570 |
1590 // Return the object's prototype (might be Heap::null_value()). | 1571 // Return the object's prototype (might be Heap::null_value()). |
1591 Object* GetPrototype(Isolate* isolate); | 1572 Object* GetPrototype(Isolate* isolate); |
1592 Map* GetMarkerMap(Isolate* isolate); | 1573 Map* GetMarkerMap(Isolate* isolate); |
1593 | 1574 |
(...skipping 6177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7771 | 7752 |
7772 // [global context]: the most recent (i.e. innermost) global context. | 7753 // [global context]: the most recent (i.e. innermost) global context. |
7773 DECL_ACCESSORS(global_context, Context) | 7754 DECL_ACCESSORS(global_context, Context) |
7774 | 7755 |
7775 // [global receiver]: the global receiver object of the context | 7756 // [global receiver]: the global receiver object of the context |
7776 DECL_ACCESSORS(global_receiver, JSObject) | 7757 DECL_ACCESSORS(global_receiver, JSObject) |
7777 | 7758 |
7778 // Retrieve the property cell used to store a property. | 7759 // Retrieve the property cell used to store a property. |
7779 PropertyCell* GetPropertyCell(LookupResult* result); | 7760 PropertyCell* GetPropertyCell(LookupResult* result); |
7780 | 7761 |
7781 // This is like GetProperty, but is used when you know the lookup won't fail | |
7782 // by throwing an exception. This is for the debug and builtins global | |
7783 // objects, where it is known which properties can be expected to be present | |
7784 // on the object. | |
7785 static inline Handle<Object> GetPropertyNoExceptionThrown( | |
7786 Handle<GlobalObject> global, | |
7787 Handle<Name> name); | |
7788 | |
7789 // Casting. | 7762 // Casting. |
7790 static inline GlobalObject* cast(Object* obj); | 7763 static inline GlobalObject* cast(Object* obj); |
7791 | 7764 |
7792 // Layout description. | 7765 // Layout description. |
7793 static const int kBuiltinsOffset = JSObject::kHeaderSize; | 7766 static const int kBuiltinsOffset = JSObject::kHeaderSize; |
7794 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; | 7767 static const int kNativeContextOffset = kBuiltinsOffset + kPointerSize; |
7795 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize; | 7768 static const int kGlobalContextOffset = kNativeContextOffset + kPointerSize; |
7796 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize; | 7769 static const int kGlobalReceiverOffset = kGlobalContextOffset + kPointerSize; |
7797 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize; | 7770 static const int kHeaderSize = kGlobalReceiverOffset + kPointerSize; |
7798 | 7771 |
(...skipping 2010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9809 public: | 9782 public: |
9810 // [handler]: The handler property. | 9783 // [handler]: The handler property. |
9811 DECL_ACCESSORS(handler, Object) | 9784 DECL_ACCESSORS(handler, Object) |
9812 | 9785 |
9813 // [hash]: The hash code property (undefined if not initialized yet). | 9786 // [hash]: The hash code property (undefined if not initialized yet). |
9814 DECL_ACCESSORS(hash, Object) | 9787 DECL_ACCESSORS(hash, Object) |
9815 | 9788 |
9816 // Casting. | 9789 // Casting. |
9817 static inline JSProxy* cast(Object* obj); | 9790 static inline JSProxy* cast(Object* obj); |
9818 | 9791 |
9819 MUST_USE_RESULT MaybeObject* GetPropertyWithHandler( | 9792 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithHandler( |
9820 Object* receiver, | 9793 Handle<JSProxy> proxy, |
9821 Name* name); | 9794 Handle<Object> receiver, |
9822 MUST_USE_RESULT MaybeObject* GetElementWithHandler( | 9795 Handle<Name> name); |
9823 Object* receiver, | 9796 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithHandler( |
9797 Handle<JSProxy> proxy, | |
9798 Handle<Object> receiver, | |
9824 uint32_t index); | 9799 uint32_t index); |
9825 | 9800 |
9826 // If the handler defines an accessor property with a setter, invoke it. | 9801 // If the handler defines an accessor property with a setter, invoke it. |
9827 // If it defines an accessor property without a setter, or a data property | 9802 // If it defines an accessor property without a setter, or a data property |
9828 // that is read-only, throw. In all these cases set '*done' to true, | 9803 // that is read-only, throw. In all these cases set '*done' to true, |
9829 // otherwise set it to false. | 9804 // otherwise set it to false. |
9830 MUST_USE_RESULT | 9805 MUST_USE_RESULT |
9831 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( | 9806 static MaybeHandle<Object> SetPropertyViaPrototypesWithHandler( |
9832 Handle<JSProxy> proxy, | 9807 Handle<JSProxy> proxy, |
9833 Handle<JSReceiver> receiver, | 9808 Handle<JSReceiver> receiver, |
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11019 } else { | 10994 } else { |
11020 value &= ~(1 << bit_position); | 10995 value &= ~(1 << bit_position); |
11021 } | 10996 } |
11022 return value; | 10997 return value; |
11023 } | 10998 } |
11024 }; | 10999 }; |
11025 | 11000 |
11026 } } // namespace v8::internal | 11001 } } // namespace v8::internal |
11027 | 11002 |
11028 #endif // V8_OBJECTS_H_ | 11003 #endif // V8_OBJECTS_H_ |
OLD | NEW |