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 1211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 Handle<JSReceiver> getter); | 1222 Handle<JSReceiver> getter); |
1223 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithDefinedSetter( | 1223 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithDefinedSetter( |
1224 Handle<Object> receiver, | 1224 Handle<Object> receiver, |
1225 Handle<JSReceiver> setter, | 1225 Handle<JSReceiver> setter, |
1226 Handle<Object> value); | 1226 Handle<Object> value); |
1227 | 1227 |
1228 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( | 1228 MUST_USE_RESULT static inline MaybeHandle<Object> GetElement( |
1229 Isolate* isolate, Handle<Object> object, uint32_t index, | 1229 Isolate* isolate, Handle<Object> object, uint32_t index, |
1230 LanguageMode language_mode = SLOPPY); | 1230 LanguageMode language_mode = SLOPPY); |
1231 | 1231 |
| 1232 MUST_USE_RESULT static inline MaybeHandle<Object> SetElement( |
| 1233 Isolate* isolate, Handle<Object> object, uint32_t index, |
| 1234 Handle<Object> value, LanguageMode language_mode); |
| 1235 |
1232 static inline Handle<Object> GetPrototypeSkipHiddenPrototypes( | 1236 static inline Handle<Object> GetPrototypeSkipHiddenPrototypes( |
1233 Isolate* isolate, Handle<Object> receiver); | 1237 Isolate* isolate, Handle<Object> receiver); |
1234 | 1238 |
1235 // Returns the permanent hash code associated with this object. May return | 1239 // Returns the permanent hash code associated with this object. May return |
1236 // undefined if not yet created. | 1240 // undefined if not yet created. |
1237 Object* GetHash(); | 1241 Object* GetHash(); |
1238 | 1242 |
1239 // Returns undefined for JSObjects, but returns the hash code for simple | 1243 // Returns undefined for JSObjects, but returns the hash code for simple |
1240 // objects. This avoids a double lookup in the cases where we know we will | 1244 // objects. This avoids a double lookup in the cases where we know we will |
1241 // add the hash to the JSObject if it does not already exist. | 1245 // add the hash to the JSObject if it does not already exist. |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1664 ACCESSOR_SETTER | 1668 ACCESSOR_SETTER |
1665 }; | 1669 }; |
1666 | 1670 |
1667 | 1671 |
1668 // JSReceiver includes types on which properties can be defined, i.e., | 1672 // JSReceiver includes types on which properties can be defined, i.e., |
1669 // JSObject and JSProxy. | 1673 // JSObject and JSProxy. |
1670 class JSReceiver: public HeapObject { | 1674 class JSReceiver: public HeapObject { |
1671 public: | 1675 public: |
1672 DECLARE_CAST(JSReceiver) | 1676 DECLARE_CAST(JSReceiver) |
1673 | 1677 |
1674 MUST_USE_RESULT static MaybeHandle<Object> SetElement( | |
1675 Handle<JSReceiver> object, uint32_t index, Handle<Object> value, | |
1676 LanguageMode language_mode); | |
1677 | |
1678 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. | 1678 // Implementation of [[HasProperty]], ECMA-262 5th edition, section 8.12.6. |
1679 MUST_USE_RESULT static inline Maybe<bool> HasProperty( | 1679 MUST_USE_RESULT static inline Maybe<bool> HasProperty( |
1680 Handle<JSReceiver> object, Handle<Name> name); | 1680 Handle<JSReceiver> object, Handle<Name> name); |
1681 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>, | 1681 MUST_USE_RESULT static inline Maybe<bool> HasOwnProperty(Handle<JSReceiver>, |
1682 Handle<Name> name); | 1682 Handle<Name> name); |
1683 MUST_USE_RESULT static inline Maybe<bool> HasElement( | 1683 MUST_USE_RESULT static inline Maybe<bool> HasElement( |
1684 Handle<JSReceiver> object, uint32_t index); | 1684 Handle<JSReceiver> object, uint32_t index); |
1685 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement( | 1685 MUST_USE_RESULT static inline Maybe<bool> HasOwnElement( |
1686 Handle<JSReceiver> object, uint32_t index); | 1686 Handle<JSReceiver> object, uint32_t index); |
1687 | 1687 |
(...skipping 9143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10831 } else { | 10831 } else { |
10832 value &= ~(1 << bit_position); | 10832 value &= ~(1 << bit_position); |
10833 } | 10833 } |
10834 return value; | 10834 return value; |
10835 } | 10835 } |
10836 }; | 10836 }; |
10837 | 10837 |
10838 } } // namespace v8::internal | 10838 } } // namespace v8::internal |
10839 | 10839 |
10840 #endif // V8_OBJECTS_H_ | 10840 #endif // V8_OBJECTS_H_ |
OLD | NEW |