| 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 28 matching lines...) Expand all Loading... |
| 39 // after binding and variable allocation. | 39 // after binding and variable allocation. |
| 40 | 40 |
| 41 class Variable: public ZoneObject { | 41 class Variable: public ZoneObject { |
| 42 public: | 42 public: |
| 43 enum Mode { | 43 enum Mode { |
| 44 // User declared variables: | 44 // User declared variables: |
| 45 VAR, // declared via 'var', and 'function' declarations | 45 VAR, // declared via 'var', and 'function' declarations |
| 46 | 46 |
| 47 CONST, // declared via 'const' declarations | 47 CONST, // declared via 'const' declarations |
| 48 | 48 |
| 49 LET, // declared via 'let' declarations |
| 50 |
| 49 // Variables introduced by the compiler: | 51 // Variables introduced by the compiler: |
| 50 DYNAMIC, // always require dynamic lookup (we don't know | 52 DYNAMIC, // always require dynamic lookup (we don't know |
| 51 // the declaration) | 53 // the declaration) |
| 52 | 54 |
| 53 DYNAMIC_GLOBAL, // requires dynamic lookup, but we know that the | 55 DYNAMIC_GLOBAL, // requires dynamic lookup, but we know that the |
| 54 // variable is global unless it has been shadowed | 56 // variable is global unless it has been shadowed |
| 55 // by an eval-introduced variable | 57 // by an eval-introduced variable |
| 56 | 58 |
| 57 DYNAMIC_LOCAL, // requires dynamic lookup, but we know that the | 59 DYNAMIC_LOCAL, // requires dynamic lookup, but we know that the |
| 58 // variable is local and where it is unless it | 60 // variable is local and where it is unless it |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 // Usage info. | 161 // Usage info. |
| 160 bool is_accessed_from_inner_function_scope_; // set by variable resolver | 162 bool is_accessed_from_inner_function_scope_; // set by variable resolver |
| 161 bool is_used_; | 163 bool is_used_; |
| 162 }; | 164 }; |
| 163 | 165 |
| 164 | 166 |
| 165 } } // namespace v8::internal | 167 } } // namespace v8::internal |
| 166 | 168 |
| 167 #endif // V8_VARIABLES_H_ | 169 #endif // V8_VARIABLES_H_ |
| OLD | NEW |