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/crankshaft/arm/lithium-codegen-arm.h" | 5 #include "src/crankshaft/arm/lithium-codegen-arm.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" | 10 #include "src/crankshaft/arm/lithium-gap-resolver-arm.h" |
(...skipping 3397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3408 dont_adapt_arguments || formal_parameter_count == arity; | 3408 dont_adapt_arguments || formal_parameter_count == arity; |
3409 | 3409 |
3410 Register function_reg = r1; | 3410 Register function_reg = r1; |
3411 | 3411 |
3412 LPointerMap* pointers = instr->pointer_map(); | 3412 LPointerMap* pointers = instr->pointer_map(); |
3413 | 3413 |
3414 if (can_invoke_directly) { | 3414 if (can_invoke_directly) { |
3415 // Change context. | 3415 // Change context. |
3416 __ ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); | 3416 __ ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
3417 | 3417 |
3418 // Always initialize r0 to the number of actual arguments. | 3418 // Always initialize new target and number of actual arguments. |
| 3419 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
3419 __ mov(r0, Operand(arity)); | 3420 __ mov(r0, Operand(arity)); |
3420 | 3421 |
3421 // Invoke function. | 3422 // Invoke function. |
3422 __ ldr(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); | 3423 __ ldr(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); |
3423 __ Call(ip); | 3424 __ Call(ip); |
3424 | 3425 |
3425 // Set up deoptimization. | 3426 // Set up deoptimization. |
3426 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3427 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3427 } else { | 3428 } else { |
3428 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); | 3429 SafepointGenerator generator(this, pointers, Safepoint::kLazyDeopt); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3790 } | 3791 } |
3791 generator.AfterCall(); | 3792 generator.AfterCall(); |
3792 } | 3793 } |
3793 } | 3794 } |
3794 | 3795 |
3795 | 3796 |
3796 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { | 3797 void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
3797 DCHECK(ToRegister(instr->function()).is(r1)); | 3798 DCHECK(ToRegister(instr->function()).is(r1)); |
3798 DCHECK(ToRegister(instr->result()).is(r0)); | 3799 DCHECK(ToRegister(instr->result()).is(r0)); |
3799 | 3800 |
3800 __ mov(r0, Operand(instr->arity())); | |
3801 | |
3802 // Change context. | 3801 // Change context. |
3803 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); | 3802 __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
3804 | 3803 |
| 3804 // Always initialize new target and number of actual arguments. |
| 3805 __ LoadRoot(r3, Heap::kUndefinedValueRootIndex); |
| 3806 __ mov(r0, Operand(instr->arity())); |
| 3807 |
3805 // Load the code entry address | 3808 // Load the code entry address |
3806 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); | 3809 __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
3807 __ Call(ip); | 3810 __ Call(ip); |
3808 | 3811 |
3809 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3812 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3810 } | 3813 } |
3811 | 3814 |
3812 | 3815 |
3813 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3816 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3814 DCHECK(ToRegister(instr->context()).is(cp)); | 3817 DCHECK(ToRegister(instr->context()).is(cp)); |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5772 __ push(ToRegister(instr->function())); | 5775 __ push(ToRegister(instr->function())); |
5773 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5776 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5774 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5777 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5775 } | 5778 } |
5776 | 5779 |
5777 | 5780 |
5778 #undef __ | 5781 #undef __ |
5779 | 5782 |
5780 } // namespace internal | 5783 } // namespace internal |
5781 } // namespace v8 | 5784 } // namespace v8 |
OLD | NEW |