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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset)); | 267 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset)); |
268 __ b(&done); | 268 __ b(&done); |
269 | 269 |
270 __ bind(&non_construct_frame); | 270 __ bind(&non_construct_frame); |
271 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 271 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
272 __ bind(&done); | 272 __ bind(&done); |
273 | 273 |
274 SetVar(new_target_var, r0, r2, r3); | 274 SetVar(new_target_var, r0, r2, r3); |
275 } | 275 } |
276 | 276 |
277 // Possibly allocate RestParameters | |
278 int rest_index; | |
279 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
280 if (rest_param) { | |
281 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
282 | |
283 int num_parameters = info->scope()->num_parameters(); | |
284 int offset = num_parameters * kPointerSize; | |
285 | |
286 __ add(r3, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
287 __ mov(r2, Operand(Smi::FromInt(num_parameters))); | |
288 __ mov(r1, Operand(Smi::FromInt(rest_index))); | |
289 __ mov(r0, Operand(Smi::FromInt(language_mode()))); | |
290 __ Push(r3, r2, r1, r0); | |
291 | |
292 RestParamAccessStub stub(isolate()); | |
293 __ CallStub(&stub); | |
294 | |
295 SetVar(rest_param, r0, r1, r2); | |
296 } | |
297 | |
298 Variable* arguments = scope()->arguments(); | 277 Variable* arguments = scope()->arguments(); |
299 if (arguments != NULL) { | 278 if (arguments != NULL) { |
300 // Function uses arguments object. | 279 // Function uses arguments object. |
301 Comment cmnt(masm_, "[ Allocate arguments object"); | 280 Comment cmnt(masm_, "[ Allocate arguments object"); |
302 if (!function_in_register) { | 281 if (!function_in_register) { |
303 // Load this again, if it's used by the local context below. | 282 // Load this again, if it's used by the local context below. |
304 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 283 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
305 } else { | 284 } else { |
306 __ mov(r3, r1); | 285 __ mov(r3, r1); |
307 } | 286 } |
(...skipping 5162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5470 DCHECK(interrupt_address == | 5449 DCHECK(interrupt_address == |
5471 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5450 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5472 return OSR_AFTER_STACK_CHECK; | 5451 return OSR_AFTER_STACK_CHECK; |
5473 } | 5452 } |
5474 | 5453 |
5475 | 5454 |
5476 } // namespace internal | 5455 } // namespace internal |
5477 } // namespace v8 | 5456 } // namespace v8 |
5478 | 5457 |
5479 #endif // V8_TARGET_ARCH_ARM | 5458 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |