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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 ASSERT(function_name_info != STACK || | 135 ASSERT(function_name_info != STACK || |
136 (var_index == scope_info->StackLocalCount() && | 136 (var_index == scope_info->StackLocalCount() && |
137 var_index == scope_info->StackSlotCount() - 1)); | 137 var_index == scope_info->StackSlotCount() - 1)); |
138 ASSERT(function_name_info != CONTEXT || | 138 ASSERT(function_name_info != CONTEXT || |
139 var_index == scope_info->ContextLength() - 1); | 139 var_index == scope_info->ContextLength() - 1); |
140 } | 140 } |
141 | 141 |
142 ASSERT(index == scope_info->length()); | 142 ASSERT(index == scope_info->length()); |
143 ASSERT(scope->num_parameters() == scope_info->ParameterCount()); | 143 ASSERT(scope->num_parameters() == scope_info->ParameterCount()); |
144 ASSERT(scope->num_stack_slots() == scope_info->StackSlotCount()); | 144 ASSERT(scope->num_stack_slots() == scope_info->StackSlotCount()); |
145 ASSERT(scope->num_heap_slots() == scope_info->ContextLength()); | 145 ASSERT(scope->num_heap_slots() == scope_info->ContextLength() || |
| 146 (scope->num_heap_slots() == kVariablePartIndex && |
| 147 scope_info->ContextLength() == 0)); |
146 return scope_info; | 148 return scope_info; |
147 } | 149 } |
148 | 150 |
149 | 151 |
150 ScopeInfo* ScopeInfo::Empty() { | 152 ScopeInfo* ScopeInfo::Empty() { |
151 return reinterpret_cast<ScopeInfo*>(HEAP->empty_fixed_array()); | 153 return reinterpret_cast<ScopeInfo*>(HEAP->empty_fixed_array()); |
152 } | 154 } |
153 | 155 |
154 | 156 |
155 ScopeType ScopeInfo::Type() { | 157 ScopeType ScopeInfo::Type() { |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 Context::MIN_CONTEXT_SLOTS, | 501 Context::MIN_CONTEXT_SLOTS, |
500 ContextLocalNameEntriesIndex(), | 502 ContextLocalNameEntriesIndex(), |
501 ContextLocalNameEntriesIndex() + ContextLocalCount(), | 503 ContextLocalNameEntriesIndex() + ContextLocalCount(), |
502 this); | 504 this); |
503 | 505 |
504 PrintF("}\n"); | 506 PrintF("}\n"); |
505 } | 507 } |
506 #endif // DEBUG | 508 #endif // DEBUG |
507 | 509 |
508 } } // namespace v8::internal | 510 } } // namespace v8::internal |
OLD | NEW |