| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 6 | 6 |
| 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" | 7 #include "src/crankshaft/ia32/lithium-codegen-ia32.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 3510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3521 } | 3521 } |
| 3522 } | 3522 } |
| 3523 | 3523 |
| 3524 | 3524 |
| 3525 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3525 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3526 DCHECK(ToRegister(instr->context()).is(esi)); | 3526 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3527 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3527 DCHECK(ToRegister(instr->constructor()).is(edi)); |
| 3528 DCHECK(ToRegister(instr->result()).is(eax)); | 3528 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3529 | 3529 |
| 3530 __ Move(eax, Immediate(instr->arity())); | 3530 __ Move(eax, Immediate(instr->arity())); |
| 3531 if (instr->arity() == 1) { | 3531 if (instr->arity() > 0) { |
| 3532 // We only need the allocation site for the case we have a length argument. | 3532 // We only need the allocation site for the case we have a length argument. |
| 3533 // The case may bail out to the runtime, which will determine the correct | 3533 // The case may bail out to the runtime, which will determine the correct |
| 3534 // elements kind with the site. | 3534 // elements kind with the site. |
| 3535 __ mov(ebx, instr->hydrogen()->site()); | 3535 __ mov(ebx, instr->hydrogen()->site()); |
| 3536 } else { | 3536 } else { |
| 3537 __ mov(ebx, isolate()->factory()->undefined_value()); | 3537 __ mov(ebx, isolate()->factory()->undefined_value()); |
| 3538 } | 3538 } |
| 3539 | 3539 |
| 3540 ElementsKind kind = instr->hydrogen()->elements_kind(); | 3540 ElementsKind kind = instr->hydrogen()->elements_kind(); |
| 3541 AllocationSiteOverrideMode override_mode = | 3541 AllocationSiteOverrideMode override_mode = |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3562 override_mode); | 3562 override_mode); |
| 3563 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3563 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3564 __ jmp(&done, Label::kNear); | 3564 __ jmp(&done, Label::kNear); |
| 3565 __ bind(&packed_case); | 3565 __ bind(&packed_case); |
| 3566 } | 3566 } |
| 3567 | 3567 |
| 3568 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); | 3568 ArraySingleArgumentConstructorStub stub(isolate(), kind, override_mode); |
| 3569 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3569 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3570 __ bind(&done); | 3570 __ bind(&done); |
| 3571 } else { | 3571 } else { |
| 3572 ArrayNArgumentsConstructorStub stub(isolate(), kind, override_mode); | 3572 ArrayNArgumentsConstructorStub stub(isolate()); |
| 3573 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3573 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 3574 } | 3574 } |
| 3575 } | 3575 } |
| 3576 | 3576 |
| 3577 | 3577 |
| 3578 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { | 3578 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { |
| 3579 DCHECK(ToRegister(instr->context()).is(esi)); | 3579 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3580 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); | 3580 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); |
| 3581 } | 3581 } |
| 3582 | 3582 |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5319 __ bind(deferred->exit()); | 5319 __ bind(deferred->exit()); |
| 5320 __ bind(&done); | 5320 __ bind(&done); |
| 5321 } | 5321 } |
| 5322 | 5322 |
| 5323 #undef __ | 5323 #undef __ |
| 5324 | 5324 |
| 5325 } // namespace internal | 5325 } // namespace internal |
| 5326 } // namespace v8 | 5326 } // namespace v8 |
| 5327 | 5327 |
| 5328 #endif // V8_TARGET_ARCH_IA32 | 5328 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |