OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.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 3370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3381 | 3381 |
3382 | 3382 |
3383 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 3383 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
3384 DCHECK(ToRegister(instr->context()).is(cp)); | 3384 DCHECK(ToRegister(instr->context()).is(cp)); |
3385 DCHECK(ToRegister(instr->result()).is(x0)); | 3385 DCHECK(ToRegister(instr->result()).is(x0)); |
3386 | 3386 |
3387 int const slot = instr->slot_index(); | 3387 int const slot = instr->slot_index(); |
3388 int const depth = instr->depth(); | 3388 int const depth = instr->depth(); |
3389 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 3389 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { |
3390 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 3390 __ Mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
3391 __ Mov(LoadGlobalViaContextDescriptor::NameRegister(), | |
3392 Operand(instr->name())); | |
3393 Handle<Code> stub = | 3391 Handle<Code> stub = |
3394 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | 3392 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); |
3395 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 3393 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
3396 } else { | 3394 } else { |
3397 __ Push(Smi::FromInt(slot)); | 3395 __ Push(Smi::FromInt(slot)); |
3398 __ Push(instr->name()); | 3396 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); |
3399 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2); | |
3400 } | 3397 } |
3401 } | 3398 } |
3402 | 3399 |
3403 | 3400 |
3404 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( | 3401 MemOperand LCodeGen::PrepareKeyedExternalArrayOperand( |
3405 Register key, | 3402 Register key, |
3406 Register base, | 3403 Register base, |
3407 Register scratch, | 3404 Register scratch, |
3408 bool key_is_smi, | 3405 bool key_is_smi, |
3409 bool key_is_constant, | 3406 bool key_is_constant, |
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5541 | 5538 |
5542 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 5539 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
5543 DCHECK(ToRegister(instr->context()).is(cp)); | 5540 DCHECK(ToRegister(instr->context()).is(cp)); |
5544 DCHECK(ToRegister(instr->value()) | 5541 DCHECK(ToRegister(instr->value()) |
5545 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 5542 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
5546 | 5543 |
5547 int const slot = instr->slot_index(); | 5544 int const slot = instr->slot_index(); |
5548 int const depth = instr->depth(); | 5545 int const depth = instr->depth(); |
5549 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 5546 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { |
5550 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 5547 __ Mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); |
5551 __ Mov(StoreGlobalViaContextDescriptor::NameRegister(), | |
5552 Operand(instr->name())); | |
5553 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | 5548 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( |
5554 isolate(), depth, instr->language_mode()) | 5549 isolate(), depth, instr->language_mode()) |
5555 .code(); | 5550 .code(); |
5556 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 5551 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
5557 } else { | 5552 } else { |
5558 __ Push(Smi::FromInt(slot)); | 5553 __ Push(Smi::FromInt(slot)); |
5559 __ Push(instr->name()); | |
5560 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | 5554 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); |
5561 __ CallRuntime(is_strict(instr->language_mode()) | 5555 __ CallRuntime(is_strict(instr->language_mode()) |
5562 ? Runtime::kStoreGlobalViaContext_Strict | 5556 ? Runtime::kStoreGlobalViaContext_Strict |
5563 : Runtime::kStoreGlobalViaContext_Sloppy, | 5557 : Runtime::kStoreGlobalViaContext_Sloppy, |
5564 3); | 5558 2); |
5565 } | 5559 } |
5566 } | 5560 } |
5567 | 5561 |
5568 | 5562 |
5569 void LCodeGen::DoStringAdd(LStringAdd* instr) { | 5563 void LCodeGen::DoStringAdd(LStringAdd* instr) { |
5570 DCHECK(ToRegister(instr->context()).is(cp)); | 5564 DCHECK(ToRegister(instr->context()).is(cp)); |
5571 DCHECK(ToRegister(instr->left()).Is(x1)); | 5565 DCHECK(ToRegister(instr->left()).Is(x1)); |
5572 DCHECK(ToRegister(instr->right()).Is(x0)); | 5566 DCHECK(ToRegister(instr->right()).Is(x0)); |
5573 StringAddStub stub(isolate(), | 5567 StringAddStub stub(isolate(), |
5574 instr->hydrogen()->flags(), | 5568 instr->hydrogen()->flags(), |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6184 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6178 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6185 __ Push(scope_info); | 6179 __ Push(scope_info); |
6186 __ Push(ToRegister(instr->function())); | 6180 __ Push(ToRegister(instr->function())); |
6187 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6181 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6188 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6182 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6189 } | 6183 } |
6190 | 6184 |
6191 | 6185 |
6192 } // namespace internal | 6186 } // namespace internal |
6193 } // namespace v8 | 6187 } // namespace v8 |
OLD | NEW |