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

Unified Diff: src/hydrogen.cc

Issue 9692046: Always create HArgumentsObject on function entry. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 | « src/hydrogen.h ('k') | test/mjsunit/compiler/inline-arguments.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 6a7b6098cb8537d747f2ce674e41e56fdd0f0c7c..4c4652b452cb1e1ed92c1034d3a881f0b6ca7f9f 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2613,6 +2613,10 @@ void HGraphBuilder::SetUpScope(Scope* scope) {
AddInstruction(undefined_constant);
graph_->set_undefined_constant(undefined_constant);
+ HArgumentsObject* object = new(zone()) HArgumentsObject;
+ AddInstruction(object);
+ graph()->SetArgumentsObject(object);
+
// Set the initial values of parameters including "this". "This" has
// parameter index 0.
ASSERT_EQ(scope->num_parameters() + 1, environment()->parameter_count());
@@ -2640,11 +2644,6 @@ void HGraphBuilder::SetUpScope(Scope* scope) {
return Bailout("context-allocated arguments");
}
- if (!graph()->HasArgumentsObject()) {
- HArgumentsObject* object = new(zone()) HArgumentsObject;
- AddInstruction(object);
- graph()->SetArgumentsObject(object);
- }
environment()->Bind(scope->arguments(),
graph()->GetArgumentsObject());
}
@@ -5325,11 +5324,6 @@ bool HGraphBuilder::TryInline(CallKind call_kind,
// If the function uses arguments object create and bind one.
if (function->scope()->arguments() != NULL) {
ASSERT(function->scope()->arguments()->IsStackAllocated());
- if (!graph()->HasArgumentsObject()) {
- HArgumentsObject* object = new(zone()) HArgumentsObject;
- AddInstruction(object);
- graph()->SetArgumentsObject(object);
- }
environment()->Bind(function->scope()->arguments(),
graph()->GetArgumentsObject());
}
« no previous file with comments | « src/hydrogen.h ('k') | test/mjsunit/compiler/inline-arguments.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698