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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 | 59 |
60 bool Variable::IsStaticGlobalObjectProperty() const { | 60 bool Variable::IsStaticGlobalObjectProperty() const { |
61 // Temporaries are never global, they must always be allocated in the | 61 // Temporaries are never global, they must always be allocated in the |
62 // activation frame. | 62 // activation frame. |
63 return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) && | 63 return (IsDeclaredVariableMode(mode_) && !IsLexicalVariableMode(mode_)) && |
64 scope_ != NULL && scope_->is_script_scope(); | 64 scope_ != NULL && scope_->is_script_scope(); |
65 } | 65 } |
66 | 66 |
67 | 67 |
68 int Variable::CompareIndex(Variable* const* v, Variable* const* w) { | |
69 int x = (*v)->index(); | |
70 int y = (*w)->index(); | |
71 // Consider sorting them according to type as well? | |
72 return x - y; | |
73 } | |
74 | |
75 } // namespace internal | 68 } // namespace internal |
76 } // namespace v8 | 69 } // namespace v8 |
OLD | NEW |