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

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

Issue 2233673003: Remove CONST_LEGACY VariableMode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 3 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/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 if (var->binding_needs_init()) { 2160 if (var->binding_needs_init()) {
2161 Label assign; 2161 Label assign;
2162 __ ldr(r3, location); 2162 __ ldr(r3, location);
2163 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); 2163 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex);
2164 __ b(ne, &assign); 2164 __ b(ne, &assign);
2165 __ mov(r3, Operand(var->name())); 2165 __ mov(r3, Operand(var->name()));
2166 __ push(r3); 2166 __ push(r3);
2167 __ CallRuntime(Runtime::kThrowReferenceError); 2167 __ CallRuntime(Runtime::kThrowReferenceError);
2168 __ bind(&assign); 2168 __ bind(&assign);
2169 } 2169 }
2170 if (var->mode() == CONST) { 2170 if (var->mode() != CONST) {
2171 EmitStoreToStackLocalOrContextSlot(var, location);
2172 } else if (var->throw_on_const_assignment(language_mode())) {
2171 __ CallRuntime(Runtime::kThrowConstAssignError); 2173 __ CallRuntime(Runtime::kThrowConstAssignError);
2172 } else {
2173 EmitStoreToStackLocalOrContextSlot(var, location);
2174 } 2174 }
2175 } else if (var->is_this() && var->mode() == CONST && op == Token::INIT) { 2175 } else if (var->is_this() && var->mode() == CONST && op == Token::INIT) {
2176 // Initializing assignment to const {this} needs a write barrier. 2176 // Initializing assignment to const {this} needs a write barrier.
2177 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); 2177 DCHECK(var->IsStackAllocated() || var->IsContextSlot());
2178 Label uninitialized_this; 2178 Label uninitialized_this;
2179 MemOperand location = VarOperand(var, r1); 2179 MemOperand location = VarOperand(var, r1);
2180 __ ldr(r3, location); 2180 __ ldr(r3, location);
2181 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); 2181 __ CompareRoot(r3, Heap::kTheHoleValueRootIndex);
2182 __ b(eq, &uninitialized_this); 2182 __ b(eq, &uninitialized_this);
2183 __ mov(r0, Operand(var->name())); 2183 __ mov(r0, Operand(var->name()));
2184 __ Push(r0); 2184 __ Push(r0);
2185 __ CallRuntime(Runtime::kThrowReferenceError); 2185 __ CallRuntime(Runtime::kThrowReferenceError);
2186 __ bind(&uninitialized_this); 2186 __ bind(&uninitialized_this);
2187 EmitStoreToStackLocalOrContextSlot(var, location); 2187 EmitStoreToStackLocalOrContextSlot(var, location);
2188 2188
2189 } else if (!var->is_const_mode() || op == Token::INIT) { 2189 } else {
2190 DCHECK(var->mode() != CONST || op == Token::INIT);
2190 if (var->IsLookupSlot()) { 2191 if (var->IsLookupSlot()) {
2191 // Assignment to var. 2192 // Assignment to var.
2192 __ Push(var->name()); 2193 __ Push(var->name());
2193 __ Push(r0); 2194 __ Push(r0);
2194 __ CallRuntime(is_strict(language_mode()) 2195 __ CallRuntime(is_strict(language_mode())
2195 ? Runtime::kStoreLookupSlot_Strict 2196 ? Runtime::kStoreLookupSlot_Strict
2196 : Runtime::kStoreLookupSlot_Sloppy); 2197 : Runtime::kStoreLookupSlot_Sloppy);
2197 } else { 2198 } else {
2198 // Assignment to var or initializing assignment to let/const in harmony 2199 // Assignment to var or initializing assignment to let/const in harmony
2199 // mode. 2200 // mode.
2200 DCHECK((var->IsStackAllocated() || var->IsContextSlot())); 2201 DCHECK((var->IsStackAllocated() || var->IsContextSlot()));
2201 MemOperand location = VarOperand(var, r1); 2202 MemOperand location = VarOperand(var, r1);
2202 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { 2203 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) {
2203 // Check for an uninitialized let binding. 2204 // Check for an uninitialized let binding.
2204 __ ldr(r2, location); 2205 __ ldr(r2, location);
2205 __ CompareRoot(r2, Heap::kTheHoleValueRootIndex); 2206 __ CompareRoot(r2, Heap::kTheHoleValueRootIndex);
2206 __ Check(eq, kLetBindingReInitialization); 2207 __ Check(eq, kLetBindingReInitialization);
2207 } 2208 }
2208 EmitStoreToStackLocalOrContextSlot(var, location); 2209 EmitStoreToStackLocalOrContextSlot(var, location);
2209 } 2210 }
2210
2211 } else {
2212 DCHECK(var->mode() == CONST_LEGACY && op != Token::INIT);
2213 if (is_strict(language_mode())) {
2214 __ CallRuntime(Runtime::kThrowConstAssignError);
2215 }
2216 // Silently ignore store in sloppy mode.
2217 } 2211 }
2218 } 2212 }
2219 2213
2220 2214
2221 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) { 2215 void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
2222 // Assignment to a property, using a named store IC. 2216 // Assignment to a property, using a named store IC.
2223 Property* prop = expr->target()->AsProperty(); 2217 Property* prop = expr->target()->AsProperty();
2224 DCHECK(prop != NULL); 2218 DCHECK(prop != NULL);
2225 DCHECK(prop->key()->IsLiteral()); 2219 DCHECK(prop->key()->IsLiteral());
2226 2220
(...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after
3816 DCHECK(interrupt_address == 3810 DCHECK(interrupt_address ==
3817 isolate->builtins()->OnStackReplacement()->entry()); 3811 isolate->builtins()->OnStackReplacement()->entry());
3818 return ON_STACK_REPLACEMENT; 3812 return ON_STACK_REPLACEMENT;
3819 } 3813 }
3820 3814
3821 3815
3822 } // namespace internal 3816 } // namespace internal
3823 } // namespace v8 3817 } // namespace v8
3824 3818
3825 #endif // V8_TARGET_ARCH_ARM 3819 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698