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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.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 3827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3838 } | 3838 } |
3839 } | 3839 } |
3840 | 3840 |
3841 | 3841 |
3842 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3842 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3843 DCHECK(ToRegister(instr->context()).is(esi)); | 3843 DCHECK(ToRegister(instr->context()).is(esi)); |
3844 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3844 DCHECK(ToRegister(instr->constructor()).is(edi)); |
3845 DCHECK(ToRegister(instr->result()).is(eax)); | 3845 DCHECK(ToRegister(instr->result()).is(eax)); |
3846 | 3846 |
3847 __ Move(eax, Immediate(instr->arity())); | 3847 __ Move(eax, Immediate(instr->arity())); |
3848 if (instr->arity() == 1) { | 3848 __ mov(ebx, instr->hydrogen()->site()); |
3849 // We only need the allocation site for the case we have a length argument. | |
3850 // The case may bail out to the runtime, which will determine the correct | |
3851 // elements kind with the site. | |
3852 __ mov(ebx, instr->hydrogen()->site()); | |
3853 } else { | |
3854 __ mov(ebx, isolate()->factory()->undefined_value()); | |
3855 } | |
3856 | 3849 |
3857 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3850 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3858 AllocationSiteOverrideMode override_mode = | 3851 AllocationSiteOverrideMode override_mode = |
3859 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) | 3852 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) |
3860 ? DISABLE_ALLOCATION_SITES | 3853 ? DISABLE_ALLOCATION_SITES |
3861 : DONT_OVERRIDE; | 3854 : DONT_OVERRIDE; |
3862 | 3855 |
3863 if (instr->arity() == 0) { | 3856 if (instr->arity() == 0) { |
3864 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); | 3857 ArrayNoArgumentConstructorStub stub(isolate(), kind, override_mode); |
3865 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3858 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
(...skipping 13 matching lines...) Expand all Loading... |
3879 override_mode); | 3872 override_mode); |
3880 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3873 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3881 __ jmp(&done, Label::kNear); | 3874 __ jmp(&done, Label::kNear); |
3882 __ bind(&packed_case); | 3875 __ bind(&packed_case); |
3883 } | 3876 } |
3884 | 3877 |
3885 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3878 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
3886 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3879 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3887 __ bind(&done); | 3880 __ bind(&done); |
3888 } else { | 3881 } else { |
3889 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3882 ArrayNArgumentsConstructorStub stub(isolate()); |
3890 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3883 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3891 } | 3884 } |
3892 } | 3885 } |
3893 | 3886 |
3894 | 3887 |
3895 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3888 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3896 DCHECK(ToRegister(instr->context()).is(esi)); | 3889 DCHECK(ToRegister(instr->context()).is(esi)); |
3897 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 3890 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
3898 } | 3891 } |
3899 | 3892 |
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5840 __ bind(deferred->exit()); | 5833 __ bind(deferred->exit()); |
5841 __ bind(&done); | 5834 __ bind(&done); |
5842 } | 5835 } |
5843 | 5836 |
5844 #undef __ | 5837 #undef __ |
5845 | 5838 |
5846 } // namespace internal | 5839 } // namespace internal |
5847 } // namespace v8 | 5840 } // namespace v8 |
5848 | 5841 |
5849 #endif // V8_TARGET_ARCH_X87 | 5842 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |