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

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

Issue 1419823003: Remove support for "loads and stores to global vars through property cell shortcuts inst… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@disable-shortcuts
Patch Set: Addressing comments Created 5 years, 2 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 #if V8_TARGET_ARCH_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 __ Branch(done); 1379 __ Branch(done);
1380 } 1380 }
1381 } 1381 }
1382 1382
1383 1383
1384 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, 1384 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
1385 TypeofMode typeof_mode) { 1385 TypeofMode typeof_mode) {
1386 Variable* var = proxy->var(); 1386 Variable* var = proxy->var();
1387 DCHECK(var->IsUnallocatedOrGlobalSlot() || 1387 DCHECK(var->IsUnallocatedOrGlobalSlot() ||
1388 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); 1388 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
1389 if (var->IsGlobalSlot()) { 1389 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1390 DCHECK(var->index() > 0); 1390 __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
1391 DCHECK(var->IsStaticGlobalObjectProperty()); 1391 __ li(LoadDescriptor::SlotRegister(),
1392 int const slot = var->index(); 1392 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1393 int const depth = scope()->ContextChainLength(var->scope()); 1393 CallLoadIC(typeof_mode);
1394 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
1395 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
1396 LoadGlobalViaContextStub stub(isolate(), depth);
1397 __ CallStub(&stub);
1398 } else {
1399 __ Push(Smi::FromInt(slot));
1400 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
1401 }
1402
1403 } else {
1404 __ lw(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1405 __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
1406 __ li(LoadDescriptor::SlotRegister(),
1407 Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
1408 CallLoadIC(typeof_mode);
1409 }
1410 } 1394 }
1411 1395
1412 1396
1413 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, 1397 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
1414 TypeofMode typeof_mode) { 1398 TypeofMode typeof_mode) {
1415 // Record position before possible IC call. 1399 // Record position before possible IC call.
1416 SetExpressionPosition(proxy); 1400 SetExpressionPosition(proxy);
1417 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); 1401 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS);
1418 Variable* var = proxy->var(); 1402 Variable* var = proxy->var();
1419 1403
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
2600 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, 2584 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
2601 FeedbackVectorSlot slot) { 2585 FeedbackVectorSlot slot) {
2602 if (var->IsUnallocated()) { 2586 if (var->IsUnallocated()) {
2603 // Global var, const, or let. 2587 // Global var, const, or let.
2604 __ mov(StoreDescriptor::ValueRegister(), result_register()); 2588 __ mov(StoreDescriptor::ValueRegister(), result_register());
2605 __ li(StoreDescriptor::NameRegister(), Operand(var->name())); 2589 __ li(StoreDescriptor::NameRegister(), Operand(var->name()));
2606 __ lw(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); 2590 __ lw(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
2607 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); 2591 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot);
2608 CallStoreIC(); 2592 CallStoreIC();
2609 2593
2610 } else if (var->IsGlobalSlot()) {
2611 // Global var, const, or let.
2612 DCHECK(var->index() > 0);
2613 DCHECK(var->IsStaticGlobalObjectProperty());
2614 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(a0));
2615 __ mov(StoreGlobalViaContextDescriptor::ValueRegister(), result_register());
2616 int const slot = var->index();
2617 int const depth = scope()->ContextChainLength(var->scope());
2618 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
2619 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot));
2620 StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
2621 __ CallStub(&stub);
2622 } else {
2623 __ Push(Smi::FromInt(slot));
2624 __ Push(a0);
2625 __ CallRuntime(is_strict(language_mode())
2626 ? Runtime::kStoreGlobalViaContext_Strict
2627 : Runtime::kStoreGlobalViaContext_Sloppy,
2628 2);
2629 }
2630
2631 } else if (var->mode() == LET && op != Token::INIT_LET) { 2594 } else if (var->mode() == LET && op != Token::INIT_LET) {
2632 // Non-initializing assignment to let variable needs a write barrier. 2595 // Non-initializing assignment to let variable needs a write barrier.
2633 DCHECK(!var->IsLookupSlot()); 2596 DCHECK(!var->IsLookupSlot());
2634 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2597 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2635 Label assign; 2598 Label assign;
2636 MemOperand location = VarOperand(var, a1); 2599 MemOperand location = VarOperand(var, a1);
2637 __ lw(a3, location); 2600 __ lw(a3, location);
2638 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex); 2601 __ LoadRoot(t0, Heap::kTheHoleValueRootIndex);
2639 __ Branch(&assign, ne, a3, Operand(t0)); 2602 __ Branch(&assign, ne, a3, Operand(t0));
2640 __ li(a3, Operand(var->name())); 2603 __ li(a3, Operand(var->name()));
(...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
5190 reinterpret_cast<uint32_t>( 5153 reinterpret_cast<uint32_t>(
5191 isolate->builtins()->OsrAfterStackCheck()->entry())); 5154 isolate->builtins()->OsrAfterStackCheck()->entry()));
5192 return OSR_AFTER_STACK_CHECK; 5155 return OSR_AFTER_STACK_CHECK;
5193 } 5156 }
5194 5157
5195 5158
5196 } // namespace internal 5159 } // namespace internal
5197 } // namespace v8 5160 } // namespace v8
5198 5161
5199 #endif // V8_TARGET_ARCH_MIPS 5162 #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