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 3929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3940 ParameterCount count(instr->arity()); | 3940 ParameterCount count(instr->arity()); |
3941 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); | 3941 __ InvokeFunction(edi, no_reg, count, CALL_FUNCTION, generator); |
3942 } else { | 3942 } else { |
3943 CallKnownFunction(known_function, | 3943 CallKnownFunction(known_function, |
3944 instr->hydrogen()->formal_parameter_count(), | 3944 instr->hydrogen()->formal_parameter_count(), |
3945 instr->arity(), instr); | 3945 instr->arity(), instr); |
3946 } | 3946 } |
3947 } | 3947 } |
3948 | 3948 |
3949 | 3949 |
3950 void LCodeGen::DoCallFunction(LCallFunction* instr) { | |
3951 HCallFunction* hinstr = instr->hydrogen(); | |
3952 DCHECK(ToRegister(instr->context()).is(esi)); | |
3953 DCHECK(ToRegister(instr->function()).is(edi)); | |
3954 DCHECK(ToRegister(instr->result()).is(eax)); | |
3955 | |
3956 int arity = instr->arity(); | |
3957 ConvertReceiverMode mode = hinstr->convert_mode(); | |
3958 if (hinstr->HasVectorAndSlot()) { | |
3959 Register slot_register = ToRegister(instr->temp_slot()); | |
3960 Register vector_register = ToRegister(instr->temp_vector()); | |
3961 DCHECK(slot_register.is(edx)); | |
3962 DCHECK(vector_register.is(ebx)); | |
3963 | |
3964 AllowDeferredHandleDereference vector_structure_check; | |
3965 Handle<TypeFeedbackVector> vector = hinstr->feedback_vector(); | |
3966 int index = vector->GetIndex(hinstr->slot()); | |
3967 | |
3968 __ mov(vector_register, vector); | |
3969 __ mov(slot_register, Immediate(Smi::FromInt(index))); | |
3970 | |
3971 Handle<Code> ic = | |
3972 CodeFactory::CallICInOptimizedCode(isolate(), arity, mode).code(); | |
3973 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3974 } else { | |
3975 __ Set(eax, arity); | |
3976 CallCode(isolate()->builtins()->Call(mode), RelocInfo::CODE_TARGET, instr); | |
3977 } | |
3978 } | |
3979 | |
3980 | |
3981 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { | 3950 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { |
3982 DCHECK(ToRegister(instr->context()).is(esi)); | 3951 DCHECK(ToRegister(instr->context()).is(esi)); |
3983 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3952 DCHECK(ToRegister(instr->constructor()).is(edi)); |
3984 DCHECK(ToRegister(instr->result()).is(eax)); | 3953 DCHECK(ToRegister(instr->result()).is(eax)); |
3985 | 3954 |
3986 __ Move(eax, Immediate(instr->arity())); | 3955 __ Move(eax, Immediate(instr->arity())); |
3987 if (instr->arity() == 1) { | 3956 if (instr->arity() == 1) { |
3988 // We only need the allocation site for the case we have a length argument. | 3957 // We only need the allocation site for the case we have a length argument. |
3989 // The case may bail out to the runtime, which will determine the correct | 3958 // The case may bail out to the runtime, which will determine the correct |
3990 // elements kind with the site. | 3959 // elements kind with the site. |
(...skipping 1961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5952 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); | 5921 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), context); |
5953 } | 5922 } |
5954 | 5923 |
5955 | 5924 |
5956 #undef __ | 5925 #undef __ |
5957 | 5926 |
5958 } // namespace internal | 5927 } // namespace internal |
5959 } // namespace v8 | 5928 } // namespace v8 |
5960 | 5929 |
5961 #endif // V8_TARGET_ARCH_X87 | 5930 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |