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/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 | 1106 |
1107 // Returns true if the object is of the correct type to be used as a | 1107 // Returns true if the object is of the correct type to be used as a |
1108 // implementation of a JSObject's elements. | 1108 // implementation of a JSObject's elements. |
1109 inline bool HasValidElements(); | 1109 inline bool HasValidElements(); |
1110 | 1110 |
1111 inline bool HasSpecificClassOf(String* name); | 1111 inline bool HasSpecificClassOf(String* name); |
1112 | 1112 |
1113 bool BooleanValue(); // ECMA-262 9.2. | 1113 bool BooleanValue(); // ECMA-262 9.2. |
1114 | 1114 |
1115 // ES6 section 7.2.11 Abstract Relational Comparison | 1115 // ES6 section 7.2.11 Abstract Relational Comparison |
1116 MUST_USE_RESULT static Maybe<ComparisonResult> Compare( | 1116 MUST_USE_RESULT static Maybe<ComparisonResult> Compare(Handle<Object> x, |
1117 Handle<Object> x, Handle<Object> y, Strength strength = Strength::WEAK); | 1117 Handle<Object> y); |
1118 | 1118 |
1119 // ES6 section 7.2.12 Abstract Equality Comparison | 1119 // ES6 section 7.2.12 Abstract Equality Comparison |
1120 MUST_USE_RESULT static Maybe<bool> Equals(Handle<Object> x, Handle<Object> y); | 1120 MUST_USE_RESULT static Maybe<bool> Equals(Handle<Object> x, Handle<Object> y); |
1121 | 1121 |
1122 // ES6 section 7.2.13 Strict Equality Comparison | 1122 // ES6 section 7.2.13 Strict Equality Comparison |
1123 bool StrictEquals(Object* that); | 1123 bool StrictEquals(Object* that); |
1124 | 1124 |
1125 // Convert to a JSObject if needed. | 1125 // Convert to a JSObject if needed. |
1126 // native_context is used when creating wrapper object. | 1126 // native_context is used when creating wrapper object. |
1127 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( | 1127 MUST_USE_RESULT static inline MaybeHandle<JSReceiver> ToObject( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1168 MUST_USE_RESULT static MaybeHandle<FixedArray> CreateListFromArrayLike( | 1168 MUST_USE_RESULT static MaybeHandle<FixedArray> CreateListFromArrayLike( |
1169 Isolate* isolate, Handle<Object> object, ElementTypes element_types); | 1169 Isolate* isolate, Handle<Object> object, ElementTypes element_types); |
1170 | 1170 |
1171 // Check whether |object| is an instance of Error or NativeError. | 1171 // Check whether |object| is an instance of Error or NativeError. |
1172 static bool IsErrorObject(Isolate* isolate, Handle<Object> object); | 1172 static bool IsErrorObject(Isolate* isolate, Handle<Object> object); |
1173 | 1173 |
1174 // ES6 section 12.5.6 The typeof Operator | 1174 // ES6 section 12.5.6 The typeof Operator |
1175 static Handle<String> TypeOf(Isolate* isolate, Handle<Object> object); | 1175 static Handle<String> TypeOf(Isolate* isolate, Handle<Object> object); |
1176 | 1176 |
1177 // ES6 section 12.6 Multiplicative Operators | 1177 // ES6 section 12.6 Multiplicative Operators |
1178 MUST_USE_RESULT static MaybeHandle<Object> Multiply( | 1178 MUST_USE_RESULT static MaybeHandle<Object> Multiply(Isolate* isolate, |
1179 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1179 Handle<Object> lhs, |
1180 Strength strength = Strength::WEAK); | 1180 Handle<Object> rhs); |
1181 MUST_USE_RESULT static MaybeHandle<Object> Divide( | 1181 MUST_USE_RESULT static MaybeHandle<Object> Divide(Isolate* isolate, |
1182 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1182 Handle<Object> lhs, |
1183 Strength strength = Strength::WEAK); | 1183 Handle<Object> rhs); |
1184 MUST_USE_RESULT static MaybeHandle<Object> Modulus( | 1184 MUST_USE_RESULT static MaybeHandle<Object> Modulus(Isolate* isolate, |
1185 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1185 Handle<Object> lhs, |
1186 Strength strength = Strength::WEAK); | 1186 Handle<Object> rhs); |
1187 | 1187 |
1188 // ES6 section 12.7 Additive Operators | 1188 // ES6 section 12.7 Additive Operators |
1189 MUST_USE_RESULT static MaybeHandle<Object> Add( | 1189 MUST_USE_RESULT static MaybeHandle<Object> Add(Isolate* isolate, |
1190 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1190 Handle<Object> lhs, |
1191 Strength strength = Strength::WEAK); | 1191 Handle<Object> rhs); |
1192 MUST_USE_RESULT static MaybeHandle<Object> Subtract( | 1192 MUST_USE_RESULT static MaybeHandle<Object> Subtract(Isolate* isolate, |
1193 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1193 Handle<Object> lhs, |
1194 Strength strength = Strength::WEAK); | 1194 Handle<Object> rhs); |
1195 | 1195 |
1196 // ES6 section 12.8 Bitwise Shift Operators | 1196 // ES6 section 12.8 Bitwise Shift Operators |
1197 MUST_USE_RESULT static MaybeHandle<Object> ShiftLeft( | 1197 MUST_USE_RESULT static MaybeHandle<Object> ShiftLeft(Isolate* isolate, |
1198 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1198 Handle<Object> lhs, |
1199 Strength strength = Strength::WEAK); | 1199 Handle<Object> rhs); |
1200 MUST_USE_RESULT static MaybeHandle<Object> ShiftRight( | 1200 MUST_USE_RESULT static MaybeHandle<Object> ShiftRight(Isolate* isolate, |
1201 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1201 Handle<Object> lhs, |
1202 Strength strength = Strength::WEAK); | 1202 Handle<Object> rhs); |
1203 MUST_USE_RESULT static MaybeHandle<Object> ShiftRightLogical( | 1203 MUST_USE_RESULT static MaybeHandle<Object> ShiftRightLogical( |
1204 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1204 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs); |
1205 Strength strength = Strength::WEAK); | |
1206 | 1205 |
1207 // ES6 section 12.9 Relational Operators | 1206 // ES6 section 12.9 Relational Operators |
1208 MUST_USE_RESULT static inline Maybe<bool> GreaterThan( | 1207 MUST_USE_RESULT static inline Maybe<bool> GreaterThan(Handle<Object> x, |
1209 Handle<Object> x, Handle<Object> y, Strength strength = Strength::WEAK); | 1208 Handle<Object> y); |
1210 MUST_USE_RESULT static inline Maybe<bool> GreaterThanOrEqual( | 1209 MUST_USE_RESULT static inline Maybe<bool> GreaterThanOrEqual( |
1211 Handle<Object> x, Handle<Object> y, Strength strength = Strength::WEAK); | 1210 Handle<Object> x, Handle<Object> y); |
1212 MUST_USE_RESULT static inline Maybe<bool> LessThan( | 1211 MUST_USE_RESULT static inline Maybe<bool> LessThan(Handle<Object> x, |
1213 Handle<Object> x, Handle<Object> y, Strength strength = Strength::WEAK); | 1212 Handle<Object> y); |
1214 MUST_USE_RESULT static inline Maybe<bool> LessThanOrEqual( | 1213 MUST_USE_RESULT static inline Maybe<bool> LessThanOrEqual(Handle<Object> x, |
1215 Handle<Object> x, Handle<Object> y, Strength strength = Strength::WEAK); | 1214 Handle<Object> y); |
1216 | 1215 |
1217 // ES6 section 12.11 Binary Bitwise Operators | 1216 // ES6 section 12.11 Binary Bitwise Operators |
1218 MUST_USE_RESULT static MaybeHandle<Object> BitwiseAnd( | 1217 MUST_USE_RESULT static MaybeHandle<Object> BitwiseAnd(Isolate* isolate, |
1219 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1218 Handle<Object> lhs, |
1220 Strength strength = Strength::WEAK); | 1219 Handle<Object> rhs); |
1221 MUST_USE_RESULT static MaybeHandle<Object> BitwiseOr( | 1220 MUST_USE_RESULT static MaybeHandle<Object> BitwiseOr(Isolate* isolate, |
1222 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1221 Handle<Object> lhs, |
1223 Strength strength = Strength::WEAK); | 1222 Handle<Object> rhs); |
1224 MUST_USE_RESULT static MaybeHandle<Object> BitwiseXor( | 1223 MUST_USE_RESULT static MaybeHandle<Object> BitwiseXor(Isolate* isolate, |
1225 Isolate* isolate, Handle<Object> lhs, Handle<Object> rhs, | 1224 Handle<Object> lhs, |
1226 Strength strength = Strength::WEAK); | 1225 Handle<Object> rhs); |
1227 | 1226 |
1228 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( | 1227 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( |
1229 LookupIterator* it, LanguageMode language_mode = SLOPPY); | 1228 LookupIterator* it, LanguageMode language_mode = SLOPPY); |
1230 | 1229 |
1231 // ES6 [[Set]] (when passed DONT_THROW) | 1230 // ES6 [[Set]] (when passed DONT_THROW) |
1232 // Invariants for this and related functions (unless stated otherwise): | 1231 // Invariants for this and related functions (unless stated otherwise): |
1233 // 1) When the result is Nothing, an exception is pending. | 1232 // 1) When the result is Nothing, an exception is pending. |
1234 // 2) When passed THROW_ON_ERROR, the result is never Just(false). | 1233 // 2) When passed THROW_ON_ERROR, the result is never Just(false). |
1235 // In some cases, an exception is thrown regardless of the ShouldThrow | 1234 // In some cases, an exception is thrown regardless of the ShouldThrow |
1236 // argument. These cases are either in accordance with the spec or not | 1235 // argument. These cases are either in accordance with the spec or not |
(...skipping 9614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10851 } | 10850 } |
10852 return value; | 10851 return value; |
10853 } | 10852 } |
10854 }; | 10853 }; |
10855 | 10854 |
10856 | 10855 |
10857 } // NOLINT, false-positive due to second-order macros. | 10856 } // NOLINT, false-positive due to second-order macros. |
10858 } // NOLINT, false-positive due to second-order macros. | 10857 } // NOLINT, false-positive due to second-order macros. |
10859 | 10858 |
10860 #endif // V8_OBJECTS_H_ | 10859 #endif // V8_OBJECTS_H_ |
OLD | NEW |