Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 282fae7800bab93132c198f0c338762c2cce7b74..99e0c53b6c1987d5fbb81b29eed515311ee9813d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4363,7 +4363,11 @@ void HOptimizedGraphBuilder::VisitReturnStatement(ReturnStatement* stmt) { |
TestContext* test = TestContext::cast(context); |
VisitForControl(stmt->expression(), test->if_true(), test->if_false()); |
} else if (context->IsEffect()) { |
- CHECK_ALIVE(VisitForEffect(stmt->expression())); |
+ // Visit in value context and ignore the result. This is needed to keep |
+ // environment in sync with full-codegen since some visitors |
+ // (e.g. VisitCountOperation) change the environment depending on context. |
Michael Starzinger
2014/03/21 09:57:52
nit: s/change the environment/use the operand stac
ulan
2014/03/21 12:06:17
Done.
|
+ CHECK_ALIVE(VisitForValue(stmt->expression())); |
+ Pop(); |
Goto(function_return(), state); |
} else { |
ASSERT(context->IsValue()); |