OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Emit the remaining pushes. | 184 // Emit the remaining pushes. |
185 for (int i = 0; i < remaining; i++) { | 185 for (int i = 0; i < remaining; i++) { |
186 __ push(r9); | 186 __ push(r9); |
187 } | 187 } |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 bool function_in_register = true; | 191 bool function_in_register = true; |
192 | 192 |
193 // Possibly allocate a local context. | 193 // Possibly allocate a local context. |
194 int heap_slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; | 194 if (info->scope()->num_heap_slots() > 0) { |
195 if (heap_slots > 0) { | |
196 // Argument to NewContext is the function, which is still in r1. | 195 // Argument to NewContext is the function, which is still in r1. |
197 Comment cmnt(masm_, "[ Allocate context"); | 196 Comment cmnt(masm_, "[ Allocate context"); |
198 bool need_write_barrier = true; | 197 bool need_write_barrier = true; |
| 198 int slots = info->scope()->num_heap_slots() - Context::MIN_CONTEXT_SLOTS; |
199 if (info->scope()->is_script_scope()) { | 199 if (info->scope()->is_script_scope()) { |
200 __ push(r1); | 200 __ push(r1); |
201 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 201 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
202 __ CallRuntime(Runtime::kNewScriptContext, 2); | 202 __ CallRuntime(Runtime::kNewScriptContext, 2); |
203 } else if (heap_slots <= FastNewContextStub::kMaximumSlots) { | 203 } else if (slots <= FastNewContextStub::kMaximumSlots) { |
204 FastNewContextStub stub(isolate(), heap_slots); | 204 FastNewContextStub stub(isolate(), slots); |
205 __ CallStub(&stub); | 205 __ CallStub(&stub); |
206 // Result of FastNewContextStub is always in new space. | 206 // Result of FastNewContextStub is always in new space. |
207 need_write_barrier = false; | 207 need_write_barrier = false; |
208 } else { | 208 } else { |
209 __ push(r1); | 209 __ push(r1); |
210 __ CallRuntime(Runtime::kNewFunctionContext, 1); | 210 __ CallRuntime(Runtime::kNewFunctionContext, 1); |
211 } | 211 } |
212 function_in_register = false; | 212 function_in_register = false; |
213 // Context is returned in r0. It replaces the context passed to us. | 213 // Context is returned in r0. It replaces the context passed to us. |
214 // It's saved in the stack and kept live in cp. | 214 // It's saved in the stack and kept live in cp. |
(...skipping 5359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5574 DCHECK(interrupt_address == | 5574 DCHECK(interrupt_address == |
5575 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5575 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5576 return OSR_AFTER_STACK_CHECK; | 5576 return OSR_AFTER_STACK_CHECK; |
5577 } | 5577 } |
5578 | 5578 |
5579 | 5579 |
5580 } // namespace internal | 5580 } // namespace internal |
5581 } // namespace v8 | 5581 } // namespace v8 |
5582 | 5582 |
5583 #endif // V8_TARGET_ARCH_ARM | 5583 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |