| OLD | NEW | 
|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 | 
| 6 | 6 | 
| 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.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 3656 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3667     ParameterCount count(instr->arity()); | 3667     ParameterCount count(instr->arity()); | 
| 3668     __ InvokeFunction(rdi, no_reg, count, CALL_FUNCTION, generator); | 3668     __ InvokeFunction(rdi, no_reg, count, CALL_FUNCTION, generator); | 
| 3669   } else { | 3669   } else { | 
| 3670     CallKnownFunction(known_function, | 3670     CallKnownFunction(known_function, | 
| 3671                       instr->hydrogen()->formal_parameter_count(), | 3671                       instr->hydrogen()->formal_parameter_count(), | 
| 3672                       instr->arity(), instr); | 3672                       instr->arity(), instr); | 
| 3673   } | 3673   } | 
| 3674 } | 3674 } | 
| 3675 | 3675 | 
| 3676 | 3676 | 
| 3677 void LCodeGen::DoCallFunction(LCallFunction* instr) { |  | 
| 3678   HCallFunction* hinstr = instr->hydrogen(); |  | 
| 3679   DCHECK(ToRegister(instr->context()).is(rsi)); |  | 
| 3680   DCHECK(ToRegister(instr->function()).is(rdi)); |  | 
| 3681   DCHECK(ToRegister(instr->result()).is(rax)); |  | 
| 3682 |  | 
| 3683   int arity = instr->arity(); |  | 
| 3684 |  | 
| 3685   ConvertReceiverMode mode = hinstr->convert_mode(); |  | 
| 3686   if (hinstr->HasVectorAndSlot()) { |  | 
| 3687     Register slot_register = ToRegister(instr->temp_slot()); |  | 
| 3688     Register vector_register = ToRegister(instr->temp_vector()); |  | 
| 3689     DCHECK(slot_register.is(rdx)); |  | 
| 3690     DCHECK(vector_register.is(rbx)); |  | 
| 3691 |  | 
| 3692     AllowDeferredHandleDereference vector_structure_check; |  | 
| 3693     Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |  | 
| 3694     int index = vector->GetIndex(hinstr->slot()); |  | 
| 3695 |  | 
| 3696     __ Move(vector_register, vector); |  | 
| 3697     __ Move(slot_register, Smi::FromInt(index)); |  | 
| 3698 |  | 
| 3699     Handle<Code> ic = |  | 
| 3700         CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |  | 
| 3701     CallCode(ic, RelocInfo::CODE_TARGET, instr); |  | 
| 3702   } else { |  | 
| 3703     __ Set(rax, arity); |  | 
| 3704     CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |  | 
| 3705   } |  | 
| 3706 } |  | 
| 3707 |  | 
| 3708 |  | 
| 3709 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3677 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 
| 3710   DCHECK(ToRegister(instr->context()).is(rsi)); | 3678   DCHECK(ToRegister(instr->context()).is(rsi)); | 
| 3711   DCHECK(ToRegister(instr->constructor()).is(rdi)); | 3679   DCHECK(ToRegister(instr->constructor()).is(rdi)); | 
| 3712   DCHECK(ToRegister(instr->result()).is(rax)); | 3680   DCHECK(ToRegister(instr->result()).is(rax)); | 
| 3713 | 3681 | 
| 3714   __ Set(rax, instr->arity()); | 3682   __ Set(rax, instr->arity()); | 
| 3715   if (instr->arity() == 1) { | 3683   if (instr->arity() == 1) { | 
| 3716     // We only need the allocation site for the case we have a length argument. | 3684     // We only need the allocation site for the case we have a length argument. | 
| 3717     // The case may bail out to the runtime, which will determine the correct | 3685     // The case may bail out to the runtime, which will determine the correct | 
| 3718     // elements kind with the site. | 3686     // elements kind with the site. | 
| (...skipping 1860 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5579   __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context); | 5547   __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), context); | 
| 5580 } | 5548 } | 
| 5581 | 5549 | 
| 5582 | 5550 | 
| 5583 #undef __ | 5551 #undef __ | 
| 5584 | 5552 | 
| 5585 }  // namespace internal | 5553 }  // namespace internal | 
| 5586 }  // namespace v8 | 5554 }  // namespace v8 | 
| 5587 | 5555 | 
| 5588 #endif  // V8_TARGET_ARCH_X64 | 5556 #endif  // V8_TARGET_ARCH_X64 | 
| OLD | NEW | 
|---|