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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 bool is_eval() { return is_eval_; } | 114 bool is_eval() { return is_eval_; } |
115 int loop_nesting() { return loop_nesting_; } | 115 int loop_nesting() { return loop_nesting_; } |
116 bool has_receiver() { return !receiver_.is_null(); } | 116 bool has_receiver() { return !receiver_.is_null(); } |
117 Handle<Object> receiver() { return receiver_; } | 117 Handle<Object> receiver() { return receiver_; } |
118 | 118 |
119 // Accessors for mutable fields, possibly set by analysis passes with | 119 // Accessors for mutable fields, possibly set by analysis passes with |
120 // default values given by Initialize. | 120 // default values given by Initialize. |
121 bool has_this_properties() { return has_this_properties_; } | 121 bool has_this_properties() { return has_this_properties_; } |
122 void set_has_this_properties(bool flag) { has_this_properties_ = flag; } | 122 void set_has_this_properties(bool flag) { has_this_properties_ = flag; } |
123 | 123 |
| 124 bool has_global_object() { |
| 125 return !closure().is_null() && (closure()->context()->global() != NULL); |
| 126 } |
| 127 |
| 128 GlobalObject* global_object() { |
| 129 return has_global_object() ? closure()->context()->global() : NULL; |
| 130 } |
| 131 |
124 bool has_globals() { return has_globals_; } | 132 bool has_globals() { return has_globals_; } |
125 void set_has_globals(bool flag) { has_globals_ = flag; } | 133 void set_has_globals(bool flag) { has_globals_ = flag; } |
126 | 134 |
127 // Derived accessors. | 135 // Derived accessors. |
128 Scope* scope() { return function()->scope(); } | 136 Scope* scope() { return function()->scope(); } |
129 | 137 |
130 private: | 138 private: |
131 void Initialize() { | 139 void Initialize() { |
132 has_this_properties_ = false; | 140 has_this_properties_ = false; |
133 has_globals_ = false; | 141 has_globals_ = false; |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 FrameElement::ClearConstantList(); | 233 FrameElement::ClearConstantList(); |
226 Result::ClearConstantList(); | 234 Result::ClearConstantList(); |
227 } | 235 } |
228 } | 236 } |
229 }; | 237 }; |
230 | 238 |
231 | 239 |
232 } } // namespace v8::internal | 240 } } // namespace v8::internal |
233 | 241 |
234 #endif // V8_COMPILER_H_ | 242 #endif // V8_COMPILER_H_ |
OLD | NEW |