Index: src/full-codegen.cc |
diff --git a/src/full-codegen.cc b/src/full-codegen.cc |
index a43f674c33641f1ae9682423494f2c76b9f744e1..831ed01deb253f3874d57e26af2f1b70481df5fa 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()); |
@@ -1537,6 +1543,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 |
Michael Starzinger
2013/03/14 22:29:24
Turn this comment into a TODO, it should vanish on
|
+ // 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. |
Michael Starzinger
2013/03/14 22:29:24
Also turn this comment into a TODO, as this is onl
|
+ 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()); |