| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 int StackLocalCount() const; | 362 int StackLocalCount() const; |
| 363 int ContextLocalCount() const; | 363 int ContextLocalCount() const; |
| 364 | 364 |
| 365 // Make sure this scope and all outer scopes are eagerly compiled. | 365 // Make sure this scope and all outer scopes are eagerly compiled. |
| 366 void ForceEagerCompilation() { force_eager_compilation_ = true; } | 366 void ForceEagerCompilation() { force_eager_compilation_ = true; } |
| 367 | 367 |
| 368 // Determine if we can use lazy compilation for this scope. | 368 // Determine if we can use lazy compilation for this scope. |
| 369 bool AllowsLazyCompilation() const; | 369 bool AllowsLazyCompilation() const; |
| 370 | 370 |
| 371 // True if we can lazily recompile functions with this scope. | 371 // True if we can lazily recompile functions with this scope. |
| 372 bool allows_lazy_recompilation() const { | 372 bool AllowsLazyRecompilation() const; |
| 373 return !force_eager_compilation_; | |
| 374 } | |
| 375 | 373 |
| 376 // True if the outer context of this scope is always the global context. | 374 // True if the outer context of this scope is always the global context. |
| 377 bool HasTrivialOuterContext() const; | 375 bool HasTrivialOuterContext() const; |
| 378 | 376 |
| 377 // True if this scope is inside a with scope and all declaration scopes |
| 378 // between them have empty contexts. Such declaration scopes become |
| 379 // invisible during scope info deserialization. |
| 380 bool TrivialDeclarationScopesBeforeWithScope() const; |
| 381 |
| 379 // The number of contexts between this and scope; zero if this == scope. | 382 // The number of contexts between this and scope; zero if this == scope. |
| 380 int ContextChainLength(Scope* scope); | 383 int ContextChainLength(Scope* scope); |
| 381 | 384 |
| 382 // Find the first function, global, or eval scope. This is the scope | 385 // Find the first function, global, or eval scope. This is the scope |
| 383 // where var declarations will be hoisted to in the implementation. | 386 // where var declarations will be hoisted to in the implementation. |
| 384 Scope* DeclarationScope(); | 387 Scope* DeclarationScope(); |
| 385 | 388 |
| 386 Handle<ScopeInfo> GetScopeInfo(); | 389 Handle<ScopeInfo> GetScopeInfo(); |
| 387 | 390 |
| 388 // Get the chain of nested scopes within this scope for the source statement | 391 // Get the chain of nested scopes within this scope for the source statement |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 } | 601 } |
| 599 | 602 |
| 600 void SetDefaults(ScopeType type, | 603 void SetDefaults(ScopeType type, |
| 601 Scope* outer_scope, | 604 Scope* outer_scope, |
| 602 Handle<ScopeInfo> scope_info); | 605 Handle<ScopeInfo> scope_info); |
| 603 }; | 606 }; |
| 604 | 607 |
| 605 } } // namespace v8::internal | 608 } } // namespace v8::internal |
| 606 | 609 |
| 607 #endif // V8_SCOPES_H_ | 610 #endif // V8_SCOPES_H_ |
| OLD | NEW |