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

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

Issue 749633002: harmony-scoping: make assignment to 'const' a late error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 6 years 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_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 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after
2589 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2589 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2590 MemOperand location = VarOperand(var, rcx); 2590 MemOperand location = VarOperand(var, rcx);
2591 if (generate_debug_code_ && op == Token::INIT_LET) { 2591 if (generate_debug_code_ && op == Token::INIT_LET) {
2592 // Check for an uninitialized let binding. 2592 // Check for an uninitialized let binding.
2593 __ movp(rdx, location); 2593 __ movp(rdx, location);
2594 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); 2594 __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex);
2595 __ Check(equal, kLetBindingReInitialization); 2595 __ Check(equal, kLetBindingReInitialization);
2596 } 2596 }
2597 EmitStoreToStackLocalOrContextSlot(var, location); 2597 EmitStoreToStackLocalOrContextSlot(var, location);
2598 } 2598 }
2599 } else if (var->IsSignallingAssignmentToConst(op, strict_mode())) {
2600 __ CallRuntime(Runtime::kThrowConstAssignError, 0);
2599 } 2601 }
2600 // Non-initializing assignments to consts are ignored.
2601 } 2602 }
2602 2603
2603 2604
2604 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { 2605 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
2605 // Assignment to a property, using a named store IC. 2606 // Assignment to a property, using a named store IC.
2606 Property* prop = expr->target()->AsProperty(); 2607 Property* prop = expr->target()->AsProperty();
2607 DCHECK(prop != NULL); 2608 DCHECK(prop != NULL);
2608 DCHECK(prop->key()->IsLiteral()); 2609 DCHECK(prop->key()->IsLiteral());
2609 2610
2610 // Record source code position before IC call. 2611 // Record source code position before IC call.
(...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after
5192 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5193 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5193 Assembler::target_address_at(call_target_address, 5194 Assembler::target_address_at(call_target_address,
5194 unoptimized_code)); 5195 unoptimized_code));
5195 return OSR_AFTER_STACK_CHECK; 5196 return OSR_AFTER_STACK_CHECK;
5196 } 5197 }
5197 5198
5198 5199
5199 } } // namespace v8::internal 5200 } } // namespace v8::internal
5200 5201
5201 #endif // V8_TARGET_ARCH_X64 5202 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698