| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 // Traverse the scope tree up to the first unresolved scope or the global | 268 // Traverse the scope tree up to the first unresolved scope or the global |
| 269 // scope and start scope resolution and variable allocation from that scope. | 269 // scope and start scope resolution and variable allocation from that scope. |
| 270 while (!top->is_global_scope() && | 270 while (!top->is_global_scope() && |
| 271 !top->outer_scope()->already_resolved()) { | 271 !top->outer_scope()->already_resolved()) { |
| 272 top = top->outer_scope(); | 272 top = top->outer_scope(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 // Allocate the variables. | 275 // Allocate the variables. |
| 276 { | 276 { |
| 277 AstNodeFactory<AstNullVisitor> ast_node_factory(info->isolate()); | 277 AstNodeFactory<AstNullVisitor> ast_node_factory(info->isolate(), |
| 278 info->zone()); |
| 278 if (!top->AllocateVariables(info, &ast_node_factory)) return false; | 279 if (!top->AllocateVariables(info, &ast_node_factory)) return false; |
| 279 } | 280 } |
| 280 | 281 |
| 281 #ifdef DEBUG | 282 #ifdef DEBUG |
| 282 if (info->isolate()->bootstrapper()->IsActive() | 283 if (info->isolate()->bootstrapper()->IsActive() |
| 283 ? FLAG_print_builtin_scopes | 284 ? FLAG_print_builtin_scopes |
| 284 : FLAG_print_scopes) { | 285 : FLAG_print_scopes) { |
| 285 scope->Print(); | 286 scope->Print(); |
| 286 } | 287 } |
| 287 | 288 |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1292 } | 1293 } |
| 1293 | 1294 |
| 1294 | 1295 |
| 1295 int Scope::ContextLocalCount() const { | 1296 int Scope::ContextLocalCount() const { |
| 1296 if (num_heap_slots() == 0) return 0; | 1297 if (num_heap_slots() == 0) return 0; |
| 1297 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1298 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1298 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1299 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
| 1299 } | 1300 } |
| 1300 | 1301 |
| 1301 } } // namespace v8::internal | 1302 } } // namespace v8::internal |
| OLD | NEW |