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

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

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix nits; generator object fields are undefined if not set Created 7 years, 8 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/ast.h ('k') | src/heap.h » ('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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1546 Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); 1546 Comment cmnt(masm_, "[ SharedFunctionInfoLiteral");
1547 EmitNewClosure(expr->shared_function_info(), false); 1547 EmitNewClosure(expr->shared_function_info(), false);
1548 } 1548 }
1549 1549
1550 1550
1551 void FullCodeGenerator::VisitYield(Yield* expr) { 1551 void FullCodeGenerator::VisitYield(Yield* expr) {
1552 if (expr->is_delegating_yield()) 1552 if (expr->is_delegating_yield())
1553 UNIMPLEMENTED(); 1553 UNIMPLEMENTED();
1554 1554
1555 Comment cmnt(masm_, "[ Yield"); 1555 Comment cmnt(masm_, "[ Yield");
1556 // TODO(wingo): Actually update the iterator state.
1557 VisitForEffect(expr->generator_object());
1556 VisitForAccumulatorValue(expr->expression()); 1558 VisitForAccumulatorValue(expr->expression());
1557 // TODO(wingo): Assert that the operand stack depth is 0, at least while 1559 // TODO(wingo): Assert that the operand stack depth is 0, at least while
1558 // general yield expressions are unimplemented. 1560 // general yield expressions are unimplemented.
1559 1561
1560 // TODO(wingo): What follows is as in VisitReturnStatement. Replace it with a 1562 // TODO(wingo): What follows is as in VisitReturnStatement. Replace it with a
1561 // call to a builtin that will resume the generator. 1563 // call to a builtin that will resume the generator.
1562 NestedStatement* current = nesting_stack_; 1564 NestedStatement* current = nesting_stack_;
1563 int stack_depth = 0; 1565 int stack_depth = 0;
1564 int context_length = 0; 1566 int context_length = 0;
1565 while (current != NULL) { 1567 while (current != NULL) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 } 1610 }
1609 1611
1610 return false; 1612 return false;
1611 } 1613 }
1612 1614
1613 1615
1614 #undef __ 1616 #undef __
1615 1617
1616 1618
1617 } } // namespace v8::internal 1619 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ast.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698