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 2822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2833 __ bind(&no_padding); | 2833 __ bind(&no_padding); |
2834 } | 2834 } |
2835 | 2835 |
2836 EmitReturn(instr, false); | 2836 EmitReturn(instr, false); |
2837 if (no_frame_start != -1) { | 2837 if (no_frame_start != -1) { |
2838 info()->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 2838 info()->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
2839 } | 2839 } |
2840 } | 2840 } |
2841 | 2841 |
2842 | 2842 |
2843 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | |
2844 Register result = ToRegister(instr->result()); | |
2845 __ mov(result, Operand::ForCell(instr->hydrogen()->cell().handle())); | |
2846 if (instr->hydrogen()->RequiresHoleCheck()) { | |
2847 __ cmp(result, factory()->the_hole_value()); | |
2848 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | |
2849 } | |
2850 } | |
2851 | |
2852 | |
2853 template <class T> | 2843 template <class T> |
2854 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2844 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2855 DCHECK(FLAG_vector_ics); | 2845 DCHECK(FLAG_vector_ics); |
2856 Register vector_register = ToRegister(instr->temp_vector()); | 2846 Register vector_register = ToRegister(instr->temp_vector()); |
2857 Register slot_register = VectorLoadICDescriptor::SlotRegister(); | 2847 Register slot_register = VectorLoadICDescriptor::SlotRegister(); |
2858 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); | 2848 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); |
2859 DCHECK(slot_register.is(eax)); | 2849 DCHECK(slot_register.is(eax)); |
2860 | 2850 |
2861 AllowDeferredHandleDereference vector_structure_check; | 2851 AllowDeferredHandleDereference vector_structure_check; |
2862 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2852 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
(...skipping 15 matching lines...) Expand all Loading... |
2878 if (FLAG_vector_ics) { | 2868 if (FLAG_vector_ics) { |
2879 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2869 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2880 } | 2870 } |
2881 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2871 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
2882 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2872 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
2883 PREMONOMORPHIC).code(); | 2873 PREMONOMORPHIC).code(); |
2884 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2874 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2885 } | 2875 } |
2886 | 2876 |
2887 | 2877 |
2888 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | |
2889 Register value = ToRegister(instr->value()); | |
2890 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | |
2891 | |
2892 // If the cell we are storing to contains the hole it could have | |
2893 // been deleted from the property dictionary. In that case, we need | |
2894 // to update the property details in the property dictionary to mark | |
2895 // it as no longer deleted. We deoptimize in that case. | |
2896 if (instr->hydrogen()->RequiresHoleCheck()) { | |
2897 __ cmp(Operand::ForCell(cell_handle), factory()->the_hole_value()); | |
2898 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | |
2899 } | |
2900 | |
2901 // Store the value. | |
2902 __ mov(Operand::ForCell(cell_handle), value); | |
2903 // Cells are always rescanned, so no write barrier here. | |
2904 } | |
2905 | |
2906 | |
2907 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2878 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2908 Register context = ToRegister(instr->context()); | 2879 Register context = ToRegister(instr->context()); |
2909 Register result = ToRegister(instr->result()); | 2880 Register result = ToRegister(instr->result()); |
2910 __ mov(result, ContextOperand(context, instr->slot_index())); | 2881 __ mov(result, ContextOperand(context, instr->slot_index())); |
2911 | 2882 |
2912 if (instr->hydrogen()->RequiresHoleCheck()) { | 2883 if (instr->hydrogen()->RequiresHoleCheck()) { |
2913 __ cmp(result, factory()->the_hole_value()); | 2884 __ cmp(result, factory()->the_hole_value()); |
2914 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2885 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2915 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | 2886 DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
2916 } else { | 2887 } else { |
(...skipping 2864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5781 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5752 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5782 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5753 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5783 } | 5754 } |
5784 | 5755 |
5785 | 5756 |
5786 #undef __ | 5757 #undef __ |
5787 | 5758 |
5788 } } // namespace v8::internal | 5759 } } // namespace v8::internal |
5789 | 5760 |
5790 #endif // V8_TARGET_ARCH_IA32 | 5761 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |