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

Unified Diff: src/ast/scopes.h

Issue 2275573002: Remove rest_parameter_ cache on DeclarationScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Could be we shouldn't allocate Created 4 years, 4 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/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 1ea06bccc44bc0c9951f07412fa68ec6a4ab5d6b..d0f4cc943bf6c421c2ea74fe35768739f76c6361 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -772,8 +772,8 @@ class DeclarationScope : public Scope {
// A function can have at most one rest parameter. Returns Variable* or NULL.
Variable* rest_parameter(int* index) const {
*index = rest_index_;
- if (rest_index_ < 0) return NULL;
- return rest_parameter_;
+ if (rest_index_ < 0) return nullptr;
+ return params_[rest_index_];
}
bool has_rest_parameter() const { return rest_index_ >= 0; }
@@ -890,7 +890,6 @@ class DeclarationScope : public Scope {
// Info about the parameter list of a function.
int arity_;
int rest_index_;
- Variable* rest_parameter_;
// Compiler-allocated (user-invisible) temporaries.
ZoneList<Variable*> temps_;
// Parameter list in source order.
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698