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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2992 | 2992 |
2993 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); | 2993 __ li(LoadDescriptor::NameRegister(), Operand(instr->name())); |
2994 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); | 2994 EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
2995 Handle<Code> ic = | 2995 Handle<Code> ic = |
2996 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2996 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
2997 SLOPPY, PREMONOMORPHIC).code(); | 2997 SLOPPY, PREMONOMORPHIC).code(); |
2998 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2998 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2999 } | 2999 } |
3000 | 3000 |
3001 | 3001 |
| 3002 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
| 3003 DCHECK(ToRegister(instr->context()).is(cp)); |
| 3004 DCHECK(ToRegister(instr->result()).is(v0)); |
| 3005 |
| 3006 __ li(LoadGlobalViaContextDescriptor::DepthRegister(), |
| 3007 Operand(Smi::FromInt(instr->depth()))); |
| 3008 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), |
| 3009 Operand(Smi::FromInt(instr->slot_index()))); |
| 3010 __ li(LoadGlobalViaContextDescriptor::NameRegister(), Operand(instr->name())); |
| 3011 |
| 3012 Handle<Code> stub = |
| 3013 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code(); |
| 3014 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
| 3015 } |
| 3016 |
| 3017 |
3002 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 3018 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
3003 Register context = ToRegister(instr->context()); | 3019 Register context = ToRegister(instr->context()); |
3004 Register result = ToRegister(instr->result()); | 3020 Register result = ToRegister(instr->result()); |
3005 | 3021 |
3006 __ ld(result, ContextOperand(context, instr->slot_index())); | 3022 __ ld(result, ContextOperand(context, instr->slot_index())); |
3007 if (instr->hydrogen()->RequiresHoleCheck()) { | 3023 if (instr->hydrogen()->RequiresHoleCheck()) { |
3008 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 3024 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
3009 | 3025 |
3010 if (instr->hydrogen()->DeoptimizesOnHole()) { | 3026 if (instr->hydrogen()->DeoptimizesOnHole()) { |
3011 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); | 3027 DeoptimizeIf(eq, instr, Deoptimizer::kHole, result, Operand(at)); |
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4374 } | 4390 } |
4375 | 4391 |
4376 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); | 4392 __ li(StoreDescriptor::NameRegister(), Operand(instr->name())); |
4377 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( | 4393 Handle<Code> ic = CodeFactory::StoreICInOptimizedCode( |
4378 isolate(), instr->language_mode(), | 4394 isolate(), instr->language_mode(), |
4379 instr->hydrogen()->initialization_state()).code(); | 4395 instr->hydrogen()->initialization_state()).code(); |
4380 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4396 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4381 } | 4397 } |
4382 | 4398 |
4383 | 4399 |
| 4400 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
| 4401 DCHECK(ToRegister(instr->context()).is(cp)); |
| 4402 DCHECK(ToRegister(instr->value()) |
| 4403 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
| 4404 |
| 4405 __ li(StoreGlobalViaContextDescriptor::DepthRegister(), |
| 4406 Operand(Smi::FromInt(instr->depth()))); |
| 4407 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), |
| 4408 Operand(Smi::FromInt(instr->slot_index()))); |
| 4409 __ li(StoreGlobalViaContextDescriptor::NameRegister(), |
| 4410 Operand(instr->name())); |
| 4411 |
| 4412 Handle<Code> stub = |
| 4413 CodeFactory::StoreGlobalViaContext(isolate(), instr->depth(), |
| 4414 instr->language_mode()).code(); |
| 4415 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
| 4416 } |
| 4417 |
| 4418 |
4384 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4419 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4385 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4420 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4386 Operand operand((int64_t)0); | 4421 Operand operand((int64_t)0); |
4387 Register reg; | 4422 Register reg; |
4388 if (instr->index()->IsConstantOperand()) { | 4423 if (instr->index()->IsConstantOperand()) { |
4389 operand = ToOperand(instr->index()); | 4424 operand = ToOperand(instr->index()); |
4390 reg = ToRegister(instr->length()); | 4425 reg = ToRegister(instr->length()); |
4391 cc = CommuteCondition(cc); | 4426 cc = CommuteCondition(cc); |
4392 } else { | 4427 } else { |
4393 reg = ToRegister(instr->index()); | 4428 reg = ToRegister(instr->index()); |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6226 __ Push(at, ToRegister(instr->function())); | 6261 __ Push(at, ToRegister(instr->function())); |
6227 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6262 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6228 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6263 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6229 } | 6264 } |
6230 | 6265 |
6231 | 6266 |
6232 #undef __ | 6267 #undef __ |
6233 | 6268 |
6234 } // namespace internal | 6269 } // namespace internal |
6235 } // namespace v8 | 6270 } // namespace v8 |
OLD | NEW |