| 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 #include "src/arm/lithium-codegen-arm.h" | 7 #include "src/arm/lithium-codegen-arm.h" |
| 8 #include "src/arm/lithium-gap-resolver-arm.h" | 8 #include "src/arm/lithium-gap-resolver-arm.h" |
| 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 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2972 | 2972 |
| 2973 __ Jump(lr); | 2973 __ Jump(lr); |
| 2974 | 2974 |
| 2975 if (no_frame_start != -1) { | 2975 if (no_frame_start != -1) { |
| 2976 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | 2976 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); |
| 2977 } | 2977 } |
| 2978 } | 2978 } |
| 2979 } | 2979 } |
| 2980 | 2980 |
| 2981 | 2981 |
| 2982 void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { | |
| 2983 Register result = ToRegister(instr->result()); | |
| 2984 __ mov(ip, Operand(Handle<Object>(instr->hydrogen()->cell().handle()))); | |
| 2985 __ ldr(result, FieldMemOperand(ip, Cell::kValueOffset)); | |
| 2986 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 2987 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | |
| 2988 __ cmp(result, ip); | |
| 2989 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | |
| 2990 } | |
| 2991 } | |
| 2992 | |
| 2993 | |
| 2994 template <class T> | 2982 template <class T> |
| 2995 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2983 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
| 2996 DCHECK(FLAG_vector_ics); | 2984 DCHECK(FLAG_vector_ics); |
| 2997 Register vector_register = ToRegister(instr->temp_vector()); | 2985 Register vector_register = ToRegister(instr->temp_vector()); |
| 2998 Register slot_register = VectorLoadICDescriptor::SlotRegister(); | 2986 Register slot_register = VectorLoadICDescriptor::SlotRegister(); |
| 2999 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); | 2987 DCHECK(vector_register.is(VectorLoadICDescriptor::VectorRegister())); |
| 3000 DCHECK(slot_register.is(r0)); | 2988 DCHECK(slot_register.is(r0)); |
| 3001 | 2989 |
| 3002 AllowDeferredHandleDereference vector_structure_check; | 2990 AllowDeferredHandleDereference vector_structure_check; |
| 3003 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); | 2991 Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3019 if (FLAG_vector_ics) { | 3007 if (FLAG_vector_ics) { |
| 3020 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3008 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
| 3021 } | 3009 } |
| 3022 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3010 ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
| 3023 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, | 3011 Handle<Code> ic = CodeFactory::LoadICInOptimizedCode(isolate(), mode, |
| 3024 PREMONOMORPHIC).code(); | 3012 PREMONOMORPHIC).code(); |
| 3025 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3013 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3026 } | 3014 } |
| 3027 | 3015 |
| 3028 | 3016 |
| 3029 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | |
| 3030 Register value = ToRegister(instr->value()); | |
| 3031 Register cell = scratch0(); | |
| 3032 | |
| 3033 // Load the cell. | |
| 3034 __ mov(cell, Operand(instr->hydrogen()->cell().handle())); | |
| 3035 | |
| 3036 // If the cell we are storing to contains the hole it could have | |
| 3037 // been deleted from the property dictionary. In that case, we need | |
| 3038 // to update the property details in the property dictionary to mark | |
| 3039 // it as no longer deleted. | |
| 3040 if (instr->hydrogen()->RequiresHoleCheck()) { | |
| 3041 // We use a temp to check the payload (CompareRoot might clobber ip). | |
| 3042 Register payload = ToRegister(instr->temp()); | |
| 3043 __ ldr(payload, FieldMemOperand(cell, Cell::kValueOffset)); | |
| 3044 __ CompareRoot(payload, Heap::kTheHoleValueRootIndex); | |
| 3045 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | |
| 3046 } | |
| 3047 | |
| 3048 // Store the value. | |
| 3049 __ str(value, FieldMemOperand(cell, Cell::kValueOffset)); | |
| 3050 // Cells are always rescanned, so no write barrier here. | |
| 3051 } | |
| 3052 | |
| 3053 | |
| 3054 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3017 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| 3055 Register context = ToRegister(instr->context()); | 3018 Register context = ToRegister(instr->context()); |
| 3056 Register result = ToRegister(instr->result()); | 3019 Register result = ToRegister(instr->result()); |
| 3057 __ ldr(result, ContextOperand(context, instr->slot_index())); | 3020 __ ldr(result, ContextOperand(context, instr->slot_index())); |
| 3058 if (instr->hydrogen()->RequiresHoleCheck()) { | 3021 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 3059 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 3022 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
| 3060 __ cmp(result, ip); | 3023 __ cmp(result, ip); |
| 3061 if (instr->hydrogen()->DeoptimizesOnHole()) { | 3024 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 3062 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | 3025 DeoptimizeIf(eq, instr, Deoptimizer::kHole); |
| 3063 } else { | 3026 } else { |
| (...skipping 2906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5970 __ Push(scope_info); | 5933 __ Push(scope_info); |
| 5971 __ push(ToRegister(instr->function())); | 5934 __ push(ToRegister(instr->function())); |
| 5972 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5935 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 5973 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5936 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 5974 } | 5937 } |
| 5975 | 5938 |
| 5976 | 5939 |
| 5977 #undef __ | 5940 #undef __ |
| 5978 | 5941 |
| 5979 } } // namespace v8::internal | 5942 } } // namespace v8::internal |
| OLD | NEW |