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 4033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4044 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); | 4044 RecordSafepointWithLazyDeopt(instr, RECORD_SIMPLE_SAFEPOINT); |
4045 } | 4045 } |
4046 | 4046 |
4047 | 4047 |
4048 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 4048 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
4049 DCHECK(ToRegister(instr->context()).is(cp)); | 4049 DCHECK(ToRegister(instr->context()).is(cp)); |
4050 DCHECK(ToRegister(instr->function()).is(r4)); | 4050 DCHECK(ToRegister(instr->function()).is(r4)); |
4051 DCHECK(ToRegister(instr->result()).is(r3)); | 4051 DCHECK(ToRegister(instr->result()).is(r3)); |
4052 | 4052 |
4053 int arity = instr->arity(); | 4053 int arity = instr->arity(); |
4054 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | |
4055 if (instr->hydrogen()->HasVectorAndSlot()) { | 4054 if (instr->hydrogen()->HasVectorAndSlot()) { |
4056 Register slot_register = ToRegister(instr->temp_slot()); | 4055 Register slot_register = ToRegister(instr->temp_slot()); |
4057 Register vector_register = ToRegister(instr->temp_vector()); | 4056 Register vector_register = ToRegister(instr->temp_vector()); |
4058 DCHECK(slot_register.is(r6)); | 4057 DCHECK(slot_register.is(r6)); |
4059 DCHECK(vector_register.is(r5)); | 4058 DCHECK(vector_register.is(r5)); |
4060 | 4059 |
4061 AllowDeferredHandleDereference vector_structure_check; | 4060 AllowDeferredHandleDereference vector_structure_check; |
4062 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 4061 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
4063 int index = vector->GetIndex(instr->hydrogen()->slot()); | 4062 int index = vector->GetIndex(instr->hydrogen()->slot()); |
4064 | 4063 |
4065 __ Move(vector_register, vector); | 4064 __ Move(vector_register, vector); |
4066 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | 4065 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); |
4067 | 4066 |
4068 CallICState::CallType call_type = | |
4069 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
4070 | |
4071 Handle<Code> ic = | 4067 Handle<Code> ic = |
4072 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | 4068 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); |
4073 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4069 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4074 } else { | 4070 } else { |
4075 CallFunctionStub stub(isolate(), arity, flags); | 4071 __ mov(r3, Operand(arity)); |
4076 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4072 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); |
4077 } | 4073 } |
4078 } | 4074 } |
4079 | 4075 |
4080 | 4076 |
4081 void LCodeGen::DoCallNew(LCallNew* instr) { | 4077 void LCodeGen::DoCallNew(LCallNew* instr) { |
4082 DCHECK(ToRegister(instr->context()).is(cp)); | 4078 DCHECK(ToRegister(instr->context()).is(cp)); |
4083 DCHECK(ToRegister(instr->constructor()).is(r4)); | 4079 DCHECK(ToRegister(instr->constructor()).is(r4)); |
4084 DCHECK(ToRegister(instr->result()).is(r3)); | 4080 DCHECK(ToRegister(instr->result()).is(r3)); |
4085 | 4081 |
4086 __ mov(r3, Operand(instr->arity())); | 4082 __ mov(r3, Operand(instr->arity())); |
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6065 __ Push(scope_info); | 6061 __ Push(scope_info); |
6066 __ push(ToRegister(instr->function())); | 6062 __ push(ToRegister(instr->function())); |
6067 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6063 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6068 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6064 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6069 } | 6065 } |
6070 | 6066 |
6071 | 6067 |
6072 #undef __ | 6068 #undef __ |
6073 } // namespace internal | 6069 } // namespace internal |
6074 } // namespace v8 | 6070 } // namespace v8 |
OLD | NEW |