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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 int StackLocalCount() const; | 355 int StackLocalCount() const; |
356 int ContextLocalCount() const; | 356 int ContextLocalCount() const; |
357 | 357 |
358 // Make sure this scope and all outer scopes are eagerly compiled. | 358 // Make sure this scope and all outer scopes are eagerly compiled. |
359 void ForceEagerCompilation() { force_eager_compilation_ = true; } | 359 void ForceEagerCompilation() { force_eager_compilation_ = true; } |
360 | 360 |
361 // Determine if we can use lazy compilation for this scope. | 361 // Determine if we can use lazy compilation for this scope. |
362 bool AllowsLazyCompilation() const; | 362 bool AllowsLazyCompilation() const; |
363 | 363 |
364 // True if we can lazily recompile functions with this scope. | 364 // True if we can lazily recompile functions with this scope. |
365 bool allows_lazy_recompilation() const { | 365 bool AllowsLazyRecompilation() const; |
366 return !force_eager_compilation_; | |
367 } | |
368 | 366 |
369 // True if the outer context of this scope is always the global context. | 367 // True if the outer context of this scope is always the global context. |
370 bool HasTrivialOuterContext() const; | 368 bool HasTrivialOuterContext() const; |
371 | 369 |
| 370 // True if this scope is inside a with scope and all declaration scopes |
| 371 // between them have empty contexts. Such declaration scopes become |
| 372 // invisible during scope info deserialization. |
| 373 bool TrivialDeclarationScopesBeforeWithScope() const; |
| 374 |
372 // The number of contexts between this and scope; zero if this == scope. | 375 // The number of contexts between this and scope; zero if this == scope. |
373 int ContextChainLength(Scope* scope); | 376 int ContextChainLength(Scope* scope); |
374 | 377 |
375 // Find the first function, global, or eval scope. This is the scope | 378 // Find the first function, global, or eval scope. This is the scope |
376 // where var declarations will be hoisted to in the implementation. | 379 // where var declarations will be hoisted to in the implementation. |
377 Scope* DeclarationScope(); | 380 Scope* DeclarationScope(); |
378 | 381 |
379 Handle<ScopeInfo> GetScopeInfo(); | 382 Handle<ScopeInfo> GetScopeInfo(); |
380 | 383 |
381 // Get the chain of nested scopes within this scope for the source statement | 384 // 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... |
591 } | 594 } |
592 | 595 |
593 void SetDefaults(ScopeType type, | 596 void SetDefaults(ScopeType type, |
594 Scope* outer_scope, | 597 Scope* outer_scope, |
595 Handle<ScopeInfo> scope_info); | 598 Handle<ScopeInfo> scope_info); |
596 }; | 599 }; |
597 | 600 |
598 } } // namespace v8::internal | 601 } } // namespace v8::internal |
599 | 602 |
600 #endif // V8_SCOPES_H_ | 603 #endif // V8_SCOPES_H_ |
OLD | NEW |