OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3661 | 3661 |
3662 // Load the code entry address | 3662 // Load the code entry address |
3663 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); | 3663 __ lw(at, FieldMemOperand(a1, JSFunction::kCodeEntryOffset)); |
3664 __ Call(at); | 3664 __ Call(at); |
3665 | 3665 |
3666 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3666 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3667 } | 3667 } |
3668 | 3668 |
3669 | 3669 |
3670 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3670 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 3671 HCallFunction* hinstr = instr->hydrogen(); |
3671 DCHECK(ToRegister(instr->context()).is(cp)); | 3672 DCHECK(ToRegister(instr->context()).is(cp)); |
3672 DCHECK(ToRegister(instr->function()).is(a1)); | 3673 DCHECK(ToRegister(instr->function()).is(a1)); |
3673 DCHECK(ToRegister(instr->result()).is(v0)); | 3674 DCHECK(ToRegister(instr->result()).is(v0)); |
3674 | 3675 |
3675 int arity = instr->arity(); | 3676 int arity = instr->arity(); |
3676 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); | 3677 ConvertReceiverMode mode = hinstr->convert_mode(); |
3677 if (instr->hydrogen()->HasVectorAndSlot()) { | 3678 TailCallMode tail_call_mode = hinstr->tail_call_mode(); |
| 3679 if (hinstr->HasVectorAndSlot()) { |
3678 Register slot_register = ToRegister(instr->temp_slot()); | 3680 Register slot_register = ToRegister(instr->temp_slot()); |
3679 Register vector_register = ToRegister(instr->temp_vector()); | 3681 Register vector_register = ToRegister(instr->temp_vector()); |
3680 DCHECK(slot_register.is(a3)); | 3682 DCHECK(slot_register.is(a3)); |
3681 DCHECK(vector_register.is(a2)); | 3683 DCHECK(vector_register.is(a2)); |
3682 | 3684 |
3683 AllowDeferredHandleDereference vector_structure_check; | 3685 AllowDeferredHandleDereference vector_structure_check; |
3684 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3686 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |
3685 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3687 int index = vector->GetIndex(hinstr->slot()); |
3686 | 3688 |
3687 __ li(vector_register, vector); | 3689 __ li(vector_register, vector); |
3688 __ li(slot_register, Operand(Smi::FromInt(index))); | 3690 __ li(slot_register, Operand(Smi::FromInt(index))); |
3689 | 3691 |
3690 Handle<Code> ic = | 3692 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode, |
3691 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 3693 tail_call_mode) |
| 3694 .code(); |
3692 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3695 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3693 } else { | 3696 } else { |
3694 __ li(a0, Operand(arity)); | 3697 __ li(a0, Operand(arity)); |
3695 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 3698 CallCode(isolate()->builtins()->Call(mode, tail_call_mode), |
| 3699 RelocInfo::CODE_TARGET, instr); |
3696 } | 3700 } |
3697 } | 3701 } |
3698 | 3702 |
3699 | 3703 |
3700 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3704 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3701 DCHECK(ToRegister(instr->context()).is(cp)); | 3705 DCHECK(ToRegister(instr->context()).is(cp)); |
3702 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3706 DCHECK(ToRegister(instr->constructor()).is(a1)); |
3703 DCHECK(ToRegister(instr->result()).is(v0)); | 3707 DCHECK(ToRegister(instr->result()).is(v0)); |
3704 | 3708 |
3705 __ li(a0, Operand(instr->arity())); | 3709 __ li(a0, Operand(instr->arity())); |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5595 __ Push(at, ToRegister(instr->function())); | 5599 __ Push(at, ToRegister(instr->function())); |
5596 CallRuntime(Runtime::kPushBlockContext, instr); | 5600 CallRuntime(Runtime::kPushBlockContext, instr); |
5597 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5601 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5598 } | 5602 } |
5599 | 5603 |
5600 | 5604 |
5601 #undef __ | 5605 #undef __ |
5602 | 5606 |
5603 } // namespace internal | 5607 } // namespace internal |
5604 } // namespace v8 | 5608 } // namespace v8 |
OLD | NEW |