OLD | NEW |
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 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); | 1542 Comment cmnt(masm_, "[ SharedFunctionInfoLiteral"); |
1543 EmitNewClosure(expr->shared_function_info(), false); | 1543 EmitNewClosure(expr->shared_function_info(), false); |
1544 } | 1544 } |
1545 | 1545 |
1546 | 1546 |
1547 void FullCodeGenerator::VisitYield(Yield* expr) { | 1547 void FullCodeGenerator::VisitYield(Yield* expr) { |
1548 if (expr->is_delegating_yield()) | 1548 if (expr->is_delegating_yield()) |
1549 UNIMPLEMENTED(); | 1549 UNIMPLEMENTED(); |
1550 | 1550 |
1551 Comment cmnt(masm_, "[ Yield"); | 1551 Comment cmnt(masm_, "[ Yield"); |
| 1552 // TODO(wingo): Actually update the iterator state. |
| 1553 VisitForEffect(expr->iterator()); |
1552 VisitForAccumulatorValue(expr->expression()); | 1554 VisitForAccumulatorValue(expr->expression()); |
1553 // TODO(wingo): Assert that the operand stack depth is 0, at least while | 1555 // TODO(wingo): Assert that the operand stack depth is 0, at least while |
1554 // general yield expressions are unimplemented. | 1556 // general yield expressions are unimplemented. |
1555 | 1557 |
1556 // TODO(wingo): What follows is as in VisitReturnStatement. Replace it with a | 1558 // TODO(wingo): What follows is as in VisitReturnStatement. Replace it with a |
1557 // call to a builtin that will resume the generator. | 1559 // call to a builtin that will resume the generator. |
1558 NestedStatement* current = nesting_stack_; | 1560 NestedStatement* current = nesting_stack_; |
1559 int stack_depth = 0; | 1561 int stack_depth = 0; |
1560 int context_length = 0; | 1562 int context_length = 0; |
1561 while (current != NULL) { | 1563 while (current != NULL) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1604 } | 1606 } |
1605 | 1607 |
1606 return false; | 1608 return false; |
1607 } | 1609 } |
1608 | 1610 |
1609 | 1611 |
1610 #undef __ | 1612 #undef __ |
1611 | 1613 |
1612 | 1614 |
1613 } } // namespace v8::internal | 1615 } } // namespace v8::internal |
OLD | NEW |