Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 1639343005: [generators] Implement Generator.prototype.return. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@yield-star
Patch Set: Another rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/ast-numbering.h" 8 #include "src/ast/ast-numbering.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 } 626 }
627 627
628 628
629 void FullCodeGenerator::EmitGeneratorNext(CallRuntime* expr) { 629 void FullCodeGenerator::EmitGeneratorNext(CallRuntime* expr) {
630 ZoneList<Expression*>* args = expr->arguments(); 630 ZoneList<Expression*>* args = expr->arguments();
631 DCHECK(args->length() == 2); 631 DCHECK(args->length() == 2);
632 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::NEXT); 632 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::NEXT);
633 } 633 }
634 634
635 635
636 void FullCodeGenerator::EmitGeneratorReturn(CallRuntime* expr) {
637 ZoneList<Expression*>* args = expr->arguments();
638 DCHECK(args->length() == 2);
639 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::RETURN);
640 }
641
642
636 void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) { 643 void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) {
637 ZoneList<Expression*>* args = expr->arguments(); 644 ZoneList<Expression*>* args = expr->arguments();
638 DCHECK(args->length() == 2); 645 DCHECK(args->length() == 2);
639 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::THROW); 646 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::THROW);
640 } 647 }
641 648
642 649
643 void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) { 650 void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) {
644 context()->Plug(handle(Smi::FromInt(0), isolate())); 651 context()->Plug(handle(Smi::FromInt(0), isolate()));
645 } 652 }
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1709 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1703 var->initializer_position() >= proxy->position(); 1710 var->initializer_position() >= proxy->position();
1704 } 1711 }
1705 1712
1706 1713
1707 #undef __ 1714 #undef __
1708 1715
1709 1716
1710 } // namespace internal 1717 } // namespace internal
1711 } // namespace v8 1718 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698