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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 // Note on Mips implementation: 9 // Note on Mips implementation:
10 // 10 //
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 DCHECK(var->IsUnallocatedOrGlobalSlot() || 1404 DCHECK(var->IsUnallocatedOrGlobalSlot() ||
1405 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); 1405 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
1406 if (var->IsGlobalSlot()) { 1406 if (var->IsGlobalSlot()) {
1407 DCHECK(var->index() > 0); 1407 DCHECK(var->index() > 0);
1408 DCHECK(var->IsStaticGlobalObjectProperty()); 1408 DCHECK(var->IsStaticGlobalObjectProperty());
1409 // Each var occupies two slots in the context: for reads and writes. 1409 // Each var occupies two slots in the context: for reads and writes.
1410 int const slot = var->index(); 1410 int const slot = var->index();
1411 int const depth = scope()->ContextChainLength(var->scope()); 1411 int const depth = scope()->ContextChainLength(var->scope());
1412 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { 1412 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
1413 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); 1413 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
1414 __ li(LoadGlobalViaContextDescriptor::NameRegister(), var->name());
1415 LoadGlobalViaContextStub stub(isolate(), depth); 1414 LoadGlobalViaContextStub stub(isolate(), depth);
1416 __ CallStub(&stub); 1415 __ CallStub(&stub);
1417 } else { 1416 } else {
1418 __ Push(Smi::FromInt(slot)); 1417 __ Push(Smi::FromInt(slot));
1419 __ Push(var->name()); 1418 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
1420 __ CallRuntime(Runtime::kLoadGlobalViaContext, 2);
1421 } 1419 }
1422 1420
1423 } else { 1421 } else {
1424 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand()); 1422 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1425 __ li(LoadDescriptor::NameRegister(), Operand(var->name())); 1423 __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
1426 __ li(LoadDescriptor::SlotRegister(), 1424 __ li(LoadDescriptor::SlotRegister(),
1427 Operand(SmiFromSlot(proxy->VariableFeedbackSlot()))); 1425 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1428 CallLoadIC(typeof_mode); 1426 CallLoadIC(typeof_mode);
1429 } 1427 }
1430 } 1428 }
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2703 // Global var, const, or let. 2701 // Global var, const, or let.
2704 DCHECK(var->index() > 0); 2702 DCHECK(var->index() > 0);
2705 DCHECK(var->IsStaticGlobalObjectProperty()); 2703 DCHECK(var->IsStaticGlobalObjectProperty());
2706 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(a0)); 2704 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(a0));
2707 __ mov(StoreGlobalViaContextDescriptor::ValueRegister(), result_register()); 2705 __ mov(StoreGlobalViaContextDescriptor::ValueRegister(), result_register());
2708 // Each var occupies two slots in the context: for reads and writes. 2706 // Each var occupies two slots in the context: for reads and writes.
2709 int const slot = var->index() + 1; 2707 int const slot = var->index() + 1;
2710 int const depth = scope()->ContextChainLength(var->scope()); 2708 int const depth = scope()->ContextChainLength(var->scope());
2711 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { 2709 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
2712 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); 2710 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
2713 __ li(StoreGlobalViaContextDescriptor::NameRegister(), var->name());
2714 StoreGlobalViaContextStub stub(isolate(), depth, language_mode()); 2711 StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
2715 __ CallStub(&stub); 2712 __ CallStub(&stub);
2716 } else { 2713 } else {
2717 __ Push(Smi::FromInt(slot)); 2714 __ Push(Smi::FromInt(slot));
2718 __ Push(var->name());
2719 __ Push(a0); 2715 __ Push(a0);
2720 __ CallRuntime(is_strict(language_mode()) 2716 __ CallRuntime(is_strict(language_mode())
2721 ? Runtime::kStoreGlobalViaContext_Strict 2717 ? Runtime::kStoreGlobalViaContext_Strict
2722 : Runtime::kStoreGlobalViaContext_Sloppy, 2718 : Runtime::kStoreGlobalViaContext_Sloppy,
2723 3); 2719 2);
2724 } 2720 }
2725 2721
2726 } else if (var->mode() == LET && op != Token::INIT_LET) { 2722 } else if (var->mode() == LET && op != Token::INIT_LET) {
2727 // Non-initializing assignment to let variable needs a write barrier. 2723 // Non-initializing assignment to let variable needs a write barrier.
2728 DCHECK(!var->IsLookupSlot()); 2724 DCHECK(!var->IsLookupSlot());
2729 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2725 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2730 Label assign; 2726 Label assign;
2731 MemOperand location = VarOperand(var, a1); 2727 MemOperand location = VarOperand(var, a1);
2732 __ lw(a3, location); 2728 __ lw(a3, location);
2733 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); 2729 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
(...skipping 2702 matching lines...) Expand 10 before | Expand all | Expand 10 after
5436 reinterpret_cast<uint32_t>( 5432 reinterpret_cast<uint32_t>(
5437 isolate->builtins()->OsrAfterStackCheck()->entry())); 5433 isolate->builtins()->OsrAfterStackCheck()->entry()));
5438 return OSR_AFTER_STACK_CHECK; 5434 return OSR_AFTER_STACK_CHECK;
5439 } 5435 }
5440 5436
5441 5437
5442 } // namespace internal 5438 } // namespace internal
5443 } // namespace v8 5439 } // namespace v8
5444 5440
5445 #endif // V8_TARGET_ARCH_MIPS 5441 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698