Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1259963002: [stubs] Don't pass name to Load/StoreGlobalViaContext stubs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if V8_TARGET_ARCH_ARM 7 #if V8_TARGET_ARCH_ARM
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1401 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 DCHECK(var->IsUnallocatedOrGlobalSlot() || 1412 DCHECK(var->IsUnallocatedOrGlobalSlot() ||
1413 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); 1413 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
1414 if (var->IsGlobalSlot()) { 1414 if (var->IsGlobalSlot()) {
1415 DCHECK(var->index() > 0); 1415 DCHECK(var->index() > 0);
1416 DCHECK(var->IsStaticGlobalObjectProperty()); 1416 DCHECK(var->IsStaticGlobalObjectProperty());
1417 // Each var occupies two slots in the context: for reads and writes. 1417 // Each var occupies two slots in the context: for reads and writes.
1418 const int slot = var->index(); 1418 const int slot = var->index();
1419 const int depth = scope()->ContextChainLength(var->scope()); 1419 const int depth = scope()->ContextChainLength(var->scope());
1420 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { 1420 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
1421 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); 1421 __ mov(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
1422 __ mov(LoadGlobalViaContextDescriptor::NameRegister(),
1423 Operand(var->name()));
1424 LoadGlobalViaContextStub stub(isolate(), depth); 1422 LoadGlobalViaContextStub stub(isolate(), depth);
1425 __ CallStub(&stub); 1423 __ CallStub(&stub);
1426 } else { 1424 } else {
1427 __ Push(Smi::FromInt(slot)); 1425 __ Push(Smi::FromInt(slot));
1428 __ Push(var->name()); 1426 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
1429 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
1430 } 1427 }
1431 } else { 1428 } else {
1432 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1429 __ ldr(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1433 __ mov(LoadDescriptor::NameRegister(), Operand(var->name())); 1430 __ mov(LoadDescriptor::NameRegister(), Operand(var->name()));
1434 __ mov(LoadDescriptor::SlotRegister(), 1431 __ mov(LoadDescriptor::SlotRegister(),
1435 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); 1432 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1436 CallLoadIC(typeof_mode); 1433 CallLoadIC(typeof_mode);
1437 } 1434 }
1438 } 1435 }
1439 1436
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after
2714 2711
2715 } else if (var->IsGlobalSlot()) { 2712 } else if (var->IsGlobalSlot()) {
2716 // Global var, const, or let. 2713 // Global var, const, or let.
2717 DCHECK(var->index() > 0); 2714 DCHECK(var->index() > 0);
2718 DCHECK(var->IsStaticGlobalObjectProperty()); 2715 DCHECK(var->IsStaticGlobalObjectProperty());
2719 // Each var occupies two slots in the context: for reads and writes. 2716 // Each var occupies two slots in the context: for reads and writes.
2720 const int slot = var->index() + 1; 2717 const int slot = var->index() + 1;
2721 const int depth = scope()->ContextChainLength(var->scope()); 2718 const int depth = scope()->ContextChainLength(var->scope());
2722 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { 2719 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
2723 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); 2720 __ mov(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
2724 __ mov(StoreGlobalViaContextDescriptor::NameRegister(),
2725 Operand(var->name()));
2726 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r0)); 2721 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(r0));
2727 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); 2722 StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
2728 __ CallStub(&stub); 2723 __ CallStub(&stub);
2729 } else { 2724 } else {
2730 __ Push(Smi::FromInt(slot)); 2725 __ Push(Smi::FromInt(slot));
2731 __ Push(var->name());
2732 __ push(r0); 2726 __ push(r0);
2733 __ CallRuntime(is_strict(language_mode()) 2727 __ CallRuntime(is_strict(language_mode())
2734 ? Runtime::kStoreGlobalViaContext_Strict 2728 ? Runtime::kStoreGlobalViaContext_Strict
2735 : Runtime::kStoreGlobalViaContext_Sloppy, 2729 : Runtime::kStoreGlobalViaContext_Sloppy,
2736 3); 2730 2);
2737 } 2731 }
2738 } else if (var->mode() == LET && op != Token::INIT_LET) { 2732 } else if (var->mode() == LET && op != Token::INIT_LET) {
2739 // Non-initializing assignment to let variable needs a write barrier. 2733 // Non-initializing assignment to let variable needs a write barrier.
2740 DCHECK(!var->IsLookupSlot()); 2734 DCHECK(!var->IsLookupSlot());
2741 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2735 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2742 Label assign; 2736 Label assign;
2743 MemOperand location = VarOperand(var, r1); 2737 MemOperand location = VarOperand(var, r1);
2744 __ ldr(r3, location); 2738 __ ldr(r3, location);
2745 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); 2739 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex);
2746 __ b(ne, &assign); 2740 __ b(ne, &assign);
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after
5477 DCHECK(interrupt_address == 5471 DCHECK(interrupt_address ==
5478 isolate->builtins()->OsrAfterStackCheck()->entry()); 5472 isolate->builtins()->OsrAfterStackCheck()->entry());
5479 return OSR_AFTER_STACK_CHECK; 5473 return OSR_AFTER_STACK_CHECK;
5480 } 5474 }
5481 5475
5482 5476
5483 } // namespace internal 5477 } // namespace internal
5484 } // namespace v8 5478 } // namespace v8
5485 5479
5486 #endif // V8_TARGET_ARCH_ARM 5480 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698