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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 UNREACHABLE(); 52 UNREACHABLE();
53 return NULL; 53 return NULL;
54 } 54 }
55 55
56 56
57 Variable::Variable(Scope* scope, 57 Variable::Variable(Scope* scope,
58 Handle<String> name, 58 Handle<String> name,
59 VariableMode mode, 59 VariableMode mode,
60 bool is_valid_LHS, 60 bool is_valid_LHS,
61 Kind kind) 61 Kind kind,
62 InitializationFlag initialization_flag)
62 : scope_(scope), 63 : scope_(scope),
63 name_(name), 64 name_(name),
64 mode_(mode), 65 mode_(mode),
65 kind_(kind), 66 kind_(kind),
66 location_(UNALLOCATED), 67 location_(UNALLOCATED),
67 index_(-1), 68 index_(-1),
68 local_if_not_shadowed_(NULL), 69 local_if_not_shadowed_(NULL),
69 is_valid_LHS_(is_valid_LHS), 70 is_valid_LHS_(is_valid_LHS),
70 is_accessed_from_inner_scope_(false), 71 is_accessed_from_inner_scope_(false),
71 is_used_(false) { 72 is_used_(false),
72 // names must be canonicalized for fast equality checks 73 initialization_flag_(initialization_flag) {
74 // Names must be canonicalized for fast equality checks.
73 ASSERT(name->IsSymbol()); 75 ASSERT(name->IsSymbol());
76 // Var declared variables never need initialization.
77 ASSERT(!(mode == VAR && initialization_flag == NEEDS_INITIALIZATION));
74 } 78 }
75 79
76 80
77 bool Variable::is_global() const { 81 bool Variable::is_global() const {
78 // Temporaries are never global, they must always be allocated in the 82 // Temporaries are never global, they must always be allocated in the
79 // activation frame. 83 // activation frame.
80 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); 84 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope();
81 } 85 }
82 86
83 } } // namespace v8::internal 87 } } // namespace v8::internal
OLDNEW
« 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