| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 bool IsStackLocal() const { return location_ == LOCAL; } | 111 bool IsStackLocal() const { return location_ == LOCAL; } |
| 112 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } | 112 bool IsStackAllocated() const { return IsParameter() || IsStackLocal(); } |
| 113 bool IsContextSlot() const { return location_ == CONTEXT; } | 113 bool IsContextSlot() const { return location_ == CONTEXT; } |
| 114 bool IsLookupSlot() const { return location_ == LOOKUP; } | 114 bool IsLookupSlot() const { return location_ == LOOKUP; } |
| 115 | 115 |
| 116 bool is_dynamic() const { | 116 bool is_dynamic() const { |
| 117 return (mode_ == DYNAMIC || | 117 return (mode_ == DYNAMIC || |
| 118 mode_ == DYNAMIC_GLOBAL || | 118 mode_ == DYNAMIC_GLOBAL || |
| 119 mode_ == DYNAMIC_LOCAL); | 119 mode_ == DYNAMIC_LOCAL); |
| 120 } | 120 } |
| 121 bool is_const_mode() const { |
| 122 return (mode_ == CONST || |
| 123 mode_ == CONST_HARMONY); |
| 124 } |
| 125 bool binding_needs_init() const { |
| 126 return (mode_ == LET || |
| 127 mode_ == CONST || |
| 128 mode_ == CONST_HARMONY); |
| 129 } |
| 121 | 130 |
| 122 bool is_global() const; | 131 bool is_global() const; |
| 123 bool is_this() const { return kind_ == THIS; } | 132 bool is_this() const { return kind_ == THIS; } |
| 124 bool is_arguments() const { return kind_ == ARGUMENTS; } | 133 bool is_arguments() const { return kind_ == ARGUMENTS; } |
| 125 | 134 |
| 126 // True if the variable is named eval and not known to be shadowed. | 135 // True if the variable is named eval and not known to be shadowed. |
| 127 bool is_possibly_eval() const { | 136 bool is_possibly_eval() const { |
| 128 return IsVariable(FACTORY->eval_symbol()) && | 137 return IsVariable(FACTORY->eval_symbol()) && |
| 129 (mode_ == DYNAMIC || mode_ == DYNAMIC_GLOBAL); | 138 (mode_ == DYNAMIC || mode_ == DYNAMIC_GLOBAL); |
| 130 } | 139 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 174 |
| 166 // Usage info. | 175 // Usage info. |
| 167 bool is_accessed_from_inner_scope_; // set by variable resolver | 176 bool is_accessed_from_inner_scope_; // set by variable resolver |
| 168 bool is_used_; | 177 bool is_used_; |
| 169 }; | 178 }; |
| 170 | 179 |
| 171 | 180 |
| 172 } } // namespace v8::internal | 181 } } // namespace v8::internal |
| 173 | 182 |
| 174 #endif // V8_VARIABLES_H_ | 183 #endif // V8_VARIABLES_H_ |
| OLD | NEW |