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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 // Traverse the scope tree up to the first unresolved scope or the global | 284 // Traverse the scope tree up to the first unresolved scope or the global |
285 // scope and start scope resolution and variable allocation from that scope. | 285 // scope and start scope resolution and variable allocation from that scope. |
286 while (!top->is_global_scope() && | 286 while (!top->is_global_scope() && |
287 !top->outer_scope()->already_resolved()) { | 287 !top->outer_scope()->already_resolved()) { |
288 top = top->outer_scope(); | 288 top = top->outer_scope(); |
289 } | 289 } |
290 | 290 |
291 // Allocate the variables. | 291 // Allocate the variables. |
292 { | 292 { |
293 AstNodeFactory<AstNullVisitor> ast_node_factory(info->isolate(), | 293 AstNodeFactory<AstNullVisitor> ast_node_factory(info->zone()); |
294 info->zone()); | |
295 if (!top->AllocateVariables(info, &ast_node_factory)) return false; | 294 if (!top->AllocateVariables(info, &ast_node_factory)) return false; |
296 } | 295 } |
297 | 296 |
298 #ifdef DEBUG | 297 #ifdef DEBUG |
299 if (info->isolate()->bootstrapper()->IsActive() | 298 if (info->isolate()->bootstrapper()->IsActive() |
300 ? FLAG_print_builtin_scopes | 299 ? FLAG_print_builtin_scopes |
301 : FLAG_print_scopes) { | 300 : FLAG_print_scopes) { |
302 scope->Print(); | 301 scope->Print(); |
303 } | 302 } |
304 | 303 |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1405 } | 1404 } |
1406 | 1405 |
1407 | 1406 |
1408 int Scope::ContextLocalCount() const { | 1407 int Scope::ContextLocalCount() const { |
1409 if (num_heap_slots() == 0) return 0; | 1408 if (num_heap_slots() == 0) return 0; |
1410 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1409 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
1411 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); | 1410 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); |
1412 } | 1411 } |
1413 | 1412 |
1414 } } // namespace v8::internal | 1413 } } // namespace v8::internal |
OLD | NEW |