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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 Mode mode, | 85 Mode mode, |
86 bool is_valid_LHS, | 86 bool is_valid_LHS, |
87 Kind kind) | 87 Kind kind) |
88 : scope_(scope), | 88 : scope_(scope), |
89 name_(name), | 89 name_(name), |
90 mode_(mode), | 90 mode_(mode), |
91 kind_(kind), | 91 kind_(kind), |
92 local_if_not_shadowed_(NULL), | 92 local_if_not_shadowed_(NULL), |
93 rewrite_(NULL), | 93 rewrite_(NULL), |
94 is_valid_LHS_(is_valid_LHS), | 94 is_valid_LHS_(is_valid_LHS), |
95 is_accessed_from_inner_scope_(false), | 95 is_accessed_from_inner_function_scope_(false), |
96 is_used_(false) { | 96 is_used_(false) { |
97 // names must be canonicalized for fast equality checks | 97 // names must be canonicalized for fast equality checks |
98 ASSERT(name->IsSymbol()); | 98 ASSERT(name->IsSymbol()); |
99 } | 99 } |
100 | 100 |
101 | 101 |
102 bool Variable::is_global() const { | 102 bool Variable::is_global() const { |
103 // Temporaries are never global, they must always be allocated in the | 103 // Temporaries are never global, they must always be allocated in the |
104 // activation frame. | 104 // activation frame. |
105 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); | 105 return mode_ != TEMPORARY && scope_ != NULL && scope_->is_global_scope(); |
106 } | 106 } |
107 | 107 |
108 } } // namespace v8::internal | 108 } } // namespace v8::internal |
OLD | NEW |