| 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 3835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3846 __ CallSelf(); | 3846 __ CallSelf(); |
| 3847 } else { | 3847 } else { |
| 3848 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); | 3848 __ LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); |
| 3849 __ CallJSEntry(ip); | 3849 __ CallJSEntry(ip); |
| 3850 } | 3850 } |
| 3851 | 3851 |
| 3852 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 3852 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
| 3853 } | 3853 } |
| 3854 | 3854 |
| 3855 | 3855 |
| 3856 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
| 3857 HCallFunction* hinstr = instr->hydrogen(); | |
| 3858 DCHECK(ToRegister(instr->context()).is(cp)); | |
| 3859 DCHECK(ToRegister(instr->function()).is(r4)); | |
| 3860 DCHECK(ToRegister(instr->result()).is(r3)); | |
| 3861 | |
| 3862 int arity = instr->arity(); | |
| 3863 ConvertReceiverMode mode = hinstr->convert_mode(); | |
| 3864 if (hinstr->HasVectorAndSlot()) { | |
| 3865 Register slot_register = ToRegister(instr->temp_slot()); | |
| 3866 Register vector_register = ToRegister(instr->temp_vector()); | |
| 3867 DCHECK(slot_register.is(r6)); | |
| 3868 DCHECK(vector_register.is(r5)); | |
| 3869 | |
| 3870 AllowDeferredHandleDereference vector_structure_check; | |
| 3871 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
| 3872 int index = vector->GetIndex(hinstr->slot()); | |
| 3873 | |
| 3874 __ Move(vector_register, vector); | |
| 3875 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | |
| 3876 | |
| 3877 Handle<Code> ic = | |
| 3878 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
| 3879 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
| 3880 } else { | |
| 3881 __ mov(r3, Operand(arity)); | |
| 3882 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
| 3883 } | |
| 3884 } | |
| 3885 | |
| 3886 | |
| 3887 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3856 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
| 3888 DCHECK(ToRegister(instr->context()).is(cp)); | 3857 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3889 DCHECK(ToRegister(instr->constructor()).is(r4)); | 3858 DCHECK(ToRegister(instr->constructor()).is(r4)); |
| 3890 DCHECK(ToRegister(instr->result()).is(r3)); | 3859 DCHECK(ToRegister(instr->result()).is(r3)); |
| 3891 | 3860 |
| 3892 __ mov(r3, Operand(instr->arity())); | 3861 __ mov(r3, Operand(instr->arity())); |
| 3893 if (instr->arity() == 1) { | 3862 if (instr->arity() == 1) { |
| 3894 // We only need the allocation site for the case we have a length argument. | 3863 // We only need the allocation site for the case we have a length argument. |
| 3895 // The case may bail out to the runtime, which will determine the correct | 3864 // The case may bail out to the runtime, which will determine the correct |
| 3896 // elements kind with the site. | 3865 // elements kind with the site. |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5745 | 5714 |
| 5746 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { | 5715 void LCodeGen::DoStoreFrameContext(LStoreFrameContext* instr) { |
| 5747 Register context = ToRegister(instr->context()); | 5716 Register context = ToRegister(instr->context()); |
| 5748 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 5717 __ StoreP(context, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 5749 } | 5718 } |
| 5750 | 5719 |
| 5751 | 5720 |
| 5752 #undef __ | 5721 #undef __ |
| 5753 } // namespace internal | 5722 } // namespace internal |
| 5754 } // namespace v8 | 5723 } // namespace v8 |
| OLD | NEW |