| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 | 106 |
| 107 Variable::Variable(Scope* scope, | 107 Variable::Variable(Scope* scope, |
| 108 Handle<String> name, | 108 Handle<String> name, |
| 109 Mode mode, | 109 Mode mode, |
| 110 bool is_valid_LHS, | 110 bool is_valid_LHS, |
| 111 Kind kind) | 111 Kind kind) |
| 112 : scope_(scope), | 112 : scope_(scope), |
| 113 name_(name), | 113 name_(name), |
| 114 mode_(mode), | 114 mode_(mode), |
| 115 is_valid_LHS_(is_valid_LHS), | |
| 116 kind_(kind), | 115 kind_(kind), |
| 117 local_if_not_shadowed_(NULL), | 116 local_if_not_shadowed_(NULL), |
| 117 rewrite_(NULL), |
| 118 is_valid_LHS_(is_valid_LHS), |
| 118 is_accessed_from_inner_scope_(false), | 119 is_accessed_from_inner_scope_(false), |
| 119 is_used_(false), | 120 is_used_(false) { |
| 120 rewrite_(NULL) { | |
| 121 // names must be canonicalized for fast equality checks | 121 // names must be canonicalized for fast equality checks |
| 122 ASSERT(name->IsSymbol()); | 122 ASSERT(name->IsSymbol()); |
| 123 } | 123 } |
| 124 | 124 |
| 125 | 125 |
| 126 bool Variable::is_global() const { | 126 bool Variable::is_global() const { |
| 127 // Temporaries are never global, they must always be allocated in the | 127 // Temporaries are never global, they must always be allocated in the |
| 128 // activation frame. | 128 // activation frame. |
| 129 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); | 129 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 } } // namespace v8::internal | 132 } } // namespace v8::internal |
| OLD | NEW |