| 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 ConvertReceiverMode mode = instr->hydrogen()->convert_mode(); |
| 4054 if (instr->hydrogen()->HasVectorAndSlot()) { | 4055 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 4055 Register slot_register = ToRegister(instr->temp_slot()); | 4056 Register slot_register = ToRegister(instr->temp_slot()); |
| 4056 Register vector_register = ToRegister(instr->temp_vector()); | 4057 Register vector_register = ToRegister(instr->temp_vector()); |
| 4057 DCHECK(slot_register.is(r6)); | 4058 DCHECK(slot_register.is(r6)); |
| 4058 DCHECK(vector_register.is(r5)); | 4059 DCHECK(vector_register.is(r5)); |
| 4059 | 4060 |
| 4060 AllowDeferredHandleDereference vector_structure_check; | 4061 AllowDeferredHandleDereference vector_structure_check; |
| 4061 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 4062 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 4062 int index = vector->GetIndex(instr->hydrogen()->slot()); | 4063 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 4063 | 4064 |
| 4064 __ Move(vector_register, vector); | 4065 __ Move(vector_register, vector); |
| 4065 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); | 4066 __ LoadSmiLiteral(slot_register, Smi::FromInt(index)); |
| 4066 | 4067 |
| 4067 Handle<Code> ic = | 4068 Handle<Code> ic = |
| 4068 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); | 4069 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); |
| 4069 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4070 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4070 } else { | 4071 } else { |
| 4071 __ mov(r3, Operand(arity)); | 4072 __ mov(r3, Operand(arity)); |
| 4072 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); | 4073 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); |
| 4073 } | 4074 } |
| 4074 } | 4075 } |
| 4075 | 4076 |
| 4076 | 4077 |
| 4077 void LCodeGen::DoCallNew(LCallNew* instr) { | 4078 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 4078 DCHECK(ToRegister(instr->context()).is(cp)); | 4079 DCHECK(ToRegister(instr->context()).is(cp)); |
| 4079 DCHECK(ToRegister(instr->constructor()).is(r4)); | 4080 DCHECK(ToRegister(instr->constructor()).is(r4)); |
| 4080 DCHECK(ToRegister(instr->result()).is(r3)); | 4081 DCHECK(ToRegister(instr->result()).is(r3)); |
| 4081 | 4082 |
| 4082 __ mov(r3, Operand(instr->arity())); | 4083 __ mov(r3, Operand(instr->arity())); |
| (...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6061 __ Push(scope_info); | 6062 __ Push(scope_info); |
| 6062 __ push(ToRegister(instr->function())); | 6063 __ push(ToRegister(instr->function())); |
| 6063 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6064 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6064 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6065 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6065 } | 6066 } |
| 6066 | 6067 |
| 6067 | 6068 |
| 6068 #undef __ | 6069 #undef __ |
| 6069 } // namespace internal | 6070 } // namespace internal |
| 6070 } // namespace v8 | 6071 } // namespace v8 |
| OLD | NEW |