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 __ Move(r2, instr->hydrogen()->site()); |
3712 // We only need the allocation site for the case we have a length argument. | 3712 |
3713 // The case may bail out to the runtime, which will determine the correct | |
3714 // elements kind with the site. | |
3715 __ Move(r2, instr->hydrogen()->site()); | |
3716 } else { | |
3717 __ LoadRoot(r2, Heap::kUndefinedValueRootIndex); | |
3718 } | |
3719 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3713 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3720 AllocationSiteOverrideMode override_mode = | 3714 AllocationSiteOverrideMode override_mode = |
3721 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3715 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3722 ? DISABLE_ALLOCATION_SITES | 3716 ? DISABLE_ALLOCATION_SITES |
3723 : DONT_OVERRIDE; | 3717 : DONT_OVERRIDE; |
3724 | 3718 |
3725 if (instr->arity() == 0) { | 3719 if (instr->arity() == 0) { |
3726 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3720 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
3727 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3721 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3728 } else if (instr->arity() == 1) { | 3722 } else if (instr->arity() == 1) { |
(...skipping 12 matching lines...) Expand all Loading... |
3741 override_mode); | 3735 override_mode); |
3742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3736 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3743 __ jmp(&done); | 3737 __ jmp(&done); |
3744 __ bind(&packed_case); | 3738 __ bind(&packed_case); |
3745 } | 3739 } |
3746 | 3740 |
3747 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3741 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
3748 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3742 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3749 __ bind(&done); | 3743 __ bind(&done); |
3750 } else { | 3744 } else { |
3751 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3745 ArrayNArgumentsConstructorStub stub(isolate()); |
3752 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3746 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3753 } | 3747 } |
3754 } | 3748 } |
3755 | 3749 |
3756 | 3750 |
3757 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3751 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3758 CallRuntime(instr->function(), instr->arity(), instr); | 3752 CallRuntime(instr->function(), instr->arity(), instr); |
3759 } | 3753 } |
3760 | 3754 |
3761 | 3755 |
(...skipping 1797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5559 __ ldr(result, FieldMemOperand(scratch, | 5553 __ ldr(result, FieldMemOperand(scratch, |
5560 FixedArray::kHeaderSize - kPointerSize)); | 5554 FixedArray::kHeaderSize - kPointerSize)); |
5561 __ bind(deferred->exit()); | 5555 __ bind(deferred->exit()); |
5562 __ bind(&done); | 5556 __ bind(&done); |
5563 } | 5557 } |
5564 | 5558 |
5565 #undef __ | 5559 #undef __ |
5566 | 5560 |
5567 } // namespace internal | 5561 } // namespace internal |
5568 } // namespace v8 | 5562 } // namespace v8 |
OLD | NEW |