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

Unified Diff: src/compiler/ast-graph-builder.cc

Issue 436553003: Ensure environment does not contain nil values. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | src/compiler/graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ast-graph-builder.cc
diff --git a/src/compiler/ast-graph-builder.cc b/src/compiler/ast-graph-builder.cc
index 47adab368527c29a4fb795e8fc20e9b3f82f15fb..2bcf53a98f0cb48c43dfbe6c4d1afc11ff85e24f 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -177,18 +177,14 @@ AstGraphBuilder::Environment::Environment(AstGraphBuilder* builder,
ASSERT_EQ(scope->num_parameters() + 1, parameters_count());
// Bind the receiver variable.
- values()->insert(values()->end(), parameters_count(),
- static_cast<Node*>(NULL));
Node* receiver = builder->graph()->NewNode(common()->Parameter(0));
- Bind(scope->receiver(), receiver);
+ values()->push_back(receiver);
// Bind all parameter variables. The parameter indices are shifted by 1
// (receiver is parameter index -1 but environment index 0).
for (int i = 0; i < scope->num_parameters(); ++i) {
- // Unused parameters are allocated to Variable::UNALLOCATED.
- if (!scope->parameter(i)->IsParameter()) continue;
Node* parameter = builder->graph()->NewNode(common()->Parameter(i + 1));
- Bind(scope->parameter(i), parameter);
+ values()->push_back(parameter);
}
// Bind all local variables to undefined.
« no previous file with comments | « no previous file | src/compiler/graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698