| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_SCOPES_H_ | 5 #ifndef V8_AST_SCOPES_H_ |
| 6 #define V8_AST_SCOPES_H_ | 6 #define V8_AST_SCOPES_H_ |
| 7 | 7 |
| 8 #include "src/base/hashmap.h" | 8 #include "src/base/hashmap.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // --------------------------------------------------------------------------- | 335 // --------------------------------------------------------------------------- |
| 336 // Variable allocation. | 336 // Variable allocation. |
| 337 | 337 |
| 338 // Result of variable allocation. | 338 // Result of variable allocation. |
| 339 int num_stack_slots() const { return num_stack_slots_; } | 339 int num_stack_slots() const { return num_stack_slots_; } |
| 340 int num_heap_slots() const { return num_heap_slots_; } | 340 int num_heap_slots() const { return num_heap_slots_; } |
| 341 | 341 |
| 342 int StackLocalCount() const; | 342 int StackLocalCount() const; |
| 343 int ContextLocalCount() const; | 343 int ContextLocalCount() const; |
| 344 | 344 |
| 345 // Determine if we can parse a function literal in this scope lazily. | 345 // Determine if we can parse a function literal in this scope lazily without |
| 346 bool AllowsLazyParsing() const; | 346 // caring about the unresolved variables within. |
| 347 bool AllowsLazyParsingWithoutUnresolvedVariables() const; |
| 347 | 348 |
| 348 // The number of contexts between this and scope; zero if this == scope. | 349 // The number of contexts between this and scope; zero if this == scope. |
| 349 int ContextChainLength(Scope* scope) const; | 350 int ContextChainLength(Scope* scope) const; |
| 350 | 351 |
| 351 // The number of contexts between this and the outermost context that has a | 352 // The number of contexts between this and the outermost context that has a |
| 352 // sloppy eval call. One if this->calls_sloppy_eval(). | 353 // sloppy eval call. One if this->calls_sloppy_eval(). |
| 353 int ContextChainLengthUntilOutermostSloppyEval() const; | 354 int ContextChainLengthUntilOutermostSloppyEval() const; |
| 354 | 355 |
| 355 // The maximum number of nested contexts required for this scope and any inner | 356 // The maximum number of nested contexts required for this scope and any inner |
| 356 // scopes. | 357 // scopes. |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 void AllocateModuleVariables(); | 860 void AllocateModuleVariables(); |
| 860 | 861 |
| 861 private: | 862 private: |
| 862 ModuleDescriptor* module_descriptor_; | 863 ModuleDescriptor* module_descriptor_; |
| 863 }; | 864 }; |
| 864 | 865 |
| 865 } // namespace internal | 866 } // namespace internal |
| 866 } // namespace v8 | 867 } // namespace v8 |
| 867 | 868 |
| 868 #endif // V8_AST_SCOPES_H_ | 869 #endif // V8_AST_SCOPES_H_ |
| OLD | NEW |