| 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 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 3785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3796 } | 3796 } |
| 3797 | 3797 |
| 3798 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3798 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3799 AllocationSiteOverrideMode override_mode = | 3799 AllocationSiteOverrideMode override_mode = |
| 3800 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3800 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
| 3801 ? DISABLE_ALLOCATION_SITES | 3801 ? DISABLE_ALLOCATION_SITES |
| 3802 : DONT_OVERRIDE; | 3802 : DONT_OVERRIDE; |
| 3803 | 3803 |
| 3804 if (instr->arity() == 0) { | 3804 if (instr->arity() == 0) { |
| 3805 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3805 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3806 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3806 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3807 } else if (instr->arity() == 1) { | 3807 } else if (instr->arity() == 1) { |
| 3808 Label done; | 3808 Label done; |
| 3809 if (IsFastPackedElementsKind(kind)) { | 3809 if (IsFastPackedElementsKind(kind)) { |
| 3810 Label packed_case; | 3810 Label packed_case; |
| 3811 // We might need a change here | 3811 // We might need a change here |
| 3812 // look at the first argument | 3812 // look at the first argument |
| 3813 __ mov(ecx, Operand(esp, 0)); | 3813 __ mov(ecx, Operand(esp, 0)); |
| 3814 __ test(ecx, ecx); | 3814 __ test(ecx, ecx); |
| 3815 __ j(zero, &packed_case, Label::kNear); | 3815 __ j(zero, &packed_case, Label::kNear); |
| 3816 | 3816 |
| 3817 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 3817 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 3818 ArraySingleArgumentConstructorStub stub(isolate(), | 3818 ArraySingleArgumentConstructorStub stub(isolate(), |
| 3819 holey_kind, | 3819 holey_kind, |
| 3820 override_mode); | 3820 override_mode); |
| 3821 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3821 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3822 __ jmp(&done, Label::kNear); | 3822 __ jmp(&done, Label::kNear); |
| 3823 __ bind(&packed_case); | 3823 __ bind(&packed_case); |
| 3824 } | 3824 } |
| 3825 | 3825 |
| 3826 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3826 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3827 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3827 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3828 __ bind(&done); | 3828 __ bind(&done); |
| 3829 } else { | 3829 } else { |
| 3830 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3830 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); |
| 3831 CallCode(stub.GetCode(), RelocInfo::CONSTRUCT_CALL, instr); | 3831 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3832 } | 3832 } |
| 3833 } | 3833 } |
| 3834 | 3834 |
| 3835 | 3835 |
| 3836 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3836 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 3837 DCHECK(ToRegister(instr->context()).is(esi)); | 3837 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3838 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 3838 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
| 3839 } | 3839 } |
| 3840 | 3840 |
| 3841 | 3841 |
| (...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5588 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5588 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5589 } | 5589 } |
| 5590 | 5590 |
| 5591 | 5591 |
| 5592 #undef __ | 5592 #undef __ |
| 5593 | 5593 |
| 5594 } // namespace internal | 5594 } // namespace internal |
| 5595 } // namespace v8 | 5595 } // namespace v8 |
| 5596 | 5596 |
| 5597 #endif // V8_TARGET_ARCH_IA32 | 5597 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |