OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 // ES6 section 7.2.13 Strict Equality Comparison | 1124 // ES6 section 7.2.13 Strict Equality Comparison |
1125 bool StrictEquals(Object* that); | 1125 bool StrictEquals(Object* that); |
1126 | 1126 |
1127 // Convert to a JSObject if needed. | 1127 // Convert to a JSObject if needed. |
1128 // native_context is used when creating wrapper object. | 1128 // native_context is used when creating wrapper object. |
1129 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( | 1129 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( |
1130 Isolate* isolate, Handle<Object> object); | 1130 Isolate* isolate, Handle<Object> object); |
1131 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( | 1131 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( |
1132 Isolate* isolate, Handle<Object> object, Handle<Context> context); | 1132 Isolate* isolate, Handle<Object> object, Handle<Context> context); |
1133 | 1133 |
| 1134 // ES6 section 9.2.1.2, OrdinaryCallBindThis for sloppy callee. |
| 1135 MUST_USE_RESULT static MaybeHandle<JSReceiver> ConvertReceiver( |
| 1136 Isolate* isolate, Handle<Object> object); |
| 1137 |
1134 // ES6 section 7.1.14 ToPropertyKey | 1138 // ES6 section 7.1.14 ToPropertyKey |
1135 MUST_USE_RESULT static inline MaybeHandle<Name> ToName(Isolate* isolate, | 1139 MUST_USE_RESULT static inline MaybeHandle<Name> ToName(Isolate* isolate, |
1136 Handle<Object> input); | 1140 Handle<Object> input); |
1137 | 1141 |
1138 // ES6 section 7.1.1 ToPrimitive | 1142 // ES6 section 7.1.1 ToPrimitive |
1139 MUST_USE_RESULT static inline MaybeHandle<Object> ToPrimitive( | 1143 MUST_USE_RESULT static inline MaybeHandle<Object> ToPrimitive( |
1140 Handle<Object> input, ToPrimitiveHint hint = ToPrimitiveHint::kDefault); | 1144 Handle<Object> input, ToPrimitiveHint hint = ToPrimitiveHint::kDefault); |
1141 | 1145 |
1142 // ES6 section 7.1.3 ToNumber | 1146 // ES6 section 7.1.3 ToNumber |
1143 MUST_USE_RESULT static MaybeHandle<Object> ToNumber(Handle<Object> input); | 1147 MUST_USE_RESULT static MaybeHandle<Object> ToNumber(Handle<Object> input); |
(...skipping 9254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10398 | 10402 |
10399 inline bool all_can_read(); | 10403 inline bool all_can_read(); |
10400 inline void set_all_can_read(bool value); | 10404 inline void set_all_can_read(bool value); |
10401 | 10405 |
10402 inline bool all_can_write(); | 10406 inline bool all_can_write(); |
10403 inline void set_all_can_write(bool value); | 10407 inline void set_all_can_write(bool value); |
10404 | 10408 |
10405 inline bool is_special_data_property(); | 10409 inline bool is_special_data_property(); |
10406 inline void set_is_special_data_property(bool value); | 10410 inline void set_is_special_data_property(bool value); |
10407 | 10411 |
| 10412 inline bool is_sloppy(); |
| 10413 inline void set_is_sloppy(bool value); |
| 10414 |
10408 inline PropertyAttributes property_attributes(); | 10415 inline PropertyAttributes property_attributes(); |
10409 inline void set_property_attributes(PropertyAttributes attributes); | 10416 inline void set_property_attributes(PropertyAttributes attributes); |
10410 | 10417 |
10411 // Checks whether the given receiver is compatible with this accessor. | 10418 // Checks whether the given receiver is compatible with this accessor. |
10412 static bool IsCompatibleReceiverMap(Isolate* isolate, | 10419 static bool IsCompatibleReceiverMap(Isolate* isolate, |
10413 Handle<AccessorInfo> info, | 10420 Handle<AccessorInfo> info, |
10414 Handle<Map> map); | 10421 Handle<Map> map); |
10415 inline bool IsCompatibleReceiver(Object* receiver); | 10422 inline bool IsCompatibleReceiver(Object* receiver); |
10416 | 10423 |
10417 DECLARE_CAST(AccessorInfo) | 10424 DECLARE_CAST(AccessorInfo) |
(...skipping 16 matching lines...) Expand all Loading... |
10434 static const int kSize = kDataOffset + kPointerSize; | 10441 static const int kSize = kDataOffset + kPointerSize; |
10435 | 10442 |
10436 | 10443 |
10437 private: | 10444 private: |
10438 inline bool HasExpectedReceiverType(); | 10445 inline bool HasExpectedReceiverType(); |
10439 | 10446 |
10440 // Bit positions in flag. | 10447 // Bit positions in flag. |
10441 static const int kAllCanReadBit = 0; | 10448 static const int kAllCanReadBit = 0; |
10442 static const int kAllCanWriteBit = 1; | 10449 static const int kAllCanWriteBit = 1; |
10443 static const int kSpecialDataProperty = 2; | 10450 static const int kSpecialDataProperty = 2; |
10444 class AttributesField : public BitField<PropertyAttributes, 3, 3> {}; | 10451 static const int kIsSloppy = 3; |
| 10452 class AttributesField : public BitField<PropertyAttributes, 4, 3> {}; |
10445 | 10453 |
10446 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); | 10454 DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo); |
10447 }; | 10455 }; |
10448 | 10456 |
10449 | 10457 |
10450 // Support for JavaScript accessors: A pair of a getter and a setter. Each | 10458 // Support for JavaScript accessors: A pair of a getter and a setter. Each |
10451 // accessor can either be | 10459 // accessor can either be |
10452 // * a pointer to a JavaScript function or proxy: a real accessor | 10460 // * a pointer to a JavaScript function or proxy: a real accessor |
10453 // * undefined: considered an accessor by the spec, too, strangely enough | 10461 // * undefined: considered an accessor by the spec, too, strangely enough |
10454 // * the hole: an accessor which has not been set | 10462 // * the hole: an accessor which has not been set |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10925 } | 10933 } |
10926 return value; | 10934 return value; |
10927 } | 10935 } |
10928 }; | 10936 }; |
10929 | 10937 |
10930 | 10938 |
10931 } // NOLINT, false-positive due to second-order macros. | 10939 } // NOLINT, false-positive due to second-order macros. |
10932 } // NOLINT, false-positive due to second-order macros. | 10940 } // NOLINT, false-positive due to second-order macros. |
10933 | 10941 |
10934 #endif // V8_OBJECTS_H_ | 10942 #endif // V8_OBJECTS_H_ |
OLD | NEW |