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

Side by Side Diff: src/variables.h

Issue 10872084: Allocate block-scoped global bindings to global context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 bool IsVariable(Handle<String> n) const { 111 bool IsVariable(Handle<String> n) const {
112 return !is_this() && name().is_identical_to(n); 112 return !is_this() && name().is_identical_to(n);
113 } 113 }
114 114
115 bool IsUnallocated() const { return location_ == UNALLOCATED; } 115 bool IsUnallocated() const { return location_ == UNALLOCATED; }
116 bool IsParameter() const { return location_ == PARAMETER; } 116 bool IsParameter() const { return location_ == PARAMETER; }
117 bool IsStackLocal() const { return location_ == LOCAL; } 117 bool IsStackLocal() const { return location_ == LOCAL; }
118 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } 118 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); }
119 bool IsContextSlot() const { return location_ == CONTEXT; } 119 bool IsContextSlot() const { return location_ == CONTEXT; }
120 bool IsLookupSlot() const { return location_ == LOOKUP; } 120 bool IsLookupSlot() const { return location_ == LOOKUP; }
121 bool IsGlobalObjectProperty() const;
121 122
122 bool is_dynamic() const { 123 bool is_dynamic() const {
123 return (mode_ == DYNAMIC || 124 return (mode_ == DYNAMIC ||
124 mode_ == DYNAMIC_GLOBAL || 125 mode_ == DYNAMIC_GLOBAL ||
125 mode_ == DYNAMIC_LOCAL); 126 mode_ == DYNAMIC_LOCAL);
126 } 127 }
127 bool is_const_mode() const { 128 bool is_const_mode() const {
128 return (mode_ == CONST || 129 return (mode_ == CONST ||
129 mode_ == CONST_HARMONY); 130 mode_ == CONST_HARMONY);
130 } 131 }
131 bool binding_needs_init() const { 132 bool binding_needs_init() const {
132 return initialization_flag_ == kNeedsInitialization; 133 return initialization_flag_ == kNeedsInitialization;
133 } 134 }
134 135
135 bool is_global() const;
136 bool is_this() const { return kind_ == THIS; } 136 bool is_this() const { return kind_ == THIS; }
137 bool is_arguments() const { return kind_ == ARGUMENTS; } 137 bool is_arguments() const { return kind_ == ARGUMENTS; }
138 138
139 // True if the variable is named eval and not known to be shadowed. 139 // True if the variable is named eval and not known to be shadowed.
140 bool is_possibly_eval() const { 140 bool is_possibly_eval() const {
141 return IsVariable(FACTORY->eval_symbol()); 141 return IsVariable(FACTORY->eval_symbol());
142 } 142 }
143 143
144 Variable* local_if_not_shadowed() const { 144 Variable* local_if_not_shadowed() const {
145 ASSERT(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL); 145 ASSERT(mode_ == DYNAMIC_LOCAL && local_if_not_shadowed_ != NULL);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 InitializationFlag initialization_flag_; 188 InitializationFlag initialization_flag_;
189 189
190 // Module type info. 190 // Module type info.
191 Interface* interface_; 191 Interface* interface_;
192 }; 192 };
193 193
194 194
195 } } // namespace v8::internal 195 } } // namespace v8::internal
196 196
197 #endif // V8_VARIABLES_H_ 197 #endif // V8_VARIABLES_H_
OLDNEW
« src/parser.cc ('K') | « src/scopes.cc ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698