Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index d2624161bcff57d7bbdcd94d46d7b132af303592..7ac1d5e26550406c9e02537f86e6e682793ee322 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -7786,23 +7786,28 @@ bool HOptimizedGraphBuilder::TryInlineBuiltinMethodCall( |
HValue* value_to_push = Pop(); |
HValue* array = Pop(); |
- HValue* length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL), |
- HObjectAccess::ForArrayLength(elements_kind)); |
+ HInstruction* new_size = NULL; |
+ HValue* length = NULL; |
{ |
NoObservableSideEffectsScope scope(this); |
+ length = Add<HLoadNamedField>(array, static_cast<HValue*>(NULL), |
+ HObjectAccess::ForArrayLength(elements_kind)); |
+ |
+ new_size = AddUncasted<HAdd>(length, graph()->GetConstant1()); |
+ |
bool is_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
BuildUncheckedMonomorphicElementAccess(array, length, |
value_to_push, is_array, |
elements_kind, STORE, |
NEVER_RETURN_HOLE, |
STORE_AND_GROW_NO_TRANSITION); |
+ Add<HSimulate>(expr->id(), REMOVABLE_SIMULATE); |
} |
- HInstruction* new_size = NewUncasted<HAdd>(length, Add<HConstant>(argc)); |
Drop(1); // Drop function. |
- ast_context()->ReturnInstruction(new_size, expr->id()); |
+ ast_context()->ReturnValue(new_size); |
return true; |
} |
default: |