| 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 4172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4183 ASSERT(ToRegister(instr->constructor()).is(edi)); | 4183 ASSERT(ToRegister(instr->constructor()).is(edi)); |
| 4184 ASSERT(ToRegister(instr->result()).is(eax)); | 4184 ASSERT(ToRegister(instr->result()).is(eax)); |
| 4185 | 4185 |
| 4186 __ Set(eax, Immediate(instr->arity())); | 4186 __ Set(eax, Immediate(instr->arity())); |
| 4187 __ mov(ebx, instr->hydrogen()->property_cell()); | 4187 __ mov(ebx, instr->hydrogen()->property_cell()); |
| 4188 ElementsKind kind = instr->hydrogen()->elements_kind(); | 4188 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 4189 bool disable_allocation_sites = | 4189 bool disable_allocation_sites = |
| 4190 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); | 4190 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); |
| 4191 | 4191 |
| 4192 if (instr->arity() == 0) { | 4192 if (instr->arity() == 0) { |
| 4193 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); | 4193 ArrayNoArgumentConstructorStub stub(kind, false, disable_allocation_sites); |
| 4194 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4194 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4195 } else if (instr->arity() == 1) { | 4195 } else if (instr->arity() == 1) { |
| 4196 Label done; | 4196 Label done; |
| 4197 if (IsFastPackedElementsKind(kind)) { | 4197 if (IsFastPackedElementsKind(kind)) { |
| 4198 Label packed_case; | 4198 Label packed_case; |
| 4199 // We might need a change here | 4199 // We might need a change here |
| 4200 // look at the first argument | 4200 // look at the first argument |
| 4201 __ mov(ecx, Operand(esp, 0)); | 4201 __ mov(ecx, Operand(esp, 0)); |
| 4202 __ test(ecx, ecx); | 4202 __ test(ecx, ecx); |
| 4203 __ j(zero, &packed_case); | 4203 __ j(zero, &packed_case); |
| 4204 | 4204 |
| 4205 ElementsKind holey_kind = GetHoleyElementsKind(kind); | 4205 ElementsKind holey_kind = GetHoleyElementsKind(kind); |
| 4206 ArraySingleArgumentConstructorStub stub(holey_kind, | 4206 ArraySingleArgumentConstructorStub stub(holey_kind, false, |
| 4207 disable_allocation_sites); | 4207 disable_allocation_sites); |
| 4208 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4208 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4209 __ jmp(&done); | 4209 __ jmp(&done); |
| 4210 __ bind(&packed_case); | 4210 __ bind(&packed_case); |
| 4211 } | 4211 } |
| 4212 | 4212 |
| 4213 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); | 4213 ArraySingleArgumentConstructorStub stub(kind, false, |
| 4214 disable_allocation_sites); |
| 4214 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4215 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4215 __ bind(&done); | 4216 __ bind(&done); |
| 4216 } else { | 4217 } else { |
| 4217 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); | 4218 ArrayNArgumentsConstructorStub stub(kind, false, |
| 4219 disable_allocation_sites); |
| 4218 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); | 4220 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); |
| 4219 } | 4221 } |
| 4220 } | 4222 } |
| 4221 | 4223 |
| 4222 | 4224 |
| 4223 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 4225 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 4224 CallRuntime(instr->function(), instr->arity(), instr); | 4226 CallRuntime(instr->function(), instr->arity(), instr); |
| 4225 } | 4227 } |
| 4226 | 4228 |
| 4227 | 4229 |
| (...skipping 2328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6556 FixedArray::kHeaderSize - kPointerSize)); | 6558 FixedArray::kHeaderSize - kPointerSize)); |
| 6557 __ bind(&done); | 6559 __ bind(&done); |
| 6558 } | 6560 } |
| 6559 | 6561 |
| 6560 | 6562 |
| 6561 #undef __ | 6563 #undef __ |
| 6562 | 6564 |
| 6563 } } // namespace v8::internal | 6565 } } // namespace v8::internal |
| 6564 | 6566 |
| 6565 #endif // V8_TARGET_ARCH_IA32 | 6567 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |