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