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 3773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3784 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3784 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3785 } | 3785 } |
3786 | 3786 |
3787 | 3787 |
3788 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3788 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3789 DCHECK(ToRegister(instr->context()).is(cp)); | 3789 DCHECK(ToRegister(instr->context()).is(cp)); |
3790 DCHECK(ToRegister(instr->function()).is(a1)); | 3790 DCHECK(ToRegister(instr->function()).is(a1)); |
3791 DCHECK(ToRegister(instr->result()).is(v0)); | 3791 DCHECK(ToRegister(instr->result()).is(v0)); |
3792 | 3792 |
3793 int arity = instr->arity(); | 3793 int arity = instr->arity(); |
| 3794 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); |
3794 if (instr->hydrogen()->HasVectorAndSlot()) { | 3795 if (instr->hydrogen()->HasVectorAndSlot()) { |
3795 Register slot_register = ToRegister(instr->temp_slot()); | 3796 Register slot_register = ToRegister(instr->temp_slot()); |
3796 Register vector_register = ToRegister(instr->temp_vector()); | 3797 Register vector_register = ToRegister(instr->temp_vector()); |
3797 DCHECK(slot_register.is(a3)); | 3798 DCHECK(slot_register.is(a3)); |
3798 DCHECK(vector_register.is(a2)); | 3799 DCHECK(vector_register.is(a2)); |
3799 | 3800 |
3800 AllowDeferredHandleDereference vector_structure_check; | 3801 AllowDeferredHandleDereference vector_structure_check; |
3801 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3802 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3802 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3803 int index = vector->GetIndex(instr->hydrogen()->slot()); |
3803 | 3804 |
3804 __ li(vector_register, vector); | 3805 __ li(vector_register, vector); |
3805 __ li(slot_register, Operand(Smi::FromInt(index))); | 3806 __ li(slot_register, Operand(Smi::FromInt(index))); |
3806 | 3807 |
3807 Handle<Code> ic = | 3808 Handle<Code> ic = |
3808 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); | 3809 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3809 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3810 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3810 } else { | 3811 } else { |
3811 __ li(a0, Operand(arity)); | 3812 __ li(a0, Operand(arity)); |
3812 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); | 3813 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
3813 } | 3814 } |
3814 } | 3815 } |
3815 | 3816 |
3816 | 3817 |
3817 void LCodeGen::DoCallNew(LCallNew* instr) { | 3818 void LCodeGen::DoCallNew(LCallNew* instr) { |
3818 DCHECK(ToRegister(instr->context()).is(cp)); | 3819 DCHECK(ToRegister(instr->context()).is(cp)); |
3819 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3820 DCHECK(ToRegister(instr->constructor()).is(a1)); |
3820 DCHECK(ToRegister(instr->result()).is(v0)); | 3821 DCHECK(ToRegister(instr->result()).is(v0)); |
3821 | 3822 |
3822 __ li(a0, Operand(instr->arity())); | 3823 __ li(a0, Operand(instr->arity())); |
(...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5826 __ Push(at, ToRegister(instr->function())); | 5827 __ Push(at, ToRegister(instr->function())); |
5827 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5828 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5828 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5829 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5829 } | 5830 } |
5830 | 5831 |
5831 | 5832 |
5832 #undef __ | 5833 #undef __ |
5833 | 5834 |
5834 } // namespace internal | 5835 } // namespace internal |
5835 } // namespace v8 | 5836 } // namespace v8 |
OLD | NEW |