| 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 #include "src/builtins/builtins-constructor.h" | 5 #include "src/builtins/builtins-constructor.h" |
| 6 #include "src/builtins/builtins-promise.h" | 6 #include "src/builtins/builtins-promise.h" |
| 7 #include "src/builtins/builtins-utils-gen.h" | 7 #include "src/builtins/builtins-utils-gen.h" |
| 8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1196 TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) { | 1196 TF_BUILTIN(ResolvePromise, PromiseBuiltinsAssembler) { |
| 1197 Node* const promise = Parameter(1); | 1197 Node* const promise = Parameter(1); |
| 1198 Node* const result = Parameter(2); | 1198 Node* const result = Parameter(2); |
| 1199 Node* const context = Parameter(5); | 1199 Node* const context = Parameter(5); |
| 1200 | 1200 |
| 1201 InternalResolvePromise(context, promise, result); | 1201 InternalResolvePromise(context, promise, result); |
| 1202 Return(UndefinedConstant()); | 1202 Return(UndefinedConstant()); |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 TF_BUILTIN(PromiseHandleReject, PromiseBuiltinsAssembler) { | 1205 TF_BUILTIN(PromiseHandleReject, PromiseBuiltinsAssembler) { |
| 1206 typedef PromiseHandleRejectDescriptor Descriptor; | 1206 typedef GenericTagged3Descriptor Descriptor; |
| 1207 | 1207 |
| 1208 Node* const promise = Parameter(Descriptor::kPromise); | 1208 Node* const promise = Parameter(Descriptor::kFirst); |
| 1209 Node* const on_reject = Parameter(Descriptor::kOnReject); | 1209 Node* const on_reject = Parameter(Descriptor::kSecond); |
| 1210 Node* const exception = Parameter(Descriptor::kException); | 1210 Node* const exception = Parameter(Descriptor::kThird); |
| 1211 Node* const context = Parameter(Descriptor::kContext); | 1211 Node* const context = Parameter(Descriptor::kContext); |
| 1212 | 1212 |
| 1213 Callable call_callable = CodeFactory::Call(isolate()); | 1213 Callable call_callable = CodeFactory::Call(isolate()); |
| 1214 Variable var_unused(this, MachineRepresentation::kTagged); | 1214 Variable var_unused(this, MachineRepresentation::kTagged); |
| 1215 | 1215 |
| 1216 Label if_internalhandler(this), if_customhandler(this, Label::kDeferred); | 1216 Label if_internalhandler(this), if_customhandler(this, Label::kDeferred); |
| 1217 Branch(IsUndefined(on_reject), &if_internalhandler, &if_customhandler); | 1217 Branch(IsUndefined(on_reject), &if_internalhandler, &if_customhandler); |
| 1218 | 1218 |
| 1219 Bind(&if_internalhandler); | 1219 Bind(&if_internalhandler); |
| 1220 { | 1220 { |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 // 5. Return ? Invoke(promise, "then", « thenFinally, catchFinally »). | 1754 // 5. Return ? Invoke(promise, "then", « thenFinally, catchFinally »). |
| 1755 Node* const result = | 1755 Node* const result = |
| 1756 CallJS(call_callable, context, then, promise, var_then_finally.value(), | 1756 CallJS(call_callable, context, then, promise, var_then_finally.value(), |
| 1757 var_catch_finally.value()); | 1757 var_catch_finally.value()); |
| 1758 Return(result); | 1758 Return(result); |
| 1759 } | 1759 } |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 } // namespace internal | 1762 } // namespace internal |
| 1763 } // namespace v8 | 1763 } // namespace v8 |
| OLD | NEW |