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 2965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2976 | 2976 |
2977 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2977 __ mov(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2978 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2978 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2979 Handle<Code> ic = | 2979 Handle<Code> ic = |
2980 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2980 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
2981 SLOPPY, PREMONOMORPHIC).code(); | 2981 SLOPPY, PREMONOMORPHIC).code(); |
2982 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2982 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2983 } | 2983 } |
2984 | 2984 |
2985 | 2985 |
| 2986 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
| 2987 DCHECK(ToRegister(instr->context()).is(cp)); |
| 2988 DCHECK(ToRegister(instr->result()).is(r0)); |
| 2989 |
| 2990 __ mov(LoadGlobalViaContextDescriptor::DepthRegister(), |
| 2991 Operand(Smi::FromInt(instr->depth()))); |
| 2992 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), |
| 2993 Operand(Smi::FromInt(instr->slot_index()))); |
| 2994 __ mov(LoadGlobalViaContextDescriptor::NameRegister(), |
| 2995 Operand(instr->name())); |
| 2996 |
| 2997 Handle<Code> stub = |
| 2998 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code(); |
| 2999 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
| 3000 } |
| 3001 |
| 3002 |
2986 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3003 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2987 Register context = ToRegister(instr->context()); | 3004 Register context = ToRegister(instr->context()); |
2988 Register result = ToRegister(instr->result()); | 3005 Register result = ToRegister(instr->result()); |
2989 __ ldr(result, ContextOperand(context, instr->slot_index())); | 3006 __ ldr(result, ContextOperand(context, instr->slot_index())); |
2990 if (instr->hydrogen()->RequiresHoleCheck()) { | 3007 if (instr->hydrogen()->RequiresHoleCheck()) { |
2991 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 3008 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
2992 __ cmp(result, ip); | 3009 __ cmp(result, ip); |
2993 if (instr->hydrogen()->DeoptimizesOnHole()) { | 3010 if (instr->hydrogen()->DeoptimizesOnHole()) { |
2994 DeoptimizeIf(eq, instr, Deoptimizer::kHole); | 3011 DeoptimizeIf(eq, instr, Deoptimizer::kHole); |
2995 } else { | 3012 } else { |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4220 } | 4237 } |
4221 | 4238 |
4222 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4239 __ mov(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4223 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 4240 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
4224 isolate(), instr->language_mode(), | 4241 isolate(), instr->language_mode(), |
4225 instr->hydrogen()->initialization_state()).code(); | 4242 instr->hydrogen()->initialization_state()).code(); |
4226 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); | 4243 CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
4227 } | 4244 } |
4228 | 4245 |
4229 | 4246 |
| 4247 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
| 4248 DCHECK(ToRegister(instr->context()).is(cp)); |
| 4249 DCHECK(ToRegister(instr->value()) |
| 4250 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
| 4251 |
| 4252 __ mov(StoreGlobalViaContextDescriptor::DepthRegister(), |
| 4253 Operand(Smi::FromInt(instr->depth()))); |
| 4254 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), |
| 4255 Operand(Smi::FromInt(instr->slot_index()))); |
| 4256 __ mov(StoreGlobalViaContextDescriptor::NameRegister(), |
| 4257 Operand(instr->name())); |
| 4258 |
| 4259 Handle<Code> stub = |
| 4260 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(), |
| 4261 instr->language_mode()).code(); |
| 4262 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
| 4263 } |
| 4264 |
| 4265 |
4230 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4266 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4231 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4267 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4232 if (instr->index()->IsConstantOperand()) { | 4268 if (instr->index()->IsConstantOperand()) { |
4233 Operand index = ToOperand(instr->index()); | 4269 Operand index = ToOperand(instr->index()); |
4234 Register length = ToRegister(instr->length()); | 4270 Register length = ToRegister(instr->length()); |
4235 __ cmp(length, index); | 4271 __ cmp(length, index); |
4236 cc = CommuteCondition(cc); | 4272 cc = CommuteCondition(cc); |
4237 } else { | 4273 } else { |
4238 Register index = ToRegister(instr->index()); | 4274 Register index = ToRegister(instr->index()); |
4239 Operand length = ToOperand(instr->length()); | 4275 Operand length = ToOperand(instr->length()); |
(...skipping 1761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6001 __ push(ToRegister(instr->function())); | 6037 __ push(ToRegister(instr->function())); |
6002 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6038 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6003 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6039 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6004 } | 6040 } |
6005 | 6041 |
6006 | 6042 |
6007 #undef __ | 6043 #undef __ |
6008 | 6044 |
6009 } // namespace internal | 6045 } // namespace internal |
6010 } // namespace v8 | 6046 } // namespace v8 |
OLD | NEW |