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 4160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4171 __ mov(r0, Operand(instr->arity())); | 4171 __ mov(r0, Operand(instr->arity())); |
4172 __ mov(r2, Operand(instr->hydrogen()->property_cell())); | 4172 __ mov(r2, Operand(instr->hydrogen()->property_cell())); |
4173 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4173 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4174 bool disable_allocation_sites = | 4174 bool disable_allocation_sites = |
4175 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4175 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
4176 | 4176 |
4177 if (instr->arity() == 0) { | 4177 if (instr->arity() == 0) { |
4178 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4178 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); |
4179 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4179 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4180 } else if (instr->arity() == 1) { | 4180 } else if (instr->arity() == 1) { |
| 4181 Label done; |
| 4182 if (IsFastPackedElementsKind(kind)) { |
| 4183 Label packed_case; |
| 4184 // We might need a change here |
| 4185 // look at the first argument |
| 4186 __ ldr(r5, MemOperand(sp, 0)); |
| 4187 __ cmp(r5, Operand::Zero()); |
| 4188 __ b(eq, &packed_case); |
| 4189 |
| 4190 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 4191 ArraySingleArgumentConstructorStub stub(holey_kind, |
| 4192 disable_allocation_sites); |
| 4193 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4194 __ jmp(&done); |
| 4195 __ bind(&packed_case); |
| 4196 } |
| 4197 |
4181 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 4198 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); |
4182 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4199 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4200 __ bind(&done); |
4183 } else { | 4201 } else { |
4184 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 4202 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); |
4185 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4203 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4186 } | 4204 } |
4187 } | 4205 } |
4188 | 4206 |
4189 | 4207 |
4190 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4208 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
4191 CallRuntime(instr->function(), instr->arity(), instr); | 4209 CallRuntime(instr->function(), instr->arity(), instr); |
4192 } | 4210 } |
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5862 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5880 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5863 __ ldr(result, FieldMemOperand(scratch, | 5881 __ ldr(result, FieldMemOperand(scratch, |
5864 FixedArray::kHeaderSize - kPointerSize)); | 5882 FixedArray::kHeaderSize - kPointerSize)); |
5865 __ bind(&done); | 5883 __ bind(&done); |
5866 } | 5884 } |
5867 | 5885 |
5868 | 5886 |
5869 #undef __ | 5887 #undef __ |
5870 | 5888 |
5871 } } // namespace v8::internal | 5889 } } // namespace v8::internal |
OLD | NEW |