| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 14 matching lines...) Expand all Loading... |
| 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | 27 |
| 28 #include <stdlib.h> | 28 #include <stdlib.h> |
| 29 | 29 |
| 30 #include "v8.h" | 30 #include "v8.h" |
| 31 | 31 |
| 32 #include "scopeinfo.h" | 32 #include "scopeinfo.h" |
| 33 #include "scopes.h" | 33 #include "scopes.h" |
| 34 | 34 |
| 35 #include "allocation-inl.h" | |
| 36 | |
| 37 namespace v8 { | 35 namespace v8 { |
| 38 namespace internal { | 36 namespace internal { |
| 39 | 37 |
| 40 | 38 |
| 41 Handle<ScopeInfo> ScopeInfo::Create(Scope* scope, Zone* zone) { | 39 Handle<ScopeInfo> ScopeInfo::Create(Scope* scope, Zone* zone) { |
| 42 // Collect stack and context locals. | 40 // Collect stack and context locals. |
| 43 ZoneList<Variable*> stack_locals(scope->StackLocalCount(), zone); | 41 ZoneList<Variable*> stack_locals(scope->StackLocalCount(), zone); |
| 44 ZoneList<Variable*> context_locals(scope->ContextLocalCount(), zone); | 42 ZoneList<Variable*> context_locals(scope->ContextLocalCount(), zone); |
| 45 scope->CollectStackAndContextLocals(&stack_locals, &context_locals); | 43 scope->CollectStackAndContextLocals(&stack_locals, &context_locals); |
| 46 const int stack_local_count = stack_locals.length(); | 44 const int stack_local_count = stack_locals.length(); |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } else { | 552 } else { |
| 555 ASSERT(var->index() >= 0); | 553 ASSERT(var->index() >= 0); |
| 556 info->set_index(i, var->index()); | 554 info->set_index(i, var->index()); |
| 557 } | 555 } |
| 558 } | 556 } |
| 559 ASSERT(i == info->length()); | 557 ASSERT(i == info->length()); |
| 560 return info; | 558 return info; |
| 561 } | 559 } |
| 562 | 560 |
| 563 } } // namespace v8::internal | 561 } } // namespace v8::internal |
| OLD | NEW |