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

Side by Side Diff: src/variables.h

Issue 7549008: Preliminary code for block scopes and block contexts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Next iteration Created 9 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 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // be the global scope). scope() is NULL in that case. Currently the 92 // be the global scope). scope() is NULL in that case. Currently the
93 // scope is only used to follow the context chain length. 93 // scope is only used to follow the context chain length.
94 Scope* scope() const { return scope_; } 94 Scope* scope() const { return scope_; }
95 95
96 Handle<String> name() const { return name_; } 96 Handle<String> name() const { return name_; }
97 Mode mode() const { return mode_; } 97 Mode mode() const { return mode_; }
98 bool is_accessed_from_inner_scope() const { 98 bool is_accessed_from_inner_scope() const {
99 return is_accessed_from_inner_scope_; 99 return is_accessed_from_inner_scope_;
100 } 100 }
101 void MarkAsAccessedFromInnerScope() { 101 void MarkAsAccessedFromInnerScope() {
102 ASSERT(mode_ != TEMPORARY);
102 is_accessed_from_inner_scope_ = true; 103 is_accessed_from_inner_scope_ = true;
103 } 104 }
104 bool is_used() { return is_used_; } 105 bool is_used() { return is_used_; }
105 void set_is_used(bool flag) { is_used_ = flag; } 106 void set_is_used(bool flag) { is_used_ = flag; }
106 107
107 bool IsVariable(Handle<String> n) const { 108 bool IsVariable(Handle<String> n) const {
108 return !is_this() && name().is_identical_to(n); 109 return !is_this() && name().is_identical_to(n);
109 } 110 }
110 111
111 bool IsStackAllocated() const; 112 bool IsStackAllocated() const;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 158
158 // Usage info. 159 // Usage info.
159 bool is_accessed_from_inner_scope_; // set by variable resolver 160 bool is_accessed_from_inner_scope_; // set by variable resolver
160 bool is_used_; 161 bool is_used_;
161 }; 162 };
162 163
163 164
164 } } // namespace v8::internal 165 } } // namespace v8::internal
165 166
166 #endif // V8_VARIABLES_H_ 167 #endif // V8_VARIABLES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698