| 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/code-stubs.h" | 9 #include "src/code-stubs.h" | 
| 10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" | 
| (...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2987     __ cmp(result, ip); | 2987     __ cmp(result, ip); | 
| 2988     DeoptimizeIf(eq, instr->environment()); | 2988     DeoptimizeIf(eq, instr->environment()); | 
| 2989   } | 2989   } | 
| 2990 } | 2990 } | 
| 2991 | 2991 | 
| 2992 | 2992 | 
| 2993 template <class T> | 2993 template <class T> | 
| 2994 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2994 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 
| 2995   DCHECK(FLAG_vector_ics); | 2995   DCHECK(FLAG_vector_ics); | 
| 2996   Register vector = ToRegister(instr->temp_vector()); | 2996   Register vector = ToRegister(instr->temp_vector()); | 
| 2997   DCHECK(vector.is(LoadIC::VectorRegister())); | 2997   DCHECK(vector.is(FullVectorLoadConvention::VectorRegister())); | 
| 2998   __ Move(vector, instr->hydrogen()->feedback_vector()); | 2998   __ Move(vector, instr->hydrogen()->feedback_vector()); | 
| 2999   // No need to allocate this register. | 2999   // No need to allocate this register. | 
| 3000   DCHECK(LoadIC::SlotRegister().is(r0)); | 3000   DCHECK(FullVectorLoadConvention::SlotRegister().is(r0)); | 
| 3001   __ mov(LoadIC::SlotRegister(), | 3001   __ mov(FullVectorLoadConvention::SlotRegister(), | 
| 3002          Operand(Smi::FromInt(instr->hydrogen()->slot()))); | 3002          Operand(Smi::FromInt(instr->hydrogen()->slot()))); | 
| 3003 } | 3003 } | 
| 3004 | 3004 | 
| 3005 | 3005 | 
| 3006 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 3006 void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { | 
| 3007   DCHECK(ToRegister(instr->context()).is(cp)); | 3007   DCHECK(ToRegister(instr->context()).is(cp)); | 
| 3008   DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); | 3008   DCHECK(ToRegister(instr->global_object()) | 
|  | 3009              .is(LoadConvention::ReceiverRegister())); | 
| 3009   DCHECK(ToRegister(instr->result()).is(r0)); | 3010   DCHECK(ToRegister(instr->result()).is(r0)); | 
| 3010 | 3011 | 
| 3011   __ mov(LoadIC::NameRegister(), Operand(instr->name())); | 3012   __ mov(LoadConvention::NameRegister(), Operand(instr->name())); | 
| 3012   if (FLAG_vector_ics) { | 3013   if (FLAG_vector_ics) { | 
| 3013     EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 3014     EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 
| 3014   } | 3015   } | 
| 3015   ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 3016   ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; | 
| 3016   Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 3017   Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); | 
| 3017   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3018   CallCode(ic, RelocInfo::CODE_TARGET, instr); | 
| 3018 } | 3019 } | 
| 3019 | 3020 | 
| 3020 | 3021 | 
| 3021 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 3022 void LCodeGen::DoStoreGlobalCell(LStoreGlobalCell* instr) { | 
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3120     __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 3121     __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); | 
| 3121     object = result; | 3122     object = result; | 
| 3122   } | 3123   } | 
| 3123   MemOperand operand = FieldMemOperand(object, offset); | 3124   MemOperand operand = FieldMemOperand(object, offset); | 
| 3124   __ Load(result, operand, access.representation()); | 3125   __ Load(result, operand, access.representation()); | 
| 3125 } | 3126 } | 
| 3126 | 3127 | 
| 3127 | 3128 | 
| 3128 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 3129 void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { | 
| 3129   DCHECK(ToRegister(instr->context()).is(cp)); | 3130   DCHECK(ToRegister(instr->context()).is(cp)); | 
| 3130   DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 3131   DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 
| 3131   DCHECK(ToRegister(instr->result()).is(r0)); | 3132   DCHECK(ToRegister(instr->result()).is(r0)); | 
| 3132 | 3133 | 
| 3133   // Name is always in r2. | 3134   // Name is always in r2. | 
| 3134   __ mov(LoadIC::NameRegister(), Operand(instr->name())); | 3135   __ mov(LoadConvention::NameRegister(), Operand(instr->name())); | 
| 3135   if (FLAG_vector_ics) { | 3136   if (FLAG_vector_ics) { | 
| 3136     EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 3137     EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); | 
| 3137   } | 3138   } | 
| 3138   Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 3139   Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); | 
| 3139   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3140   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 
| 3140 } | 3141 } | 
| 3141 | 3142 | 
| 3142 | 3143 | 
| 3143 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 3144 void LCodeGen::DoLoadFunctionPrototype(LLoadFunctionPrototype* instr) { | 
| 3144   Register scratch = scratch0(); | 3145   Register scratch = scratch0(); | 
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3412   } else { | 3413   } else { | 
| 3413     DCHECK_EQ(-1, shift_size); | 3414     DCHECK_EQ(-1, shift_size); | 
| 3414     __ add(scratch0(), base, Operand(key, ASR, 1)); | 3415     __ add(scratch0(), base, Operand(key, ASR, 1)); | 
| 3415     return MemOperand(scratch0(), base_offset); | 3416     return MemOperand(scratch0(), base_offset); | 
| 3416   } | 3417   } | 
| 3417 } | 3418 } | 
| 3418 | 3419 | 
| 3419 | 3420 | 
| 3420 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3421 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 
| 3421   DCHECK(ToRegister(instr->context()).is(cp)); | 3422   DCHECK(ToRegister(instr->context()).is(cp)); | 
| 3422   DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); | 3423   DCHECK(ToRegister(instr->object()).is(LoadConvention::ReceiverRegister())); | 
| 3423   DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); | 3424   DCHECK(ToRegister(instr->key()).is(LoadConvention::NameRegister())); | 
| 3424 | 3425 | 
| 3425   if (FLAG_vector_ics) { | 3426   if (FLAG_vector_ics) { | 
| 3426     EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 3427     EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); | 
| 3427   } | 3428   } | 
| 3428 | 3429 | 
| 3429   Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 3430   Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); | 
| 3430   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 3431   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 
| 3431 } | 3432 } | 
| 3432 | 3433 | 
| 3433 | 3434 | 
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4191                           EMIT_REMEMBERED_SET, | 4192                           EMIT_REMEMBERED_SET, | 
| 4192                           instr->hydrogen()->SmiCheckForWriteBarrier(), | 4193                           instr->hydrogen()->SmiCheckForWriteBarrier(), | 
| 4193                           instr->hydrogen()->PointersToHereCheckForValue()); | 4194                           instr->hydrogen()->PointersToHereCheckForValue()); | 
| 4194     } | 4195     } | 
| 4195   } | 4196   } | 
| 4196 } | 4197 } | 
| 4197 | 4198 | 
| 4198 | 4199 | 
| 4199 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 4200 void LCodeGen::DoStoreNamedGeneric(LStoreNamedGeneric* instr) { | 
| 4200   DCHECK(ToRegister(instr->context()).is(cp)); | 4201   DCHECK(ToRegister(instr->context()).is(cp)); | 
| 4201   DCHECK(ToRegister(instr->object()).is(StoreIC::ReceiverRegister())); | 4202   DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 
| 4202   DCHECK(ToRegister(instr->value()).is(StoreIC::ValueRegister())); | 4203   DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 
| 4203 | 4204 | 
| 4204   __ mov(StoreIC::NameRegister(), Operand(instr->name())); | 4205   __ mov(StoreConvention::NameRegister(), Operand(instr->name())); | 
| 4205   Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 4206   Handle<Code> ic = StoreIC::initialize_stub(isolate(), instr->strict_mode()); | 
| 4206   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4207   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 
| 4207 } | 4208 } | 
| 4208 | 4209 | 
| 4209 | 4210 | 
| 4210 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4211 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 
| 4211   Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4212   Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 
| 4212   if (instr->index()->IsConstantOperand()) { | 4213   if (instr->index()->IsConstantOperand()) { | 
| 4213     Operand index = ToOperand(instr->index()); | 4214     Operand index = ToOperand(instr->index()); | 
| 4214     Register length = ToRegister(instr->length()); | 4215     Register length = ToRegister(instr->length()); | 
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4412   } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4413   } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 
| 4413     DoStoreKeyedFixedDoubleArray(instr); | 4414     DoStoreKeyedFixedDoubleArray(instr); | 
| 4414   } else { | 4415   } else { | 
| 4415     DoStoreKeyedFixedArray(instr); | 4416     DoStoreKeyedFixedArray(instr); | 
| 4416   } | 4417   } | 
| 4417 } | 4418 } | 
| 4418 | 4419 | 
| 4419 | 4420 | 
| 4420 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4421 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 
| 4421   DCHECK(ToRegister(instr->context()).is(cp)); | 4422   DCHECK(ToRegister(instr->context()).is(cp)); | 
| 4422   DCHECK(ToRegister(instr->object()).is(KeyedStoreIC::ReceiverRegister())); | 4423   DCHECK(ToRegister(instr->object()).is(StoreConvention::ReceiverRegister())); | 
| 4423   DCHECK(ToRegister(instr->key()).is(KeyedStoreIC::NameRegister())); | 4424   DCHECK(ToRegister(instr->key()).is(StoreConvention::NameRegister())); | 
| 4424   DCHECK(ToRegister(instr->value()).is(KeyedStoreIC::ValueRegister())); | 4425   DCHECK(ToRegister(instr->value()).is(StoreConvention::ValueRegister())); | 
| 4425 | 4426 | 
| 4426   Handle<Code> ic = instr->strict_mode() == STRICT | 4427   Handle<Code> ic = instr->strict_mode() == STRICT | 
| 4427       ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 4428       ? isolate()->builtins()->KeyedStoreIC_Initialize_Strict() | 
| 4428       : isolate()->builtins()->KeyedStoreIC_Initialize(); | 4429       : isolate()->builtins()->KeyedStoreIC_Initialize(); | 
| 4429   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4430   CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 
| 4430 } | 4431 } | 
| 4431 | 4432 | 
| 4432 | 4433 | 
| 4433 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 4434 void LCodeGen::DoTransitionElementsKind(LTransitionElementsKind* instr) { | 
| 4434   Register object_reg = ToRegister(instr->object()); | 4435   Register object_reg = ToRegister(instr->object()); | 
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5878   __ Push(scope_info); | 5879   __ Push(scope_info); | 
| 5879   __ push(ToRegister(instr->function())); | 5880   __ push(ToRegister(instr->function())); | 
| 5880   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5881   CallRuntime(Runtime::kPushBlockContext, 2, instr); | 
| 5881   RecordSafepoint(Safepoint::kNoLazyDeopt); | 5882   RecordSafepoint(Safepoint::kNoLazyDeopt); | 
| 5882 } | 5883 } | 
| 5883 | 5884 | 
| 5884 | 5885 | 
| 5885 #undef __ | 5886 #undef __ | 
| 5886 | 5887 | 
| 5887 } }  // namespace v8::internal | 5888 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|