| 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 2845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2856 __ bind(&no_padding); | 2856 __ bind(&no_padding); |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 EmitReturn(instr, false); | 2859 EmitReturn(instr, false); |
| 2860 if (no_frame_start != -1) { | 2860 if (no_frame_start != -1) { |
| 2861 info()->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 2861 info()->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 2862 } | 2862 } |
| 2863 } | 2863 } |
| 2864 | 2864 |
| 2865 | 2865 |
| 2866 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | |
| 2867 Register result = ToRegister(instr->result()); | |
| 2868 __ mov(result, Operand::ForCell(instr->hydrogen()->cell().handle())); | |
| 2869 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 2870 __ cmp(result, factory()->the_hole_value()); | |
| 2871 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | |
| 2872 } | |
| 2873 } | |
| 2874 | |
| 2875 | |
| 2876 template <class T> | 2866 template <class T> |
| 2877 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2867 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
| 2878 DCHECK(FLAG_vector_ics); | 2868 DCHECK(FLAG_vector_ics); |
| 2879 Register vector_register = ToRegister(instr->temp_vector()); | 2869 Register vector_register = ToRegister(instr->temp_vector()); |
| 2880 Register slot_register = VectorLoadICDescriptor::SlotRegister(); | 2870 Register slot_register = VectorLoadICDescriptor::SlotRegister(); |
| 2881 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); | 2871 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); |
| 2882 DCHECK(slot_register.is(eax)); | 2872 DCHECK(slot_register.is(eax)); |
| 2883 | 2873 |
| 2884 AllowDeferredHandleDereference vector_structure_check; | 2874 AllowDeferredHandleDereference vector_structure_check; |
| 2885 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2875 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 2901 if (FLAG_vector_ics) { | 2891 if (FLAG_vector_ics) { |
| 2902 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2892 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 2903 } | 2893 } |
| 2904 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 2894 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 2905 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 2895 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 2906 PREMONOMORPHIC).code(); | 2896 PREMONOMORPHIC).code(); |
| 2907 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2897 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 2908 } | 2898 } |
| 2909 | 2899 |
| 2910 | 2900 |
| 2911 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | |
| 2912 Register value = ToRegister(instr->value()); | |
| 2913 Handle<PropertyCell> cell_handle = instr->hydrogen()->cell().handle(); | |
| 2914 | |
| 2915 // If the cell we are storing to contains the hole it could have | |
| 2916 // been deleted from the property dictionary. In that case, we need | |
| 2917 // to update the property details in the property dictionary to mark | |
| 2918 // it as no longer deleted. We deoptimize in that case. | |
| 2919 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 2920 __ cmp(Operand::ForCell(cell_handle), factory()->the_hole_value()); | |
| 2921 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | |
| 2922 } | |
| 2923 | |
| 2924 // Store the value. | |
| 2925 __ mov(Operand::ForCell(cell_handle), value); | |
| 2926 // Cells are always rescanned, so no write barrier here. | |
| 2927 } | |
| 2928 | |
| 2929 | |
| 2930 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2901 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 2931 Register context = ToRegister(instr->context()); | 2902 Register context = ToRegister(instr->context()); |
| 2932 Register result = ToRegister(instr->result()); | 2903 Register result = ToRegister(instr->result()); |
| 2933 __ mov(result, ContextOperand(context, instr->slot_index())); | 2904 __ mov(result, ContextOperand(context, instr->slot_index())); |
| 2934 | 2905 |
| 2935 if (instr->hydrogen()->RequiresHoleCheck()) { | 2906 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2936 __ cmp(result, factory()->the_hole_value()); | 2907 __ cmp(result, factory()->the_hole_value()); |
| 2937 if (instr->hydrogen()->DeoptimizesOnHole()) { | 2908 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2938 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | 2909 DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
| 2939 } else { | 2910 } else { |
| (...skipping 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5796 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5767 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5797 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5768 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5798 } | 5769 } |
| 5799 | 5770 |
| 5800 | 5771 |
| 5801 #undef __ | 5772 #undef __ |
| 5802 | 5773 |
| 5803 } } // namespace v8::internal | 5774 } } // namespace v8::internal |
| 5804 | 5775 |
| 5805 #endif // V8_TARGET_ARCH_IA32 | 5776 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |