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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.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/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/hydrogen.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_X64 7 #if V8_TARGET_ARCH_X64
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 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 1362
1363 1363
1364 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, 1364 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
1365 TypeofMode typeof_mode) { 1365 TypeofMode typeof_mode) {
1366 Variable* var = proxy->var(); 1366 Variable* var = proxy->var();
1367 DCHECK(var->IsUnallocatedOrGlobalSlot() || 1367 DCHECK(var->IsUnallocatedOrGlobalSlot() ||
1368 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); 1368 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
1369 if (var->IsGlobalSlot()) { 1369 if (var->IsGlobalSlot()) {
1370 DCHECK(var->index() > 0); 1370 DCHECK(var->index() > 0);
1371 DCHECK(var->IsStaticGlobalObjectProperty()); 1371 DCHECK(var->IsStaticGlobalObjectProperty());
1372 // Each var occupies two slots in the context: for reads and writes.
1373 int const slot = var->index(); 1372 int const slot = var->index();
1374 int const depth = scope()->ContextChainLength(var->scope()); 1373 int const depth = scope()->ContextChainLength(var->scope());
1375 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { 1374 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
1376 __ Set(LoadGlobalViaContextDescriptor::SlotRegister(), slot); 1375 __ Set(LoadGlobalViaContextDescriptor::SlotRegister(), slot);
1377 __ Move(LoadGlobalViaContextDescriptor::NameRegister(), var->name());
1378 LoadGlobalViaContextStub stub(isolate(), depth); 1376 LoadGlobalViaContextStub stub(isolate(), depth);
1379 __ CallStub(&stub); 1377 __ CallStub(&stub);
1380 } else { 1378 } else {
1381 __ Push(Smi::FromInt(slot)); 1379 __ Push(Smi::FromInt(slot));
1382 __ Push(var->name()); 1380 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
1383 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
1384 } 1381 }
1385 1382
1386 } else { 1383 } else {
1387 __ Move(LoadDescriptor::NameRegister(), var->name()); 1384 __ Move(LoadDescriptor::NameRegister(), var->name());
1388 __ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1385 __ movp(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1389 __ Move(LoadDescriptor::SlotRegister(), 1386 __ Move(LoadDescriptor::SlotRegister(),
1390 SmiFromSlot(proxy->VariableFeedbackSlot())); 1387 SmiFromSlot(proxy->VariableFeedbackSlot()));
1391 CallLoadIC(typeof_mode); 1388 CallLoadIC(typeof_mode);
1392 } 1389 }
1393 } 1390 }
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 2612
2616 } else if (var->IsGlobalSlot()) { 2613 } else if (var->IsGlobalSlot()) {
2617 // Global var, const, or let. 2614 // Global var, const, or let.
2618 DCHECK(var->index() > 0); 2615 DCHECK(var->index() > 0);
2619 DCHECK(var->IsStaticGlobalObjectProperty()); 2616 DCHECK(var->IsStaticGlobalObjectProperty());
2620 // Each var occupies two slots in the context: for reads and writes. 2617 // Each var occupies two slots in the context: for reads and writes.
2621 int const slot = var->index() + 1; 2618 int const slot = var->index() + 1;
2622 int const depth = scope()->ContextChainLength(var->scope()); 2619 int const depth = scope()->ContextChainLength(var->scope());
2623 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { 2620 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
2624 __ Set(StoreGlobalViaContextDescriptor::SlotRegister(), slot); 2621 __ Set(StoreGlobalViaContextDescriptor::SlotRegister(), slot);
2625 __ Move(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
2626 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(rax)); 2622 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(rax));
2627 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); 2623 StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
2628 __ CallStub(&stub); 2624 __ CallStub(&stub);
2629 } else { 2625 } else {
2630 __ Push(Smi::FromInt(slot)); 2626 __ Push(Smi::FromInt(slot));
2631 __ Push(var->name());
2632 __ Push(rax); 2627 __ Push(rax);
2633 __ CallRuntime(is_strict(language_mode()) 2628 __ CallRuntime(is_strict(language_mode())
2634 ? Runtime::kStoreGlobalViaContext_Strict 2629 ? Runtime::kStoreGlobalViaContext_Strict
2635 : Runtime::kStoreGlobalViaContext_Sloppy, 2630 : Runtime::kStoreGlobalViaContext_Sloppy,
2636 3); 2631 2);
2637 } 2632 }
2638 2633
2639 } else if (var->mode() == LET && op != Token::INIT_LET) { 2634 } else if (var->mode() == LET && op != Token::INIT_LET) {
2640 // Non-initializing assignment to let variable needs a write barrier. 2635 // Non-initializing assignment to let variable needs a write barrier.
2641 DCHECK(!var->IsLookupSlot()); 2636 DCHECK(!var->IsLookupSlot());
2642 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2637 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2643 Label assign; 2638 Label assign;
2644 MemOperand location = VarOperand(var, rcx); 2639 MemOperand location = VarOperand(var, rcx);
2645 __ movp(rdx, location); 2640 __ movp(rdx, location);
2646 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); 2641 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex);
(...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after
5366 Assembler::target_address_at(call_target_address, 5361 Assembler::target_address_at(call_target_address,
5367 unoptimized_code)); 5362 unoptimized_code));
5368 return OSR_AFTER_STACK_CHECK; 5363 return OSR_AFTER_STACK_CHECK;
5369 } 5364 }
5370 5365
5371 5366
5372 } // namespace internal 5367 } // namespace internal
5373 } // namespace v8 5368 } // namespace v8
5374 5369
5375 #endif // V8_TARGET_ARCH_X64 5370 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698