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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 3946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3957 } | 3957 } |
3958 } | 3958 } |
3959 | 3959 |
3960 | 3960 |
3961 void LCodeGen::DoCallFunction(LCallFunction* instr) { | 3961 void LCodeGen::DoCallFunction(LCallFunction* instr) { |
3962 DCHECK(ToRegister(instr->context()).is(esi)); | 3962 DCHECK(ToRegister(instr->context()).is(esi)); |
3963 DCHECK(ToRegister(instr->function()).is(edi)); | 3963 DCHECK(ToRegister(instr->function()).is(edi)); |
3964 DCHECK(ToRegister(instr->result()).is(eax)); | 3964 DCHECK(ToRegister(instr->result()).is(eax)); |
3965 | 3965 |
3966 int arity = instr->arity(); | 3966 int arity = instr->arity(); |
3967 CallFunctionFlags flags = instr->hydrogen()->function_flags(); | 3967 CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); |
3968 if (instr->hydrogen()->HasVectorAndSlot()) { | 3968 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
3969 Register slot_register = ToRegister(instr->temp_slot()); | |
3970 Register vector_register = ToRegister(instr->temp_vector()); | |
3971 DCHECK(slot_register.is(edx)); | |
3972 DCHECK(vector_register.is(ebx)); | |
3973 | |
3974 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
3975 int index = vector->GetIndex(instr->hydrogen()->slot()); | |
3976 | |
3977 __ mov(vector_register, vector); | |
3978 __ mov(slot_register, Immediate(Smi::FromInt(index))); | |
3979 | |
3980 CallICState::CallType call_type = | |
3981 (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; | |
3982 | |
3983 Handle<Code> ic = | |
3984 CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); | |
3985 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3986 } else { | |
3987 CallFunctionStub stub(isolate(), arity, flags); | |
3988 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | |
3989 } | |
3990 } | 3969 } |
3991 | 3970 |
3992 | 3971 |
3993 void LCodeGen::DoCallNew(LCallNew* instr) { | 3972 void LCodeGen::DoCallNew(LCallNew* instr) { |
3994 DCHECK(ToRegister(instr->context()).is(esi)); | 3973 DCHECK(ToRegister(instr->context()).is(esi)); |
3995 DCHECK(ToRegister(instr->constructor()).is(edi)); | 3974 DCHECK(ToRegister(instr->constructor()).is(edi)); |
3996 DCHECK(ToRegister(instr->result()).is(eax)); | 3975 DCHECK(ToRegister(instr->result()).is(eax)); |
3997 | 3976 |
3998 // No cell in ebx for construct type feedback in optimized code | 3977 // No cell in ebx for construct type feedback in optimized code |
3999 __ mov(ebx, isolate()->factory()->undefined_value()); | 3978 __ mov(ebx, isolate()->factory()->undefined_value()); |
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5771 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5750 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5772 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5751 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5773 } | 5752 } |
5774 | 5753 |
5775 | 5754 |
5776 #undef __ | 5755 #undef __ |
5777 | 5756 |
5778 } } // namespace v8::internal | 5757 } } // namespace v8::internal |
5779 | 5758 |
5780 #endif // V8_TARGET_ARCH_IA32 | 5759 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |