OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3884 ASSERT(ToRegister(instr->constructor()).is(rdi)); | 3884 ASSERT(ToRegister(instr->constructor()).is(rdi)); |
3885 ASSERT(ToRegister(instr->result()).is(rax)); | 3885 ASSERT(ToRegister(instr->result()).is(rax)); |
3886 | 3886 |
3887 __ Set(rax, instr->arity()); | 3887 __ Set(rax, instr->arity()); |
3888 __ Move(rbx, instr->hydrogen()->property_cell()); | 3888 __ Move(rbx, instr->hydrogen()->property_cell()); |
3889 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3889 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3890 bool disable_allocation_sites = | 3890 bool disable_allocation_sites = |
3891 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 3891 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
3892 | 3892 |
3893 if (instr->arity() == 0) { | 3893 if (instr->arity() == 0) { |
3894 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 3894 ArrayNoArgumentConstructorStub stub(kind, false, disable_allocation_sites); |
3895 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3895 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3896 } else if (instr->arity() == 1) { | 3896 } else if (instr->arity() == 1) { |
3897 Label done; | 3897 Label done; |
3898 if (IsFastPackedElementsKind(kind)) { | 3898 if (IsFastPackedElementsKind(kind)) { |
3899 Label packed_case; | 3899 Label packed_case; |
3900 // We might need a change here | 3900 // We might need a change here |
3901 // look at the first argument | 3901 // look at the first argument |
3902 __ movq(rcx, Operand(rsp, 0)); | 3902 __ movq(rcx, Operand(rsp, 0)); |
3903 __ testq(rcx, rcx); | 3903 __ testq(rcx, rcx); |
3904 __ j(zero, &packed_case); | 3904 __ j(zero, &packed_case); |
3905 | 3905 |
3906 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 3906 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
3907 ArraySingleArgumentConstructorStub stub(holey_kind, | 3907 ArraySingleArgumentConstructorStub stub(holey_kind, false, |
3908 disable_allocation_sites); | 3908 disable_allocation_sites); |
3909 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3909 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3910 __ jmp(&done); | 3910 __ jmp(&done); |
3911 __ bind(&packed_case); | 3911 __ bind(&packed_case); |
3912 } | 3912 } |
3913 | 3913 |
3914 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 3914 ArraySingleArgumentConstructorStub stub(kind, false, |
| 3915 disable_allocation_sites); |
3915 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3916 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3916 __ bind(&done); | 3917 __ bind(&done); |
3917 } else { | 3918 } else { |
3918 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 3919 ArrayNArgumentsConstructorStub stub(kind, false, |
| 3920 disable_allocation_sites); |
3919 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3921 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3920 } | 3922 } |
3921 } | 3923 } |
3922 | 3924 |
3923 | 3925 |
3924 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3926 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3925 CallRuntime(instr->function(), instr->arity(), instr); | 3927 CallRuntime(instr->function(), instr->arity(), instr); |
3926 } | 3928 } |
3927 | 3929 |
3928 | 3930 |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5658 FixedArray::kHeaderSize - kPointerSize)); | 5660 FixedArray::kHeaderSize - kPointerSize)); |
5659 __ bind(&done); | 5661 __ bind(&done); |
5660 } | 5662 } |
5661 | 5663 |
5662 | 5664 |
5663 #undef __ | 5665 #undef __ |
5664 | 5666 |
5665 } } // namespace v8::internal | 5667 } } // namespace v8::internal |
5666 | 5668 |
5667 #endif // V8_TARGET_ARCH_X64 | 5669 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |