| Index: src/full-codegen.cc
|
| diff --git a/src/full-codegen.cc b/src/full-codegen.cc
|
| index cb6f228a171af35f232ac8576733d9ec4b8991e7..a1b52bd360b3dbdec199b06a7b5a7305d61e6ebc 100644
|
| --- a/src/full-codegen.cc
|
| +++ b/src/full-codegen.cc
|
| @@ -232,6 +232,12 @@ void BreakableStatementChecker::VisitAssignment(Assignment* expr) {
|
| }
|
|
|
|
|
| +void BreakableStatementChecker::VisitYield(Yield* expr) {
|
| + // Yield is breakable if the expression is.
|
| + Visit(expr->expression());
|
| +}
|
| +
|
| +
|
| void BreakableStatementChecker::VisitThrow(Throw* expr) {
|
| // Throw is breakable if the expression is.
|
| Visit(expr->exception());
|
| @@ -1538,6 +1544,28 @@ void FullCodeGenerator::VisitSharedFunctionInfoLiteral(
|
| }
|
|
|
|
|
| +void FullCodeGenerator::VisitYield(Yield* expr) {
|
| + if (expr->is_delegating_yield())
|
| + UNIMPLEMENTED();
|
| +
|
| + Comment cmnt(masm_, "[ Yield");
|
| + VisitForAccumulatorValue(expr->expression());
|
| + // Unfortunately, it seems that the full-codegen doesn't maintain a stack
|
| + // depth counter. Otherwise we should assert that the operand stack depth
|
| + // is 0, at least while general yield expressions are unimplemented.
|
| +
|
| + // What follows is as in VisitReturnStatement.
|
| + NestedStatement* current = nesting_stack_;
|
| + int stack_depth = 0;
|
| + int context_length = 0;
|
| + while (current != NULL) {
|
| + current = current->Exit(&stack_depth, &context_length);
|
| + }
|
| + __ Drop(stack_depth);
|
| + EmitReturnSequence();
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::VisitThrow(Throw* expr) {
|
| Comment cmnt(masm_, "[ Throw");
|
| VisitForStackValue(expr->exception());
|
|
|