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

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

Issue 1329043002: [turbofan] Clarify comment about Parameter indexing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | no next file » | 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 d3fe03704da37dd1b7da001bdb35193c20cf4acf..8fee623d1b39e7d20b599518c54e63e45c9b6f35 100644
--- a/src/compiler/ast-graph-builder.cc
+++ b/src/compiler/ast-graph-builder.cc
@@ -682,7 +682,8 @@ AstGraphBuilder::Environment::Environment(AstGraphBuilder* builder,
}
// Bind all parameter variables. The parameter indices are shifted by 1
- // (receiver is parameter index -1 but environment index 0).
+ // (receiver is variable index -1 but {Parameter} node index 0 and located at
+ // index 0 in the environment).
for (int i = 0; i < scope->num_parameters(); ++i) {
const char* debug_name = GetDebugParameterName(graph()->zone(), scope, i);
const Operator* op = common()->Parameter(param_num++, debug_name);
@@ -721,8 +722,8 @@ AstGraphBuilder::Environment::Environment(AstGraphBuilder::Environment* copy,
void AstGraphBuilder::Environment::Bind(Variable* variable, Node* node) {
DCHECK(variable->IsStackAllocated());
if (variable->IsParameter()) {
- // The parameter indices are shifted by 1 (receiver is parameter
- // index -1 but environment index 0).
+ // The parameter indices are shifted by 1 (receiver is variable
+ // index -1 but located at index 0 in the environment).
values()->at(variable->index() + 1) = node;
} else {
DCHECK(variable->IsStackLocal());
@@ -738,8 +739,8 @@ void AstGraphBuilder::Environment::Bind(Variable* variable, Node* node) {
Node* AstGraphBuilder::Environment::Lookup(Variable* variable) {
DCHECK(variable->IsStackAllocated());
if (variable->IsParameter()) {
- // The parameter indices are shifted by 1 (receiver is parameter
- // index -1 but environment index 0).
+ // The parameter indices are shifted by 1 (receiver is variable
+ // index -1 but located at index 0 in the environment).
return values()->at(variable->index() + 1);
} else {
DCHECK(variable->IsStackLocal());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698