| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ppc/lithium-codegen-ppc.h" | 5 #include "src/crankshaft/ppc/lithium-codegen-ppc.h" |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
| (...skipping 3909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3920 } else { | 3920 } else { |
| 3921 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | 3921 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); |
| 3922 __ CallJSEntry(ip); | 3922 __ CallJSEntry(ip); |
| 3923 } | 3923 } |
| 3924 | 3924 |
| 3925 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3925 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
| 3926 } | 3926 } |
| 3927 | 3927 |
| 3928 | 3928 |
| 3929 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3929 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 3930 HCallFunction* hinstr = instr->hydrogen(); |
| 3930 DCHECK(ToRegister(instr->context()).is(cp)); | 3931 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3931 DCHECK(ToRegister(instr->function()).is(r4)); | 3932 DCHECK(ToRegister(instr->function()).is(r4)); |
| 3932 DCHECK(ToRegister(instr->result()).is(r3)); | 3933 DCHECK(ToRegister(instr->result()).is(r3)); |
| 3933 | 3934 |
| 3934 int arity = instr->arity(); | 3935 int arity = instr->arity(); |
| 3935 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); | 3936 ConvertReceiverMode mode = hinstr->convert_mode(); |
| 3936 if (instr->hydrogen()->HasVectorAndSlot()) { | 3937 TailCallMode tail_call_mode = hinstr->tail_call_mode(); |
| 3938 if (hinstr->HasVectorAndSlot()) { |
| 3937 Register slot_register = ToRegister(instr->temp_slot()); | 3939 Register slot_register = ToRegister(instr->temp_slot()); |
| 3938 Register vector_register = ToRegister(instr->temp_vector()); | 3940 Register vector_register = ToRegister(instr->temp_vector()); |
| 3939 DCHECK(slot_register.is(r6)); | 3941 DCHECK(slot_register.is(r6)); |
| 3940 DCHECK(vector_register.is(r5)); | 3942 DCHECK(vector_register.is(r5)); |
| 3941 | 3943 |
| 3942 AllowDeferredHandleDereference vector_structure_check; | 3944 AllowDeferredHandleDereference vector_structure_check; |
| 3943 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 3945 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); |
| 3944 int index = vector->GetIndex(instr->hydrogen()->slot()); | 3946 int index = vector->GetIndex(hinstr->slot()); |
| 3945 | 3947 |
| 3946 __ Move(vector_register, vector); | 3948 __ Move(vector_register, vector); |
| 3947 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | 3949 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); |
| 3948 | 3950 |
| 3949 Handle<Code> ic = | 3951 Handle<Code> ic = CodeFactory::CallICInOptimizedCode(isolate(), arity, mode, |
| 3950 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | 3952 tail_call_mode) |
| 3953 .code(); |
| 3951 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3954 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3952 } else { | 3955 } else { |
| 3953 __ mov(r3, Operand(arity)); | 3956 __ mov(r3, Operand(arity)); |
| 3954 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | 3957 CallCode(isolate()->builtins()->Call(mode, tail_call_mode), |
| 3958 RelocInfo::CODE_TARGET, instr); |
| 3955 } | 3959 } |
| 3956 } | 3960 } |
| 3957 | 3961 |
| 3958 | 3962 |
| 3959 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3963 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3960 DCHECK(ToRegister(instr->context()).is(cp)); | 3964 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3961 DCHECK(ToRegister(instr->constructor()).is(r4)); | 3965 DCHECK(ToRegister(instr->constructor()).is(r4)); |
| 3962 DCHECK(ToRegister(instr->result()).is(r3)); | 3966 DCHECK(ToRegister(instr->result()).is(r3)); |
| 3963 | 3967 |
| 3964 __ mov(r3, Operand(instr->arity())); | 3968 __ mov(r3, Operand(instr->arity())); |
| (...skipping 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5846 __ Push(scope_info); | 5850 __ Push(scope_info); |
| 5847 __ push(ToRegister(instr->function())); | 5851 __ push(ToRegister(instr->function())); |
| 5848 CallRuntime(Runtime::kPushBlockContext, instr); | 5852 CallRuntime(Runtime::kPushBlockContext, instr); |
| 5849 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5853 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5850 } | 5854 } |
| 5851 | 5855 |
| 5852 | 5856 |
| 5853 #undef __ | 5857 #undef __ |
| 5854 } // namespace internal | 5858 } // namespace internal |
| 5855 } // namespace v8 | 5859 } // namespace v8 |
| OLD | NEW |