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 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 } | 2652 } |
2653 if (NeedsEagerFrame()) { | 2653 if (NeedsEagerFrame()) { |
2654 __ mov(esp, ebp); | 2654 __ mov(esp, ebp); |
2655 __ pop(ebp); | 2655 __ pop(ebp); |
2656 } | 2656 } |
2657 | 2657 |
2658 EmitReturn(instr); | 2658 EmitReturn(instr); |
2659 } | 2659 } |
2660 | 2660 |
2661 | 2661 |
2662 template <class T> | |
2663 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | |
2664 Register vector_register = ToRegister(instr->temp_vector()); | |
2665 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); | |
2666 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | |
2667 DCHECK(slot_register.is(eax)); | |
2668 | |
2669 AllowDeferredHandleDereference vector_structure_check; | |
2670 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | |
2671 __ mov(vector_register, vector); | |
2672 // No need to allocate this register. | |
2673 FeedbackVectorSlot slot = instr->hydrogen()->slot(); | |
2674 int index = vector->GetIndex(slot); | |
2675 __ mov(slot_register, Immediate(Smi::FromInt(index))); | |
2676 } | |
2677 | |
2678 | |
2679 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2662 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2680 Register context = ToRegister(instr->context()); | 2663 Register context = ToRegister(instr->context()); |
2681 Register result = ToRegister(instr->result()); | 2664 Register result = ToRegister(instr->result()); |
2682 __ mov(result, ContextOperand(context, instr->slot_index())); | 2665 __ mov(result, ContextOperand(context, instr->slot_index())); |
2683 | 2666 |
2684 if (instr->hydrogen()->RequiresHoleCheck()) { | 2667 if (instr->hydrogen()->RequiresHoleCheck()) { |
2685 __ cmp(result, factory()->the_hole_value()); | 2668 __ cmp(result, factory()->the_hole_value()); |
2686 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2669 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2687 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); | 2670 DeoptimizeIf(equal, instr, DeoptimizeReason::kHole); |
2688 } else { | 2671 } else { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2984 } | 2967 } |
2985 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); | 2968 ScaleFactor scale_factor = static_cast<ScaleFactor>(shift_size); |
2986 return Operand(elements_pointer_reg, | 2969 return Operand(elements_pointer_reg, |
2987 ToRegister(key), | 2970 ToRegister(key), |
2988 scale_factor, | 2971 scale_factor, |
2989 base_offset); | 2972 base_offset); |
2990 } | 2973 } |
2991 } | 2974 } |
2992 | 2975 |
2993 | 2976 |
2994 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | |
2995 DCHECK(ToRegister(instr->context()).is(esi)); | |
2996 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | |
2997 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | |
2998 | |
2999 EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | |
3000 | |
3001 Handle<Code> ic = CodeFactory::KeyedLoadICInOptimizedCode(isolate()).code(); | |
3002 CallCode(ic, RelocInfo::CODE_TARGET, instr); | |
3003 } | |
3004 | |
3005 | |
3006 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { | 2977 void LCodeGen::DoArgumentsElements(LArgumentsElements* instr) { |
3007 Register result = ToRegister(instr->result()); | 2978 Register result = ToRegister(instr->result()); |
3008 | 2979 |
3009 if (instr->hydrogen()->from_inlined()) { | 2980 if (instr->hydrogen()->from_inlined()) { |
3010 __ lea(result, Operand(esp, -2 * kPointerSize)); | 2981 __ lea(result, Operand(esp, -2 * kPointerSize)); |
3011 } else if (instr->hydrogen()->arguments_adaptor()) { | 2982 } else if (instr->hydrogen()->arguments_adaptor()) { |
3012 // Check for arguments adapter frame. | 2983 // Check for arguments adapter frame. |
3013 Label done, adapted; | 2984 Label done, adapted; |
3014 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 2985 __ mov(result, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
3015 __ mov(result, | 2986 __ mov(result, |
(...skipping 2684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5700 __ bind(deferred->exit()); | 5671 __ bind(deferred->exit()); |
5701 __ bind(&done); | 5672 __ bind(&done); |
5702 } | 5673 } |
5703 | 5674 |
5704 #undef __ | 5675 #undef __ |
5705 | 5676 |
5706 } // namespace internal | 5677 } // namespace internal |
5707 } // namespace v8 | 5678 } // namespace v8 |
5708 | 5679 |
5709 #endif // V8_TARGET_ARCH_X87 | 5680 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |