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 4129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4140 ASSERT(ToRegister(instr->constructor()).is(r1)); | 4140 ASSERT(ToRegister(instr->constructor()).is(r1)); |
4141 ASSERT(ToRegister(instr->result()).is(r0)); | 4141 ASSERT(ToRegister(instr->result()).is(r0)); |
4142 | 4142 |
4143 __ mov(r0, Operand(instr->arity())); | 4143 __ mov(r0, Operand(instr->arity())); |
4144 __ mov(r2, Operand(instr->hydrogen()->property_cell())); | 4144 __ mov(r2, Operand(instr->hydrogen()->property_cell())); |
4145 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4145 ElementsKind kind = instr->hydrogen()->elements_kind(); |
4146 bool disable_allocation_sites = | 4146 bool disable_allocation_sites = |
4147 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4147 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
4148 | 4148 |
4149 if (instr->arity() == 0) { | 4149 if (instr->arity() == 0) { |
4150 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4150 ArrayNoArgumentConstructorStub stub(kind, false, disable_allocation_sites); |
4151 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4151 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4152 } else if (instr->arity() == 1) { | 4152 } else if (instr->arity() == 1) { |
4153 Label done; | 4153 Label done; |
4154 if (IsFastPackedElementsKind(kind)) { | 4154 if (IsFastPackedElementsKind(kind)) { |
4155 Label packed_case; | 4155 Label packed_case; |
4156 // We might need a change here | 4156 // We might need a change here |
4157 // look at the first argument | 4157 // look at the first argument |
4158 __ ldr(r5, MemOperand(sp, 0)); | 4158 __ ldr(r5, MemOperand(sp, 0)); |
4159 __ cmp(r5, Operand::Zero()); | 4159 __ cmp(r5, Operand::Zero()); |
4160 __ b(eq, &packed_case); | 4160 __ b(eq, &packed_case); |
4161 | 4161 |
4162 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4162 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
4163 ArraySingleArgumentConstructorStub stub(holey_kind, | 4163 ArraySingleArgumentConstructorStub stub(holey_kind, false |
4164 disable_allocation_sites); | 4164 disable_allocation_sites); |
4165 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4165 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4166 __ jmp(&done); | 4166 __ jmp(&done); |
4167 __ bind(&packed_case); | 4167 __ bind(&packed_case); |
4168 } | 4168 } |
4169 | 4169 |
4170 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 4170 ArraySingleArgumentConstructorStub stub(kind, false, |
| 4171 disable_allocation_sites); |
4171 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4172 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4172 __ bind(&done); | 4173 __ bind(&done); |
4173 } else { | 4174 } else { |
4174 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 4175 ArrayNArgumentsConstructorStub stub(kind, false, |
| 4176 disable_allocation_sites); |
4175 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4177 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
4176 } | 4178 } |
4177 } | 4179 } |
4178 | 4180 |
4179 | 4181 |
4180 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4182 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
4181 CallRuntime(instr->function(), instr->arity(), instr); | 4183 CallRuntime(instr->function(), instr->arity(), instr); |
4182 } | 4184 } |
4183 | 4185 |
4184 | 4186 |
(...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5920 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5922 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5921 __ ldr(result, FieldMemOperand(scratch, | 5923 __ ldr(result, FieldMemOperand(scratch, |
5922 FixedArray::kHeaderSize - kPointerSize)); | 5924 FixedArray::kHeaderSize - kPointerSize)); |
5923 __ bind(&done); | 5925 __ bind(&done); |
5924 } | 5926 } |
5925 | 5927 |
5926 | 5928 |
5927 #undef __ | 5929 #undef __ |
5928 | 5930 |
5929 } } // namespace v8::internal | 5931 } } // namespace v8::internal |
OLD | NEW |