Chromium Code Reviews| 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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 985 Label* if_not_found, Label* if_bailout); | 985 Label* if_not_found, Label* if_bailout); |
| 986 | 986 |
| 987 // Tries to get {object}'s own {unique_name} property value. If the property | 987 // 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 | 988 // 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. | 989 // field it re-wraps value in an immutable heap number. |
| 990 void TryGetOwnProperty(Node* context, Node* receiver, Node* object, Node* map, | 990 void TryGetOwnProperty(Node* context, Node* receiver, Node* object, Node* map, |
| 991 Node* instance_type, Node* unique_name, | 991 Node* instance_type, Node* unique_name, |
| 992 Label* if_found, Variable* var_value, | 992 Label* if_found, Variable* var_value, |
| 993 Label* if_not_found, Label* if_bailout); | 993 Label* if_not_found, Label* if_bailout); |
| 994 | 994 |
| 995 Node* GetProperty(Node* context, Node* receiver, Handle<Name> name) { | |
| 996 return CallStub(CodeFactory::GetProperty(isolate()), context, receiver, | |
| 997 HeapConstant(name)); | |
| 998 } | |
| 999 | |
| 995 void LoadPropertyFromFastObject(Node* object, Node* map, Node* descriptors, | 1000 void LoadPropertyFromFastObject(Node* object, Node* map, Node* descriptors, |
| 996 Node* name_index, Variable* var_details, | 1001 Node* name_index, Variable* var_details, |
| 997 Variable* var_value); | 1002 Variable* var_value); |
| 998 | 1003 |
| 999 void LoadPropertyFromNameDictionary(Node* dictionary, Node* entry, | 1004 void LoadPropertyFromNameDictionary(Node* dictionary, Node* entry, |
| 1000 Variable* var_details, | 1005 Variable* var_details, |
| 1001 Variable* var_value); | 1006 Variable* var_value); |
| 1002 | 1007 |
| 1003 void LoadPropertyFromGlobalDictionary(Node* dictionary, Node* entry, | 1008 void LoadPropertyFromGlobalDictionary(Node* dictionary, Node* entry, |
| 1004 Variable* var_details, | 1009 Variable* var_details, |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 Node* AllocatePromiseReactionJobInfo(Node* value, Node* tasks, | 1239 Node* AllocatePromiseReactionJobInfo(Node* value, Node* tasks, |
| 1235 Node* deferred_promise, | 1240 Node* deferred_promise, |
| 1236 Node* deferred_on_resolve, | 1241 Node* deferred_on_resolve, |
| 1237 Node* deferred_on_reject, Node* context); | 1242 Node* deferred_on_reject, Node* context); |
| 1238 | 1243 |
| 1239 // Support for printf-style debugging | 1244 // Support for printf-style debugging |
| 1240 void Print(const char* s); | 1245 void Print(const char* s); |
| 1241 void Print(const char* prefix, Node* tagged_value); | 1246 void Print(const char* prefix, Node* tagged_value); |
| 1242 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } | 1247 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } |
| 1243 | 1248 |
| 1249 template <class... TArgs> | |
| 1250 Node* MakeTypeError(MessageTemplate::Template message, Node* context, | |
|
jgruber
2017/02/17 12:28:23
Great to have this and the above. We should update
| |
| 1251 TArgs... args) { | |
|
jgruber
2017/02/17 12:28:23
The MakeTypeError builtin can only handle up to 3
caitp
2017/02/17 14:56:10
Done.
| |
| 1252 Node* const make_type_error = LoadContextElement( | |
| 1253 LoadNativeContext(context), Context::MAKE_TYPE_ERROR_INDEX); | |
| 1254 return CallJS(CodeFactory::Call(isolate()), context, make_type_error, | |
| 1255 UndefinedConstant(), SmiConstant(message), args...); | |
| 1256 } | |
| 1257 | |
| 1244 protected: | 1258 protected: |
| 1245 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, | 1259 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, |
| 1246 Label* if_found, Variable* var_name_index, | 1260 Label* if_found, Variable* var_name_index, |
| 1247 Label* if_not_found); | 1261 Label* if_not_found); |
| 1248 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, | 1262 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, |
| 1249 Label* if_found, Variable* var_name_index, | 1263 Label* if_found, Variable* var_name_index, |
| 1250 Label* if_not_found); | 1264 Label* if_not_found); |
| 1251 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, | 1265 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, |
| 1252 Label* if_found, Variable* var_name_index, | 1266 Label* if_found, Variable* var_name_index, |
| 1253 Label* if_not_found); | 1267 Label* if_not_found); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1387 } | 1401 } |
| 1388 #else | 1402 #else |
| 1389 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1403 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1390 #endif | 1404 #endif |
| 1391 | 1405 |
| 1392 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1406 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1393 | 1407 |
| 1394 } // namespace internal | 1408 } // namespace internal |
| 1395 } // namespace v8 | 1409 } // namespace v8 |
| 1396 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1410 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |