| 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 3791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3802 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3802 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
| 3803 } | 3803 } |
| 3804 | 3804 |
| 3805 | 3805 |
| 3806 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3806 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 3807 DCHECK(ToRegister(instr->context()).is(cp)); | 3807 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3808 DCHECK(ToRegister(instr->function()).is(a1)); | 3808 DCHECK(ToRegister(instr->function()).is(a1)); |
| 3809 DCHECK(ToRegister(instr->result()).is(v0)); | 3809 DCHECK(ToRegister(instr->result()).is(v0)); |
| 3810 | 3810 |
| 3811 int arity = instr->arity(); | 3811 int arity = instr->arity(); |
| 3812 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | |
| 3813 if (instr->hydrogen()->HasVectorAndSlot()) { | 3812 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 3814 Register slot_register = ToRegister(instr->temp_slot()); | 3813 Register slot_register = ToRegister(instr->temp_slot()); |
| 3815 Register vector_register = ToRegister(instr->temp_vector()); | 3814 Register vector_register = ToRegister(instr->temp_vector()); |
| 3816 DCHECK(slot_register.is(a3)); | 3815 DCHECK(slot_register.is(a3)); |
| 3817 DCHECK(vector_register.is(a2)); | 3816 DCHECK(vector_register.is(a2)); |
| 3818 | 3817 |
| 3819 AllowDeferredHandleDereference vector_structure_check; | 3818 AllowDeferredHandleDereference vector_structure_check; |
| 3820 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3819 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 3821 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3820 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 3822 | 3821 |
| 3823 __ li(vector_register, vector); | 3822 __ li(vector_register, vector); |
| 3824 __ li(slot_register, Operand(Smi::FromInt(index))); | 3823 __ li(slot_register, Operand(Smi::FromInt(index))); |
| 3825 | 3824 |
| 3826 CallICState::CallType call_type = | |
| 3827 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
| 3828 | |
| 3829 Handle<Code> ic = | 3825 Handle<Code> ic = |
| 3830 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | 3826 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); |
| 3831 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3827 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3832 } else { | 3828 } else { |
| 3833 CallFunctionStub stub(isolate(), arity, flags); | 3829 __ li(a0, Operand(arity)); |
| 3834 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 3830 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); |
| 3835 } | 3831 } |
| 3836 } | 3832 } |
| 3837 | 3833 |
| 3838 | 3834 |
| 3839 void LCodeGen::DoCallNew(LCallNew* instr) { | 3835 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 3840 DCHECK(ToRegister(instr->context()).is(cp)); | 3836 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3841 DCHECK(ToRegister(instr->constructor()).is(a1)); | 3837 DCHECK(ToRegister(instr->constructor()).is(a1)); |
| 3842 DCHECK(ToRegister(instr->result()).is(v0)); | 3838 DCHECK(ToRegister(instr->result()).is(v0)); |
| 3843 | 3839 |
| 3844 __ li(a0, Operand(instr->arity())); | 3840 __ li(a0, Operand(instr->arity())); |
| (...skipping 2003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5848 __ Push(at, ToRegister(instr->function())); | 5844 __ Push(at, ToRegister(instr->function())); |
| 5849 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5845 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5850 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5846 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5851 } | 5847 } |
| 5852 | 5848 |
| 5853 | 5849 |
| 5854 #undef __ | 5850 #undef __ |
| 5855 | 5851 |
| 5856 } // namespace internal | 5852 } // namespace internal |
| 5857 } // namespace v8 | 5853 } // namespace v8 |
| OLD | NEW |