| OLD | NEW |
| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 bool IsValidLeftHandSide() { return is_valid_LHS_; } | 88 bool IsValidLeftHandSide() { return is_valid_LHS_; } |
| 89 | 89 |
| 90 // The source code for an eval() call may refer to a variable that is | 90 // The source code for an eval() call may refer to a variable that is |
| 91 // in an outer scope about which we don't know anything (it may not | 91 // in an outer scope about which we don't know anything (it may not |
| 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_function_scope() const { |
| 99 return is_accessed_from_inner_scope_; | 99 return is_accessed_from_inner_function_scope_; |
| 100 } | 100 } |
| 101 void MarkAsAccessedFromInnerScope() { | 101 void MarkAsAccessedFromInnerFunctionScope() { |
| 102 is_accessed_from_inner_scope_ = true; | 102 ASSERT(mode_ != TEMPORARY); |
| 103 is_accessed_from_inner_function_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; |
| 112 bool IsParameter() const; // Includes 'this'. | 113 bool IsParameter() const; // Includes 'this'. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 150 |
| 150 Variable* local_if_not_shadowed_; | 151 Variable* local_if_not_shadowed_; |
| 151 | 152 |
| 152 // Code generation. | 153 // Code generation. |
| 153 Slot* rewrite_; | 154 Slot* rewrite_; |
| 154 | 155 |
| 155 // Valid as a LHS? (const and this are not valid LHS, for example) | 156 // Valid as a LHS? (const and this are not valid LHS, for example) |
| 156 bool is_valid_LHS_; | 157 bool is_valid_LHS_; |
| 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_function_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_ |
| OLD | NEW |