OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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-async-gen.h" | 5 #include "src/builtins/builtins-async-gen.h" |
6 #include "src/builtins/builtins-utils-gen.h" | 6 #include "src/builtins/builtins-utils-gen.h" |
7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
10 #include "src/frames-inl.h" | 10 #include "src/frames-inl.h" |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 CallStub(CodeFactory::ResumeGenerator(isolate()), context, | 525 CallStub(CodeFactory::ResumeGenerator(isolate()), context, |
526 LoadValueFromAsyncGeneratorRequest(next), generator, resume_type, | 526 LoadValueFromAsyncGeneratorRequest(next), generator, resume_type, |
527 SmiConstant(static_cast<int>(SuspendFlags::kAsyncGeneratorYield))); | 527 SmiConstant(static_cast<int>(SuspendFlags::kAsyncGeneratorYield))); |
528 var_state.Bind(LoadGeneratorState(generator)); | 528 var_state.Bind(LoadGeneratorState(generator)); |
529 var_next.Bind(LoadFirstAsyncGeneratorRequestFromQueue(generator)); | 529 var_next.Bind(LoadFirstAsyncGeneratorRequestFromQueue(generator)); |
530 Goto(&start); | 530 Goto(&start); |
531 } | 531 } |
532 } | 532 } |
533 | 533 |
534 TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) { | 534 TF_BUILTIN(AsyncGeneratorResolve, AsyncGeneratorBuiltinsAssembler) { |
535 typedef AsyncGeneratorResolveDescriptor Descriptor; | |
536 Node* const generator = Parameter(Descriptor::kGenerator); | 535 Node* const generator = Parameter(Descriptor::kGenerator); |
537 Node* const value = Parameter(Descriptor::kValue); | 536 Node* const value = Parameter(Descriptor::kValue); |
538 Node* const done = Parameter(Descriptor::kDone); | 537 Node* const done = Parameter(Descriptor::kDone); |
539 Node* const context = Parameter(Descriptor::kContext); | 538 Node* const context = Parameter(Descriptor::kContext); |
540 | 539 |
541 Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); | 540 Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); |
542 Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); | 541 Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); |
543 | 542 |
544 Node* const wrapper = AllocateAndInitJSPromise(context); | 543 Node* const wrapper = AllocateAndInitJSPromise(context); |
545 CallBuiltin(Builtins::kResolveNativePromise, context, wrapper, value); | 544 CallBuiltin(Builtins::kResolveNativePromise, context, wrapper, value); |
(...skipping 15 matching lines...) Expand all Loading... |
561 | 560 |
562 Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); | 561 Node* const next = TakeFirstAsyncGeneratorRequestFromQueue(generator); |
563 Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); | 562 Node* const promise = LoadPromiseFromAsyncGeneratorRequest(next); |
564 | 563 |
565 Return(CallBuiltin(Builtins::kRejectNativePromise, context, promise, value, | 564 Return(CallBuiltin(Builtins::kRejectNativePromise, context, promise, value, |
566 TrueConstant())); | 565 TrueConstant())); |
567 } | 566 } |
568 | 567 |
569 } // namespace internal | 568 } // namespace internal |
570 } // namespace v8 | 569 } // namespace v8 |
OLD | NEW |