| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 // Resolve and fill in the allocation information for all variables in | 216 // Resolve and fill in the allocation information for all variables in |
| 217 // this scopes. Must be called *after* all scopes have been processed | 217 // this scopes. Must be called *after* all scopes have been processed |
| 218 // (parsed) to ensure that unresolved variables can be resolved properly. | 218 // (parsed) to ensure that unresolved variables can be resolved properly. |
| 219 void AllocateVariables(); | 219 void AllocateVariables(); |
| 220 | 220 |
| 221 // Result of variable allocation. | 221 // Result of variable allocation. |
| 222 int num_stack_slots() const { return num_stack_slots_; } | 222 int num_stack_slots() const { return num_stack_slots_; } |
| 223 int num_heap_slots() const { return num_heap_slots_; } | 223 int num_heap_slots() const { return num_heap_slots_; } |
| 224 | 224 |
| 225 // True if this scope supports calling eval (has a properly | |
| 226 // initialized context). | |
| 227 bool SupportsEval() const; | |
| 228 | |
| 229 // Make sure this scope and all outer scopes are eagerly compiled. | 225 // Make sure this scope and all outer scopes are eagerly compiled. |
| 230 void ForceEagerCompilation() { force_eager_compilation_ = true; } | 226 void ForceEagerCompilation() { force_eager_compilation_ = true; } |
| 231 | 227 |
| 232 // Determine if we can use lazy compilation for this scope. | 228 // Determine if we can use lazy compilation for this scope. |
| 233 bool AllowsLazyCompilation() const; | 229 bool AllowsLazyCompilation() const; |
| 234 | 230 |
| 235 // True if the outer context of this scope is always the global context. | 231 // True if the outer context of this scope is always the global context. |
| 236 bool HasTrivialOuterContext() const; | 232 bool HasTrivialOuterContext() const; |
| 237 | 233 |
| 238 // The number of contexts between this and scope; zero if this == scope. | 234 // The number of contexts between this and scope; zero if this == scope. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 virtual VariableProxy* NewUnresolved(Handle<String> name, bool inside_with) { | 337 virtual VariableProxy* NewUnresolved(Handle<String> name, bool inside_with) { |
| 342 return NULL; | 338 return NULL; |
| 343 } | 339 } |
| 344 virtual VariableProxy* NewTemporary(Handle<String> name) { return NULL; } | 340 virtual VariableProxy* NewTemporary(Handle<String> name) { return NULL; } |
| 345 }; | 341 }; |
| 346 | 342 |
| 347 | 343 |
| 348 } } // namespace v8::internal | 344 } } // namespace v8::internal |
| 349 | 345 |
| 350 #endif // V8_SCOPES_H_ | 346 #endif // V8_SCOPES_H_ |
| OLD | NEW |