OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 // JSProxy or an object with interceptors. | 685 // JSProxy or an object with interceptors. |
686 Node* InstanceTypeEqual(Node* instance_type, int type); | 686 Node* InstanceTypeEqual(Node* instance_type, int type); |
687 Node* IsSpecialReceiverMap(Node* map); | 687 Node* IsSpecialReceiverMap(Node* map); |
688 Node* IsSpecialReceiverInstanceType(Node* instance_type); | 688 Node* IsSpecialReceiverInstanceType(Node* instance_type); |
689 Node* IsStringInstanceType(Node* instance_type); | 689 Node* IsStringInstanceType(Node* instance_type); |
690 Node* IsString(Node* object); | 690 Node* IsString(Node* object); |
691 Node* IsJSObject(Node* object); | 691 Node* IsJSObject(Node* object); |
692 Node* IsJSGlobalProxy(Node* object); | 692 Node* IsJSGlobalProxy(Node* object); |
693 Node* IsJSReceiverInstanceType(Node* instance_type); | 693 Node* IsJSReceiverInstanceType(Node* instance_type); |
694 Node* IsJSReceiver(Node* object); | 694 Node* IsJSReceiver(Node* object); |
| 695 Node* IsJSReceiverMap(Node* map); |
695 Node* IsMap(Node* object); | 696 Node* IsMap(Node* object); |
696 Node* IsCallableMap(Node* map); | 697 Node* IsCallableMap(Node* map); |
697 Node* IsCallable(Node* object); | 698 Node* IsCallable(Node* object); |
698 Node* IsBoolean(Node* object); | 699 Node* IsBoolean(Node* object); |
699 Node* IsName(Node* object); | 700 Node* IsName(Node* object); |
700 Node* IsSymbol(Node* object); | 701 Node* IsSymbol(Node* object); |
701 Node* IsPrivateSymbol(Node* object); | 702 Node* IsPrivateSymbol(Node* object); |
702 Node* IsJSValue(Node* object); | 703 Node* IsJSValue(Node* object); |
703 Node* IsJSArray(Node* object); | 704 Node* IsJSArray(Node* object); |
704 Node* IsNativeContext(Node* object); | 705 Node* IsNativeContext(Node* object); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 Label* if_not_found, Label* if_bailout); | 986 Label* if_not_found, Label* if_bailout); |
986 | 987 |
987 // Tries to get {object}'s own {unique_name} property value. If the property | 988 // Tries to get {object}'s own {unique_name} property value. If the property |
988 // is an accessor then it also calls a getter. If the property is a double | 989 // is an accessor then it also calls a getter. If the property is a double |
989 // field it re-wraps value in an immutable heap number. | 990 // field it re-wraps value in an immutable heap number. |
990 void TryGetOwnProperty(Node* context, Node* receiver, Node* object, Node* map, | 991 void TryGetOwnProperty(Node* context, Node* receiver, Node* object, Node* map, |
991 Node* instance_type, Node* unique_name, | 992 Node* instance_type, Node* unique_name, |
992 Label* if_found, Variable* var_value, | 993 Label* if_found, Variable* var_value, |
993 Label* if_not_found, Label* if_bailout); | 994 Label* if_not_found, Label* if_bailout); |
994 | 995 |
| 996 Node* GetProperty(Node* context, Node* receiver, Handle<Name> name) { |
| 997 return CallStub(CodeFactory::GetProperty(isolate()), context, receiver, |
| 998 HeapConstant(name)); |
| 999 } |
| 1000 |
995 void LoadPropertyFromFastObject(Node* object, Node* map, Node* descriptors, | 1001 void LoadPropertyFromFastObject(Node* object, Node* map, Node* descriptors, |
996 Node* name_index, Variable* var_details, | 1002 Node* name_index, Variable* var_details, |
997 Variable* var_value); | 1003 Variable* var_value); |
998 | 1004 |
999 void LoadPropertyFromNameDictionary(Node* dictionary, Node* entry, | 1005 void LoadPropertyFromNameDictionary(Node* dictionary, Node* entry, |
1000 Variable* var_details, | 1006 Variable* var_details, |
1001 Variable* var_value); | 1007 Variable* var_value); |
1002 | 1008 |
1003 void LoadPropertyFromGlobalDictionary(Node* dictionary, Node* entry, | 1009 void LoadPropertyFromGlobalDictionary(Node* dictionary, Node* entry, |
1004 Variable* var_details, | 1010 Variable* var_details, |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 Node* AllocatePromiseReactionJobInfo(Node* value, Node* tasks, | 1240 Node* AllocatePromiseReactionJobInfo(Node* value, Node* tasks, |
1235 Node* deferred_promise, | 1241 Node* deferred_promise, |
1236 Node* deferred_on_resolve, | 1242 Node* deferred_on_resolve, |
1237 Node* deferred_on_reject, Node* context); | 1243 Node* deferred_on_reject, Node* context); |
1238 | 1244 |
1239 // Support for printf-style debugging | 1245 // Support for printf-style debugging |
1240 void Print(const char* s); | 1246 void Print(const char* s); |
1241 void Print(const char* prefix, Node* tagged_value); | 1247 void Print(const char* prefix, Node* tagged_value); |
1242 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } | 1248 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } |
1243 | 1249 |
| 1250 template <class... TArgs> |
| 1251 Node* MakeTypeError(MessageTemplate::Template message, Node* context, |
| 1252 TArgs... args) { |
| 1253 STATIC_ASSERT(sizeof...(TArgs) <= 3); |
| 1254 Node* const make_type_error = LoadContextElement( |
| 1255 LoadNativeContext(context), Context::MAKE_TYPE_ERROR_INDEX); |
| 1256 return CallJS(CodeFactory::Call(isolate()), context, make_type_error, |
| 1257 UndefinedConstant(), SmiConstant(message), args...); |
| 1258 } |
| 1259 |
1244 protected: | 1260 protected: |
1245 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, | 1261 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, |
1246 Label* if_found, Variable* var_name_index, | 1262 Label* if_found, Variable* var_name_index, |
1247 Label* if_not_found); | 1263 Label* if_not_found); |
1248 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, | 1264 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, |
1249 Label* if_found, Variable* var_name_index, | 1265 Label* if_found, Variable* var_name_index, |
1250 Label* if_not_found); | 1266 Label* if_not_found); |
1251 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, | 1267 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, |
1252 Label* if_found, Variable* var_name_index, | 1268 Label* if_found, Variable* var_name_index, |
1253 Label* if_not_found); | 1269 Label* if_not_found); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 } | 1403 } |
1388 #else | 1404 #else |
1389 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1405 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1390 #endif | 1406 #endif |
1391 | 1407 |
1392 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1408 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1393 | 1409 |
1394 } // namespace internal | 1410 } // namespace internal |
1395 } // namespace v8 | 1411 } // namespace v8 |
1396 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1412 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |