OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/ast/variables.h" | 5 #include "src/ast/variables.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 | 34 |
35 bool Variable::IsGlobalObjectProperty() const { | 35 bool Variable::IsGlobalObjectProperty() const { |
36 // Temporaries are never global, they must always be allocated in the | 36 // Temporaries are never global, they must always be allocated in the |
37 // activation frame. | 37 // activation frame. |
38 return (IsDynamicVariableMode(mode()) || | 38 return (IsDynamicVariableMode(mode()) || |
39 (IsDeclaredVariableMode(mode()) && !IsLexicalVariableMode(mode()))) && | 39 (IsDeclaredVariableMode(mode()) && !IsLexicalVariableMode(mode()))) && |
40 scope_ != NULL && scope_->is_script_scope(); | 40 scope_ != NULL && scope_->is_script_scope(); |
41 } | 41 } |
42 | 42 |
43 | |
44 bool Variable::IsStaticGlobalObjectProperty() const { | |
45 // Temporaries are never global, they must always be allocated in the | |
46 // activation frame. | |
47 return (IsDeclaredVariableMode(mode()) && !IsLexicalVariableMode(mode())) && | |
48 scope_ != NULL && scope_->is_script_scope(); | |
49 } | |
50 | |
51 | |
52 } // namespace internal | 43 } // namespace internal |
53 } // namespace v8 | 44 } // namespace v8 |
OLD | NEW |