| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 if (info->mode() == CompilationInfo::PRIMARY) { | 185 if (info->mode() == CompilationInfo::PRIMARY) { |
| 186 frame_->Enter(); | 186 frame_->Enter(); |
| 187 // tos: code slot | 187 // tos: code slot |
| 188 | 188 |
| 189 // Allocate space for locals and initialize them. This also checks | 189 // Allocate space for locals and initialize them. This also checks |
| 190 // for stack overflow. | 190 // for stack overflow. |
| 191 frame_->AllocateStackSlots(); | 191 frame_->AllocateStackSlots(); |
| 192 | 192 |
| 193 VirtualFrame::SpilledScope spilled_scope(frame_); | 193 VirtualFrame::SpilledScope spilled_scope(frame_); |
| 194 int heap_slots = scope()->num_heap_slots(); | 194 int heap_slots = scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
| 195 if (heap_slots > 0) { | 195 if (heap_slots > 0) { |
| 196 // Allocate local context. | 196 // Allocate local context. |
| 197 // Get outer context and create a new context based on it. | 197 // Get outer context and create a new context based on it. |
| 198 __ ldr(r0, frame_->Function()); | 198 __ ldr(r0, frame_->Function()); |
| 199 frame_->EmitPush(r0); | 199 frame_->EmitPush(r0); |
| 200 if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 200 if (heap_slots <= FastNewContextStub::kMaximumSlots) { |
| 201 FastNewContextStub stub(heap_slots); | 201 FastNewContextStub stub(heap_slots); |
| 202 frame_->CallStub(&stub, 1); | 202 frame_->CallStub(&stub, 1); |
| 203 } else { | 203 } else { |
| 204 frame_->CallRuntime(Runtime::kNewContext, 1); | 204 frame_->CallRuntime(Runtime::kNewContext, 1); |
| (...skipping 9696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9901 | 9901 |
| 9902 // Just jump to runtime to add the two strings. | 9902 // Just jump to runtime to add the two strings. |
| 9903 __ bind(&string_add_runtime); | 9903 __ bind(&string_add_runtime); |
| 9904 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); | 9904 __ TailCallRuntime(Runtime::kStringAdd, 2, 1); |
| 9905 } | 9905 } |
| 9906 | 9906 |
| 9907 | 9907 |
| 9908 #undef __ | 9908 #undef __ |
| 9909 | 9909 |
| 9910 } } // namespace v8::internal | 9910 } } // namespace v8::internal |
| OLD | NEW |