| 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 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| (...skipping 4163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4174 } | 4174 } |
| 4175 } | 4175 } |
| 4176 | 4176 |
| 4177 | 4177 |
| 4178 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 4178 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
| 4179 DCHECK(ToRegister(instr->context()).is(esi)); | 4179 DCHECK(ToRegister(instr->context()).is(esi)); |
| 4180 DCHECK(ToRegister(instr->function()).is(edi)); | 4180 DCHECK(ToRegister(instr->function()).is(edi)); |
| 4181 DCHECK(ToRegister(instr->result()).is(eax)); | 4181 DCHECK(ToRegister(instr->result()).is(eax)); |
| 4182 | 4182 |
| 4183 int arity = instr->arity(); | 4183 int arity = instr->arity(); |
| 4184 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | |
| 4185 if (instr->hydrogen()->HasVectorAndSlot()) { | 4184 if (instr->hydrogen()->HasVectorAndSlot()) { |
| 4186 Register slot_register = ToRegister(instr->temp_slot()); | 4185 Register slot_register = ToRegister(instr->temp_slot()); |
| 4187 Register vector_register = ToRegister(instr->temp_vector()); | 4186 Register vector_register = ToRegister(instr->temp_vector()); |
| 4188 DCHECK(slot_register.is(edx)); | 4187 DCHECK(slot_register.is(edx)); |
| 4189 DCHECK(vector_register.is(ebx)); | 4188 DCHECK(vector_register.is(ebx)); |
| 4190 | 4189 |
| 4191 AllowDeferredHandleDereference vector_structure_check; | 4190 AllowDeferredHandleDereference vector_structure_check; |
| 4192 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 4191 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| 4193 int index = vector->GetIndex(instr->hydrogen()->slot()); | 4192 int index = vector->GetIndex(instr->hydrogen()->slot()); |
| 4194 | 4193 |
| 4195 __ mov(vector_register, vector); | 4194 __ mov(vector_register, vector); |
| 4196 __ mov(slot_register, Immediate(Smi::FromInt(index))); | 4195 __ mov(slot_register, Immediate(Smi::FromInt(index))); |
| 4197 | 4196 |
| 4198 CallICState::CallType call_type = | |
| 4199 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
| 4200 | |
| 4201 Handle<Code> ic = | 4197 Handle<Code> ic = |
| 4202 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | 4198 CodeFactory::CallICInOptimizedCode(isolate(), arity).code(); |
| 4203 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4199 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4204 } else { | 4200 } else { |
| 4205 CallFunctionStub stub(isolate(), arity, flags); | 4201 __ Set(eax, arity); |
| 4206 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4202 CallCode(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET, instr); |
| 4207 } | 4203 } |
| 4208 } | 4204 } |
| 4209 | 4205 |
| 4210 | 4206 |
| 4211 void LCodeGen::DoCallNew(LCallNew* instr) { | 4207 void LCodeGen::DoCallNew(LCallNew* instr) { |
| 4212 DCHECK(ToRegister(instr->context()).is(esi)); | 4208 DCHECK(ToRegister(instr->context()).is(esi)); |
| 4213 DCHECK(ToRegister(instr->constructor()).is(edi)); | 4209 DCHECK(ToRegister(instr->constructor()).is(edi)); |
| 4214 DCHECK(ToRegister(instr->result()).is(eax)); | 4210 DCHECK(ToRegister(instr->result()).is(eax)); |
| 4215 | 4211 |
| 4216 // No cell in ebx for construct type feedback in optimized code | 4212 // No cell in ebx for construct type feedback in optimized code |
| (...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6288 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6284 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6289 } | 6285 } |
| 6290 | 6286 |
| 6291 | 6287 |
| 6292 #undef __ | 6288 #undef __ |
| 6293 | 6289 |
| 6294 } // namespace internal | 6290 } // namespace internal |
| 6295 } // namespace v8 | 6291 } // namespace v8 |
| 6296 | 6292 |
| 6297 #endif // V8_TARGET_ARCH_X87 | 6293 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |