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

Unified Diff: src/variables.cc

Issue 8423005: Remove some unnecessary binding initialization checks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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
Index: src/variables.cc
diff --git a/src/variables.cc b/src/variables.cc
index d85e1b270ab30d452a3db4f84811a73458521c3b..6d85fd827155958da5a8b4e4e7af4957bd98b702 100644
--- a/src/variables.cc
+++ b/src/variables.cc
@@ -58,7 +58,8 @@ Variable::Variable(Scope* scope,
Handle<String> name,
VariableMode mode,
bool is_valid_LHS,
- Kind kind)
+ Kind kind,
+ InitializationFlag initialization_flag)
: scope_(scope),
name_(name),
mode_(mode),
@@ -68,9 +69,12 @@ Variable::Variable(Scope* scope,
local_if_not_shadowed_(NULL),
is_valid_LHS_(is_valid_LHS),
is_accessed_from_inner_scope_(false),
- is_used_(false) {
- // names must be canonicalized for fast equality checks
+ is_used_(false),
+ initialization_flag_(initialization_flag) {
+ // Names must be canonicalized for fast equality checks.
ASSERT(name->IsSymbol());
+ // Var declared variables never need initialization.
+ ASSERT(!(mode == VAR && initialization_flag == NEEDS_INITIALIZATION));
}
« src/variables.h ('K') | « src/variables.h ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698