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 2973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2984 | 2984 |
2985 | 2985 |
2986 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 2986 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
2987 DCHECK(ToRegister(instr->context()).is(cp)); | 2987 DCHECK(ToRegister(instr->context()).is(cp)); |
2988 DCHECK(ToRegister(instr->result()).is(r0)); | 2988 DCHECK(ToRegister(instr->result()).is(r0)); |
2989 | 2989 |
2990 int const slot = instr->slot_index(); | 2990 int const slot = instr->slot_index(); |
2991 int const depth = instr->depth(); | 2991 int const depth = instr->depth(); |
2992 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 2992 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { |
2993 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 2993 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
2994 __ mov(LoadGlobalViaContextDescriptor::NameRegister(), | |
2995 Operand(instr->name())); | |
2996 Handle<Code> stub = | 2994 Handle<Code> stub = |
2997 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | 2995 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); |
2998 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 2996 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
2999 } else { | 2997 } else { |
3000 __ Push(Smi::FromInt(slot)); | 2998 __ Push(Smi::FromInt(slot)); |
3001 __ Push(instr->name()); | 2999 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); |
3002 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2); | |
3003 } | 3000 } |
3004 } | 3001 } |
3005 | 3002 |
3006 | 3003 |
3007 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3004 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
3008 Register context = ToRegister(instr->context()); | 3005 Register context = ToRegister(instr->context()); |
3009 Register result = ToRegister(instr->result()); | 3006 Register result = ToRegister(instr->result()); |
3010 __ ldr(result, ContextOperand(context, instr->slot_index())); | 3007 __ ldr(result, ContextOperand(context, instr->slot_index())); |
3011 if (instr->hydrogen()->RequiresHoleCheck()) { | 3008 if (instr->hydrogen()->RequiresHoleCheck()) { |
3012 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); | 3009 __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4250 | 4247 |
4251 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 4248 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
4252 DCHECK(ToRegister(instr->context()).is(cp)); | 4249 DCHECK(ToRegister(instr->context()).is(cp)); |
4253 DCHECK(ToRegister(instr->value()) | 4250 DCHECK(ToRegister(instr->value()) |
4254 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 4251 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
4255 | 4252 |
4256 int const slot = instr->slot_index(); | 4253 int const slot = instr->slot_index(); |
4257 int const depth = instr->depth(); | 4254 int const depth = instr->depth(); |
4258 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 4255 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { |
4259 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 4256 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
4260 __ mov(StoreGlobalViaContextDescriptor::NameRegister(), | |
4261 Operand(instr->name())); | |
4262 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | 4257 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( |
4263 isolate(), depth, instr->language_mode()) | 4258 isolate(), depth, instr->language_mode()) |
4264 .code(); | 4259 .code(); |
4265 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 4260 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
4266 } else { | 4261 } else { |
4267 __ Push(Smi::FromInt(slot)); | 4262 __ Push(Smi::FromInt(slot)); |
4268 __ Push(instr->name()); | |
4269 __ push(StoreGlobalViaContextDescriptor::ValueRegister()); | 4263 __ push(StoreGlobalViaContextDescriptor::ValueRegister()); |
4270 __ CallRuntime(is_strict(instr->language_mode()) | 4264 __ CallRuntime(is_strict(instr->language_mode()) |
4271 ? Runtime::kStoreGlobalViaContext_Strict | 4265 ? Runtime::kStoreGlobalViaContext_Strict |
4272 : Runtime::kStoreGlobalViaContext_Sloppy, | 4266 : Runtime::kStoreGlobalViaContext_Sloppy, |
4273 3); | 4267 2); |
4274 } | 4268 } |
4275 } | 4269 } |
4276 | 4270 |
4277 | 4271 |
4278 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4272 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4279 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4273 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4280 if (instr->index()->IsConstantOperand()) { | 4274 if (instr->index()->IsConstantOperand()) { |
4281 Operand index = ToOperand(instr->index()); | 4275 Operand index = ToOperand(instr->index()); |
4282 Register length = ToRegister(instr->length()); | 4276 Register length = ToRegister(instr->length()); |
4283 __ cmp(length, index); | 4277 __ cmp(length, index); |
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6049 __ push(ToRegister(instr->function())); | 6043 __ push(ToRegister(instr->function())); |
6050 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6044 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6051 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6045 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6052 } | 6046 } |
6053 | 6047 |
6054 | 6048 |
6055 #undef __ | 6049 #undef __ |
6056 | 6050 |
6057 } // namespace internal | 6051 } // namespace internal |
6058 } // namespace v8 | 6052 } // namespace v8 |
OLD | NEW |