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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 373 |
374 // Determine if we can use lazy compilation for this scope. | 374 // Determine if we can use lazy compilation for this scope. |
375 bool AllowsLazyCompilation() const; | 375 bool AllowsLazyCompilation() const; |
376 | 376 |
377 // Determine if we can use lazy compilation for this scope without a context. | 377 // Determine if we can use lazy compilation for this scope without a context. |
378 bool AllowsLazyCompilationWithoutContext() const; | 378 bool AllowsLazyCompilationWithoutContext() const; |
379 | 379 |
380 // True if the outer context of this scope is always the global context. | 380 // True if the outer context of this scope is always the global context. |
381 bool HasTrivialOuterContext() const; | 381 bool HasTrivialOuterContext() const; |
382 | 382 |
383 // True if this scope is inside a with scope and all declaration scopes | 383 // True if the outer context allows lazy compilation of this scope. |
384 // between them have empty contexts. Such declaration scopes become | 384 bool HasLazyCompilableOuterContext() const; |
385 // invisible during scope info deserialization. | |
386 bool TrivialDeclarationScopesBeforeWithScope() const; | |
387 | 385 |
388 // The number of contexts between this and scope; zero if this == scope. | 386 // The number of contexts between this and scope; zero if this == scope. |
389 int ContextChainLength(Scope* scope); | 387 int ContextChainLength(Scope* scope); |
390 | 388 |
391 // Find the first function, global, or eval scope. This is the scope | 389 // Find the first function, global, or eval scope. This is the scope |
392 // where var declarations will be hoisted to in the implementation. | 390 // where var declarations will be hoisted to in the implementation. |
393 Scope* DeclarationScope(); | 391 Scope* DeclarationScope(); |
394 | 392 |
395 Handle<ScopeInfo> GetScopeInfo(); | 393 Handle<ScopeInfo> GetScopeInfo(); |
396 | 394 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 void SetDefaults(ScopeType type, | 608 void SetDefaults(ScopeType type, |
611 Scope* outer_scope, | 609 Scope* outer_scope, |
612 Handle<ScopeInfo> scope_info); | 610 Handle<ScopeInfo> scope_info); |
613 | 611 |
614 Zone* zone_; | 612 Zone* zone_; |
615 }; | 613 }; |
616 | 614 |
617 } } // namespace v8::internal | 615 } } // namespace v8::internal |
618 | 616 |
619 #endif // V8_SCOPES_H_ | 617 #endif // V8_SCOPES_H_ |
OLD | NEW |