OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 3886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3897 __ li(a0, Operand(instr->arity())); | 3897 __ li(a0, Operand(instr->arity())); |
3898 __ li(a2, Operand(instr->hydrogen()->property_cell())); | 3898 __ li(a2, Operand(instr->hydrogen()->property_cell())); |
3899 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3899 ElementsKind kind = instr->hydrogen()->elements_kind(); |
3900 bool disable_allocation_sites = | 3900 bool disable_allocation_sites = |
3901 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 3901 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
3902 | 3902 |
3903 if (instr->arity() == 0) { | 3903 if (instr->arity() == 0) { |
3904 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 3904 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
3905 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3905 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3906 } else if (instr->arity() == 1) { | 3906 } else if (instr->arity() == 1) { |
| 3907 Label done; |
| 3908 if (IsFastPackedElementsKind(kind)) { |
| 3909 Label packed_case; |
| 3910 // We might need a change here, |
| 3911 // look at the first argument. |
| 3912 __ lw(t1, MemOperand(sp, 0)); |
| 3913 __ Branch(&packed_case, eq, t1, Operand(zero_reg)); |
| 3914 |
| 3915 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 3916 ArraySingleArgumentConstructorStub stub(holey_kind, |
| 3917 disable_allocation_sites); |
| 3918 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3919 __ jmp(&done); |
| 3920 __ bind(&packed_case); |
| 3921 } |
| 3922 |
3907 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 3923 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); |
3908 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3924 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 3925 __ bind(&done); |
3909 } else { | 3926 } else { |
3910 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 3927 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); |
3911 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 3928 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
3912 } | 3929 } |
3913 } | 3930 } |
3914 | 3931 |
3915 | 3932 |
3916 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3933 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
3917 CallRuntime(instr->function(), instr->arity(), instr); | 3934 CallRuntime(instr->function(), instr->arity(), instr); |
3918 } | 3935 } |
(...skipping 1747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5666 __ Subu(scratch, result, scratch); | 5683 __ Subu(scratch, result, scratch); |
5667 __ lw(result, FieldMemOperand(scratch, | 5684 __ lw(result, FieldMemOperand(scratch, |
5668 FixedArray::kHeaderSize - kPointerSize)); | 5685 FixedArray::kHeaderSize - kPointerSize)); |
5669 __ bind(&done); | 5686 __ bind(&done); |
5670 } | 5687 } |
5671 | 5688 |
5672 | 5689 |
5673 #undef __ | 5690 #undef __ |
5674 | 5691 |
5675 } } // namespace v8::internal | 5692 } } // namespace v8::internal |
OLD | NEW |