OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/crankshaft/hydrogen-osr.h" | 9 #include "src/crankshaft/hydrogen-osr.h" |
10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" | 10 #include "src/crankshaft/mips64/lithium-gap-resolver-mips64.h" |
(...skipping 3961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3972 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3972 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
3973 } | 3973 } |
3974 | 3974 |
3975 | 3975 |
3976 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3976 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3977 DCHECK(ToRegister(instr->context()).is(cp)); | 3977 DCHECK(ToRegister(instr->context()).is(cp)); |
3978 DCHECK(ToRegister(instr->function()).is(a1)); | 3978 DCHECK(ToRegister(instr->function()).is(a1)); |
3979 DCHECK(ToRegister(instr->result()).is(v0)); | 3979 DCHECK(ToRegister(instr->result()).is(v0)); |
3980 | 3980 |
3981 int arity = instr->arity(); | 3981 int arity = instr->arity(); |
| 3982 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); |
3982 if (instr->hydrogen()->HasVectorAndSlot()) { | 3983 if (instr->hydrogen()->HasVectorAndSlot()) { |
3983 Register slot_register = ToRegister(instr->temp_slot()); | 3984 Register slot_register = ToRegister(instr->temp_slot()); |
3984 Register vector_register = ToRegister(instr->temp_vector()); | 3985 Register vector_register = ToRegister(instr->temp_vector()); |
3985 DCHECK(slot_register.is(a3)); | 3986 DCHECK(slot_register.is(a3)); |
3986 DCHECK(vector_register.is(a2)); | 3987 DCHECK(vector_register.is(a2)); |
3987 | 3988 |
3988 AllowDeferredHandleDereference vector_structure_check; | 3989 AllowDeferredHandleDereference vector_structure_check; |
3989 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3990 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
3990 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3991 int index = vector->GetIndex(instr->hydrogen()->slot()); |
3991 | 3992 |
3992 __ li(vector_register, vector); | 3993 __ li(vector_register, vector); |
3993 __ li(slot_register, Operand(Smi::FromInt(index))); | 3994 __ li(slot_register, Operand(Smi::FromInt(index))); |
3994 | 3995 |
3995 Handle<Code> ic = | 3996 Handle<Code> ic = |
3996 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); | 3997 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
3997 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3998 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
3998 } else { | 3999 } else { |
3999 __ li(a0, Operand(arity)); | 4000 __ li(a0, Operand(arity)); |
4000 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); | 4001 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
4001 } | 4002 } |
4002 } | 4003 } |
4003 | 4004 |
4004 | 4005 |
4005 void LCodeGen::DoCallNew(LCallNew* instr) { | 4006 void LCodeGen::DoCallNew(LCallNew* instr) { |
4006 DCHECK(ToRegister(instr->context()).is(cp)); | 4007 DCHECK(ToRegister(instr->context()).is(cp)); |
4007 DCHECK(ToRegister(instr->constructor()).is(a1)); | 4008 DCHECK(ToRegister(instr->constructor()).is(a1)); |
4008 DCHECK(ToRegister(instr->result()).is(v0)); | 4009 DCHECK(ToRegister(instr->result()).is(v0)); |
4009 | 4010 |
4010 __ li(a0, Operand(instr->arity())); | 4011 __ li(a0, Operand(instr->arity())); |
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6011 __ Push(at, ToRegister(instr->function())); | 6012 __ Push(at, ToRegister(instr->function())); |
6012 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6013 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6013 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6014 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6014 } | 6015 } |
6015 | 6016 |
6016 | 6017 |
6017 #undef __ | 6018 #undef __ |
6018 | 6019 |
6019 } // namespace internal | 6020 } // namespace internal |
6020 } // namespace v8 | 6021 } // namespace v8 |
OLD | NEW |