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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/code-factory.h" 7 #include "src/code-factory.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/debug/debug.h" 10 #include "src/debug/debug.h"
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 __ jmp(done); 1310 __ jmp(done);
1311 } 1311 }
1312 } 1312 }
1313 1313
1314 1314
1315 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy, 1315 void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
1316 TypeofMode typeof_mode) { 1316 TypeofMode typeof_mode) {
1317 Variable* var = proxy->var(); 1317 Variable* var = proxy->var();
1318 DCHECK(var->IsUnallocatedOrGlobalSlot() || 1318 DCHECK(var->IsUnallocatedOrGlobalSlot() ||
1319 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL)); 1319 (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
1320 if (var->IsGlobalSlot()) { 1320 __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1321 DCHECK(var->index() > 0); 1321 __ mov(LoadDescriptor::NameRegister(), var->name());
1322 DCHECK(var->IsStaticGlobalObjectProperty()); 1322 __ mov(LoadDescriptor::SlotRegister(),
1323 int const slot = var->index(); 1323 Immediate(SmiFromSlot(proxy->VariableFeedbackSlot())));
1324 int const depth = scope()->ContextChainLength(var->scope()); 1324 CallLoadIC(typeof_mode);
1325 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) {
1326 __ Move(LoadGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
1327 LoadGlobalViaContextStub stub(isolate(), depth);
1328 __ CallStub(&stub);
1329 } else {
1330 __ Push(Smi::FromInt(slot));
1331 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1);
1332 }
1333
1334 } else {
1335 __ mov(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
1336 __ mov(LoadDescriptor::NameRegister(), var->name());
1337 __ mov(LoadDescriptor::SlotRegister(),
1338 Immediate(SmiFromSlot(proxy->VariableFeedbackSlot())));
1339 CallLoadIC(typeof_mode);
1340 }
1341 } 1325 }
1342 1326
1343 1327
1344 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, 1328 void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy,
1345 TypeofMode typeof_mode) { 1329 TypeofMode typeof_mode) {
1346 SetExpressionPosition(proxy); 1330 SetExpressionPosition(proxy);
1347 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS); 1331 PrepareForBailoutForId(proxy->BeforeId(), NO_REGISTERS);
1348 Variable* var = proxy->var(); 1332 Variable* var = proxy->var();
1349 1333
1350 // Three cases: global variables, lookup variables, and all other types of 1334 // Three cases: global variables, lookup variables, and all other types of
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 2496
2513 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, 2497 void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
2514 FeedbackVectorSlot slot) { 2498 FeedbackVectorSlot slot) {
2515 if (var->IsUnallocated()) { 2499 if (var->IsUnallocated()) {
2516 // Global var, const, or let. 2500 // Global var, const, or let.
2517 __ mov(StoreDescriptor::NameRegister(), var->name()); 2501 __ mov(StoreDescriptor::NameRegister(), var->name());
2518 __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand()); 2502 __ mov(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
2519 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); 2503 if (FLAG_vector_stores) EmitLoadStoreICSlot(slot);
2520 CallStoreIC(); 2504 CallStoreIC();
2521 2505
2522 } else if (var->IsGlobalSlot()) {
2523 // Global var, const, or let.
2524 DCHECK(var->index() > 0);
2525 DCHECK(var->IsStaticGlobalObjectProperty());
2526 int const slot = var->index();
2527 int const depth = scope()->ContextChainLength(var->scope());
2528 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) {
2529 __ Move(StoreGlobalViaContextDescriptor::SlotRegister(), Immediate(slot));
2530 DCHECK(StoreGlobalViaContextDescriptor::ValueRegister().is(eax));
2531 StoreGlobalViaContextStub stub(isolate(), depth, language_mode());
2532 __ CallStub(&stub);
2533 } else {
2534 __ Push(Smi::FromInt(slot));
2535 __ Push(eax);
2536 __ CallRuntime(is_strict(language_mode())
2537 ? Runtime::kStoreGlobalViaContext_Strict
2538 : Runtime::kStoreGlobalViaContext_Sloppy,
2539 2);
2540 }
2541
2542 } else if (var->mode() == LET && op != Token::INIT_LET) { 2506 } else if (var->mode() == LET && op != Token::INIT_LET) {
2543 // Non-initializing assignment to let variable needs a write barrier. 2507 // Non-initializing assignment to let variable needs a write barrier.
2544 DCHECK(!var->IsLookupSlot()); 2508 DCHECK(!var->IsLookupSlot());
2545 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2509 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2546 Label assign; 2510 Label assign;
2547 MemOperand location = VarOperand(var, ecx); 2511 MemOperand location = VarOperand(var, ecx);
2548 __ mov(edx, location); 2512 __ mov(edx, location);
2549 __ cmp(edx, isolate()->factory()->the_hole_value()); 2513 __ cmp(edx, isolate()->factory()->the_hole_value());
2550 __ j(not_equal, &assign, Label::kNear); 2514 __ j(not_equal, &assign, Label::kNear);
2551 __ push(Immediate(var->name())); 2515 __ push(Immediate(var->name()));
(...skipping 2544 matching lines...) Expand 10 before | Expand all | Expand 10 after
5096 Assembler::target_address_at(call_target_address, 5060 Assembler::target_address_at(call_target_address,
5097 unoptimized_code)); 5061 unoptimized_code));
5098 return OSR_AFTER_STACK_CHECK; 5062 return OSR_AFTER_STACK_CHECK;
5099 } 5063 }
5100 5064
5101 5065
5102 } // namespace internal 5066 } // namespace internal
5103 } // namespace v8 5067 } // namespace v8
5104 5068
5105 #endif // V8_TARGET_ARCH_IA32 5069 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen/arm64/full-codegen-arm64.cc ('k') | src/full-codegen/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698