| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/scopes.h" | 7 #include "src/scopes.h" |
| 8 | 8 |
| 9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 // Traverse the scope tree up to the first unresolved scope or the global | 265 // Traverse the scope tree up to the first unresolved scope or the global |
| 266 // scope and start scope resolution and variable allocation from that scope. | 266 // scope and start scope resolution and variable allocation from that scope. |
| 267 while (!top->is_global_scope() && | 267 while (!top->is_global_scope() && |
| 268 !top->outer_scope()->already_resolved()) { | 268 !top->outer_scope()->already_resolved()) { |
| 269 top = top->outer_scope(); | 269 top = top->outer_scope(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Allocate the variables. | 272 // Allocate the variables. |
| 273 { | 273 { |
| 274 AstNodeFactory<AstNullVisitor> ast_node_factory( | 274 AstNodeFactory<AstNullVisitor> ast_node_factory(info->zone(), |
| 275 info->zone(), info->ast_value_factory(), info->ast_node_id_gen()); | 275 info->ast_value_factory()); |
| 276 if (!top->AllocateVariables(info, &ast_node_factory)) return false; | 276 if (!top->AllocateVariables(info, &ast_node_factory)) return false; |
| 277 } | 277 } |
| 278 | 278 |
| 279 #ifdef DEBUG | 279 #ifdef DEBUG |
| 280 if (info->isolate()->bootstrapper()->IsActive() | 280 if (info->isolate()->bootstrapper()->IsActive() |
| 281 ? FLAG_print_builtin_scopes | 281 ? FLAG_print_builtin_scopes |
| 282 : FLAG_print_scopes) { | 282 : FLAG_print_scopes) { |
| 283 scope->Print(); | 283 scope->Print(); |
| 284 } | 284 } |
| 285 | 285 |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1402 } | 1402 } |
| 1403 | 1403 |
| 1404 | 1404 |
| 1405 int Scope::ContextLocalCount() const { | 1405 int Scope::ContextLocalCount() const { |
| 1406 if (num_heap_slots() == 0) return 0; | 1406 if (num_heap_slots() == 0) return 0; |
| 1407 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1407 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1408 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1408 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 } } // namespace v8::internal | 1411 } } // namespace v8::internal |
| OLD | NEW |