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

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

Issue 1634553002: Fix bug where generators got closed prematurely. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. 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/x64/full-codegen-x64.cc ('k') | src/js/generator.js » ('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 #if V8_TARGET_ARCH_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1853 __ bind(&post_runtime); 1853 __ bind(&post_runtime);
1854 __ pop(result_register()); 1854 __ pop(result_register());
1855 EmitReturnSequence(); 1855 EmitReturnSequence();
1856 1856
1857 __ bind(&resume); 1857 __ bind(&resume);
1858 context()->Plug(result_register()); 1858 context()->Plug(result_register());
1859 break; 1859 break;
1860 } 1860 }
1861 1861
1862 case Yield::kFinal: { 1862 case Yield::kFinal: {
1863 VisitForAccumulatorValue(expr->generator_object());
1864 __ mov(FieldOperand(result_register(),
1865 JSGeneratorObject::kContinuationOffset),
1866 Immediate(Smi::FromInt(JSGeneratorObject::kGeneratorClosed)));
1867 // Pop value from top-of-stack slot, box result into result register. 1863 // Pop value from top-of-stack slot, box result into result register.
1868 EmitCreateIteratorResult(true); 1864 EmitCreateIteratorResult(true);
1869 EmitUnwindBeforeReturn(); 1865 EmitUnwindBeforeReturn();
1870 EmitReturnSequence(); 1866 EmitReturnSequence();
1871 break; 1867 break;
1872 } 1868 }
1873 1869
1874 case Yield::kDelegating: { 1870 case Yield::kDelegating: {
1875 VisitForStackValue(expr->generator_object()); 1871 VisitForStackValue(expr->generator_object());
1876 1872
(...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after
4710 Assembler::target_address_at(call_target_address, 4706 Assembler::target_address_at(call_target_address,
4711 unoptimized_code)); 4707 unoptimized_code));
4712 return OSR_AFTER_STACK_CHECK; 4708 return OSR_AFTER_STACK_CHECK;
4713 } 4709 }
4714 4710
4715 4711
4716 } // namespace internal 4712 } // namespace internal
4717 } // namespace v8 4713 } // namespace v8
4718 4714
4719 #endif // V8_TARGET_ARCH_X87 4715 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/js/generator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698