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 3690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3701 } | 3701 } |
3702 } | 3702 } |
3703 | 3703 |
3704 | 3704 |
3705 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3705 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3706 DCHECK(ToRegister(instr->context()).is(cp)); | 3706 DCHECK(ToRegister(instr->context()).is(cp)); |
3707 DCHECK(ToRegister(instr->constructor()).is(r1)); | 3707 DCHECK(ToRegister(instr->constructor()).is(r1)); |
3708 DCHECK(ToRegister(instr->result()).is(r0)); | 3708 DCHECK(ToRegister(instr->result()).is(r0)); |
3709 | 3709 |
3710 __ mov(r0, Operand(instr->arity())); | 3710 __ mov(r0, Operand(instr->arity())); |
3711 if (instr->arity() == 1) { | 3711 if (instr->arity() > 0) { |
3712 // We only need the allocation site for the case we have a length argument. | 3712 // We only need the allocation site for the case we have a length argument. |
3713 // The case may bail out to the runtime, which will determine the correct | 3713 // The case may bail out to the runtime, which will determine the correct |
3714 // elements kind with the site. | 3714 // elements kind with the site. |
3715 __ Move(r2, instr->hydrogen()->site()); | 3715 __ Move(r2, instr->hydrogen()->site()); |
3716 } else { | 3716 } else { |
3717 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | 3717 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); |
3718 } | 3718 } |
3719 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3719 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3720 AllocationSiteOverrideMode override_mode = | 3720 AllocationSiteOverrideMode override_mode = |
3721 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3721 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
(...skipping 19 matching lines...) Expand all Loading... |
3741 override_mode); | 3741 override_mode); |
3742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3743 __ jmp(&done); | 3743 __ jmp(&done); |
3744 __ bind(&packed_case); | 3744 __ bind(&packed_case); |
3745 } | 3745 } |
3746 | 3746 |
3747 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3747 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
3748 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3748 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3749 __ bind(&done); | 3749 __ bind(&done); |
3750 } else { | 3750 } else { |
3751 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3751 ArrayNArgumentsConstructorStub stub(isolate()); |
3752 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3752 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3753 } | 3753 } |
3754 } | 3754 } |
3755 | 3755 |
3756 | 3756 |
3757 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3757 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3758 CallRuntime(instr->function(), instr->arity(), instr); | 3758 CallRuntime(instr->function(), instr->arity(), instr); |
3759 } | 3759 } |
3760 | 3760 |
3761 | 3761 |
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5559 __ ldr(result, FieldMemOperand(scratch, | 5559 __ ldr(result, FieldMemOperand(scratch, |
5560 FixedArray::kHeaderSize - kPointerSize)); | 5560 FixedArray::kHeaderSize - kPointerSize)); |
5561 __ bind(deferred->exit()); | 5561 __ bind(deferred->exit()); |
5562 __ bind(&done); | 5562 __ bind(&done); |
5563 } | 5563 } |
5564 | 5564 |
5565 #undef __ | 5565 #undef __ |
5566 | 5566 |
5567 } // namespace internal | 5567 } // namespace internal |
5568 } // namespace v8 | 5568 } // namespace v8 |
OLD | NEW |