| 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 3572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3583 ParameterCount count(instr->arity()); | 3583 ParameterCount count(instr->arity()); |
| 3584 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); | 3584 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); |
| 3585 } else { | 3585 } else { |
| 3586 CallKnownFunction(known_function, | 3586 CallKnownFunction(known_function, |
| 3587 instr->hydrogen()->formal_parameter_count(), | 3587 instr->hydrogen()->formal_parameter_count(), |
| 3588 instr->arity(), instr); | 3588 instr->arity(), instr); |
| 3589 } | 3589 } |
| 3590 } | 3590 } |
| 3591 | 3591 |
| 3592 | 3592 |
| 3593 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
| 3594 HCallFunction* hinstr = instr->hydrogen(); | |
| 3595 DCHECK(ToRegister(instr->context()).is(esi)); | |
| 3596 DCHECK(ToRegister(instr->function()).is(edi)); | |
| 3597 DCHECK(ToRegister(instr->result()).is(eax)); | |
| 3598 | |
| 3599 int arity = instr->arity(); | |
| 3600 ConvertReceiverMode mode = hinstr->convert_mode(); | |
| 3601 if (hinstr->HasVectorAndSlot()) { | |
| 3602 Register slot_register = ToRegister(instr->temp_slot()); | |
| 3603 Register vector_register = ToRegister(instr->temp_vector()); | |
| 3604 DCHECK(slot_register.is(edx)); | |
| 3605 DCHECK(vector_register.is(ebx)); | |
| 3606 | |
| 3607 AllowDeferredHandleDereference vector_structure_check; | |
| 3608 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
| 3609 int index = vector->GetIndex(hinstr->slot()); | |
| 3610 | |
| 3611 __ mov(vector_register, vector); | |
| 3612 __ mov(slot_register, Immediate(Smi::FromInt(index))); | |
| 3613 | |
| 3614 Handle<Code> ic = | |
| 3615 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
| 3616 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 3617 } else { | |
| 3618 __ Set(eax, arity); | |
| 3619 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
| 3620 } | |
| 3621 } | |
| 3622 | |
| 3623 | |
| 3624 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3593 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3625 DCHECK(ToRegister(instr->context()).is(esi)); | 3594 DCHECK(ToRegister(instr->context()).is(esi)); |
| 3626 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3595 DCHECK(ToRegister(instr->constructor()).is(edi)); |
| 3627 DCHECK(ToRegister(instr->result()).is(eax)); | 3596 DCHECK(ToRegister(instr->result()).is(eax)); |
| 3628 | 3597 |
| 3629 __ Move(eax, Immediate(instr->arity())); | 3598 __ Move(eax, Immediate(instr->arity())); |
| 3630 if (instr->arity() == 1) { | 3599 if (instr->arity() == 1) { |
| 3631 // We only need the allocation site for the case we have a length argument. | 3600 // We only need the allocation site for the case we have a length argument. |
| 3632 // The case may bail out to the runtime, which will determine the correct | 3601 // The case may bail out to the runtime, which will determine the correct |
| 3633 // elements kind with the site. | 3602 // elements kind with the site. |
| (...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5387 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5356 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
| 5388 } | 5357 } |
| 5389 | 5358 |
| 5390 | 5359 |
| 5391 #undef __ | 5360 #undef __ |
| 5392 | 5361 |
| 5393 } // namespace internal | 5362 } // namespace internal |
| 5394 } // namespace v8 | 5363 } // namespace v8 |
| 5395 | 5364 |
| 5396 #endif // V8_TARGET_ARCH_IA32 | 5365 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |