| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 static bool Analyze(CompilationInfo* info); | 105 static bool Analyze(CompilationInfo* info); |
| 106 | 106 |
| 107 static Scope* DeserializeScopeChain(CompilationInfo* info, | 107 static Scope* DeserializeScopeChain(CompilationInfo* info, |
| 108 Scope* innermost_scope); | 108 Scope* innermost_scope); |
| 109 | 109 |
| 110 // The scope name is only used for printing/debugging. | 110 // The scope name is only used for printing/debugging. |
| 111 void SetScopeName(Handle<String> scope_name) { scope_name_ = scope_name; } | 111 void SetScopeName(Handle<String> scope_name) { scope_name_ = scope_name; } |
| 112 | 112 |
| 113 void Initialize(bool inside_with); | 113 void Initialize(bool inside_with); |
| 114 | 114 |
| 115 // Checks if the block scope is redundant, i.e. it does not contain any |
| 116 // block scoped declarations. In that case it is removed from the scope |
| 117 // tree and its children are reparented. |
| 118 Scope* FinalizeBlockScope(); |
| 119 |
| 115 // --------------------------------------------------------------------------- | 120 // --------------------------------------------------------------------------- |
| 116 // Declarations | 121 // Declarations |
| 117 | 122 |
| 118 // Lookup a variable in this scope. Returns the variable or NULL if not found. | 123 // Lookup a variable in this scope. Returns the variable or NULL if not found. |
| 119 Variable* LocalLookup(Handle<String> name); | 124 Variable* LocalLookup(Handle<String> name); |
| 120 | 125 |
| 121 // Lookup a variable in this scope or outer scopes. | 126 // Lookup a variable in this scope or outer scopes. |
| 122 // Returns the variable or NULL if not found. | 127 // Returns the variable or NULL if not found. |
| 123 Variable* Lookup(Handle<String> name); | 128 Variable* Lookup(Handle<String> name); |
| 124 | 129 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 } | 456 } |
| 452 | 457 |
| 453 void SetDefaults(Type type, | 458 void SetDefaults(Type type, |
| 454 Scope* outer_scope, | 459 Scope* outer_scope, |
| 455 Handle<SerializedScopeInfo> scope_info); | 460 Handle<SerializedScopeInfo> scope_info); |
| 456 }; | 461 }; |
| 457 | 462 |
| 458 } } // namespace v8::internal | 463 } } // namespace v8::internal |
| 459 | 464 |
| 460 #endif // V8_SCOPES_H_ | 465 #endif // V8_SCOPES_H_ |
| OLD | NEW |