Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 075c347568ce06490cb6284279baffaec978c648..6377e9c712d8ca5d372355ec8dbe11d764b27f20 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4304,7 +4304,12 @@ 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) use the operand stack differently depending on |
+ // context. |
+ CHECK_ALIVE(VisitForValue(stmt->expression())); |
+ Pop(); |
Goto(function_return(), state); |
} else { |
ASSERT(context->IsValue()); |
@@ -6360,6 +6365,13 @@ HValue* HOptimizedGraphBuilder::HandlePolymorphicElementAccess( |
elements_kind != GetInitialFastElementsKind()) { |
possible_transitioned_maps.Add(map); |
} |
+ if (elements_kind == NON_STRICT_ARGUMENTS_ELEMENTS) { |
+ HInstruction* result = |
+ is_store ? BuildStoreKeyedGeneric(object, key, val) |
+ : BuildLoadKeyedGeneric(object, key); |
+ *has_side_effects = result->HasObservableSideEffects(); |
+ return AddInstruction(result); |
+ } |
} |
// Get transition target for each map (NULL == no transition). |
for (int i = 0; i < maps->length(); ++i) { |