OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // The scope immediately surrounding this scope, or NULL. | 222 // The scope immediately surrounding this scope, or NULL. |
223 Scope* outer_scope() const { return outer_scope_; } | 223 Scope* outer_scope() const { return outer_scope_; } |
224 | 224 |
225 // --------------------------------------------------------------------------- | 225 // --------------------------------------------------------------------------- |
226 // Accessors. | 226 // Accessors. |
227 | 227 |
228 // A new variable proxy corresponding to the (function) receiver. | 228 // A new variable proxy corresponding to the (function) receiver. |
229 VariableProxy* receiver() const { | 229 VariableProxy* receiver() const { |
230 VariableProxy* proxy = | 230 VariableProxy* proxy = |
231 new VariableProxy(Factory::this_symbol(), true, false); | 231 new VariableProxy(FACTORY->this_symbol(), true, false); |
232 proxy->BindTo(receiver_); | 232 proxy->BindTo(receiver_); |
233 return proxy; | 233 return proxy; |
234 } | 234 } |
235 | 235 |
236 // The variable holding the function literal for named function | 236 // The variable holding the function literal for named function |
237 // literals, or NULL. | 237 // literals, or NULL. |
238 // Only valid for function scopes. | 238 // Only valid for function scopes. |
239 Variable* function() const { | 239 Variable* function() const { |
240 ASSERT(is_function_scope()); | 240 ASSERT(is_function_scope()); |
241 return function_; | 241 return function_; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 inner_scopes_.Add(inner_scope); | 419 inner_scopes_.Add(inner_scope); |
420 inner_scope->outer_scope_ = this; | 420 inner_scope->outer_scope_ = this; |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 void SetDefaults(Type type, | 424 void SetDefaults(Type type, |
425 Scope* outer_scope, | 425 Scope* outer_scope, |
426 SerializedScopeInfo* scope_info) { | 426 SerializedScopeInfo* scope_info) { |
427 outer_scope_ = outer_scope; | 427 outer_scope_ = outer_scope; |
428 type_ = type; | 428 type_ = type; |
429 scope_name_ = Factory::empty_symbol(); | 429 scope_name_ = FACTORY->empty_symbol(); |
430 dynamics_ = NULL; | 430 dynamics_ = NULL; |
431 receiver_ = NULL; | 431 receiver_ = NULL; |
432 function_ = NULL; | 432 function_ = NULL; |
433 arguments_ = NULL; | 433 arguments_ = NULL; |
434 arguments_shadow_ = NULL; | 434 arguments_shadow_ = NULL; |
435 illegal_redecl_ = NULL; | 435 illegal_redecl_ = NULL; |
436 scope_inside_with_ = false; | 436 scope_inside_with_ = false; |
437 scope_contains_with_ = false; | 437 scope_contains_with_ = false; |
438 scope_calls_eval_ = false; | 438 scope_calls_eval_ = false; |
439 // Inherit the strict mode from the parent scope. | 439 // Inherit the strict mode from the parent scope. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 int nesting_level_; | 495 int nesting_level_; |
496 // Nesting level of outermost scope that is contained in a with statement, | 496 // Nesting level of outermost scope that is contained in a with statement, |
497 // or kNotInsideWith if there are no with's around the current scope. | 497 // or kNotInsideWith if there are no with's around the current scope. |
498 int inside_with_level_; | 498 int inside_with_level_; |
499 }; | 499 }; |
500 | 500 |
501 | 501 |
502 } } // namespace v8::internal | 502 } } // namespace v8::internal |
503 | 503 |
504 #endif // V8_SCOPES_H_ | 504 #endif // V8_SCOPES_H_ |
OLD | NEW |