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

Unified Diff: src/ast.cc

Issue 629983002: Squeeze the layout of variable proxy nodes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/ast.h ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 2d96f3f2164ba36b322437734624755f62a14564..90320f7773b01020aa74223037a6be7ae43e27a5 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -62,12 +62,12 @@ bool Expression::IsUndefinedLiteral(Isolate* isolate) const {
VariableProxy::VariableProxy(Zone* zone, Variable* var, int position,
IdGen* id_gen)
: Expression(zone, position, id_gen),
- name_(var->raw_name()),
- var_(NULL), // Will be set by the call to BindTo.
+ raw_name_(var->raw_name()),
+ interface_(var->interface()),
+ variable_feedback_slot_(kInvalidFeedbackSlot),
is_this_(var->is_this()),
is_assigned_(false),
- interface_(var->interface()),
- variable_feedback_slot_(kInvalidFeedbackSlot) {
+ is_resolved_(false) {
BindTo(var);
}
@@ -75,25 +75,24 @@ VariableProxy::VariableProxy(Zone* zone, Variable* var, int position,
VariableProxy::VariableProxy(Zone* zone, const AstRawString* name, bool is_this,
Interface* interface, int position, IdGen* id_gen)
: Expression(zone, position, id_gen),
- name_(name),
- var_(NULL),
+ raw_name_(name),
+ interface_(interface),
+ variable_feedback_slot_(kInvalidFeedbackSlot),
is_this_(is_this),
is_assigned_(false),
- interface_(interface),
- variable_feedback_slot_(kInvalidFeedbackSlot) {}
+ is_resolved_(false) {}
void VariableProxy::BindTo(Variable* var) {
- DCHECK(var_ == NULL); // must be bound only once
- DCHECK(var != NULL); // must bind
DCHECK(!FLAG_harmony_modules || interface_->IsUnified(var->interface()));
- DCHECK((is_this() && var->is_this()) || name_ == var->raw_name());
+ DCHECK((is_this() && var->is_this()) || raw_name() == var->raw_name());
// Ideally CONST-ness should match. However, this is very hard to achieve
// because we don't know the exact semantics of conflicting (const and
// non-const) multiple variable declarations, const vars introduced via
// eval() etc. Const-ness and variable declarations are a complete mess
// in JS. Sigh...
- var_ = var;
+ set_var(var);
+ set_is_resolved();
var->set_is_used();
}
« no previous file with comments | « src/ast.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698