Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: src/hydrogen.cc

Issue 247383002: Insert HSimulate immediately after Crankshaft-inlined push. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/array-push9.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | test/mjsunit/array-push9.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698