OLD | NEW |
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 } | 628 } |
629 | 629 |
630 | 630 |
631 void FullCodeGenerator::EmitGeneratorNext(CallRuntime* expr) { | 631 void FullCodeGenerator::EmitGeneratorNext(CallRuntime* expr) { |
632 ZoneList<Expression*>* args = expr->arguments(); | 632 ZoneList<Expression*>* args = expr->arguments(); |
633 DCHECK(args->length() == 2); | 633 DCHECK(args->length() == 2); |
634 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::NEXT); | 634 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::NEXT); |
635 } | 635 } |
636 | 636 |
637 | 637 |
| 638 void FullCodeGenerator::EmitGeneratorReturn(CallRuntime* expr) { |
| 639 ZoneList<Expression*>* args = expr->arguments(); |
| 640 DCHECK(args->length() == 2); |
| 641 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::RETURN); |
| 642 } |
| 643 |
| 644 |
638 void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) { | 645 void FullCodeGenerator::EmitGeneratorThrow(CallRuntime* expr) { |
639 ZoneList<Expression*>* args = expr->arguments(); | 646 ZoneList<Expression*>* args = expr->arguments(); |
640 DCHECK(args->length() == 2); | 647 DCHECK(args->length() == 2); |
641 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::THROW); | 648 EmitGeneratorResume(args->at(0), args->at(1), JSGeneratorObject::THROW); |
642 } | 649 } |
643 | 650 |
644 | 651 |
645 void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) { | 652 void FullCodeGenerator::EmitDebugBreakInOptimizedCode(CallRuntime* expr) { |
646 context()->Plug(handle(Smi::FromInt(0), isolate())); | 653 context()->Plug(handle(Smi::FromInt(0), isolate())); |
647 } | 654 } |
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1735 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || | 1742 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || |
1736 var->initializer_position() >= proxy->position(); | 1743 var->initializer_position() >= proxy->position(); |
1737 } | 1744 } |
1738 | 1745 |
1739 | 1746 |
1740 #undef __ | 1747 #undef __ |
1741 | 1748 |
1742 | 1749 |
1743 } // namespace internal | 1750 } // namespace internal |
1744 } // namespace v8 | 1751 } // namespace v8 |
OLD | NEW |