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

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

Issue 1382513003: Test for var declarations in eval which conflict with let (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mask out eval bit 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
« no previous file with comments | « src/contexts.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/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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 // Push initial value, if any. 840 // Push initial value, if any.
841 // Note: For variables we must not push an initial value (such as 841 // Note: For variables we must not push an initial value (such as
842 // 'undefined') because we may have a (legal) redeclaration and we 842 // 'undefined') because we may have a (legal) redeclaration and we
843 // must not destroy the current value. 843 // must not destroy the current value.
844 if (hole_init) { 844 if (hole_init) {
845 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex); 845 __ LoadRoot(r0, Heap::kTheHoleValueRootIndex);
846 } else { 846 } else {
847 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. 847 __ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value.
848 } 848 }
849 __ Push(r2, r0); 849 __ Push(r2, r0);
850 __ CallRuntime(IsImmutableVariableMode(mode) 850 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
851 ? Runtime::kDeclareReadOnlyLookupSlot 851 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
852 : Runtime::kDeclareLookupSlot,
853 2);
854 break; 852 break;
855 } 853 }
856 } 854 }
857 } 855 }
858 856
859 857
860 void FullCodeGenerator::VisitFunctionDeclaration( 858 void FullCodeGenerator::VisitFunctionDeclaration(
861 FunctionDeclaration* declaration) { 859 FunctionDeclaration* declaration) {
862 VariableProxy* proxy = declaration->proxy(); 860 VariableProxy* proxy = declaration->proxy();
863 Variable* variable = proxy->var(); 861 Variable* variable = proxy->var();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 897 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
900 break; 898 break;
901 } 899 }
902 900
903 case VariableLocation::LOOKUP: { 901 case VariableLocation::LOOKUP: {
904 Comment cmnt(masm_, "[ FunctionDeclaration"); 902 Comment cmnt(masm_, "[ FunctionDeclaration");
905 __ mov(r2, Operand(variable->name())); 903 __ mov(r2, Operand(variable->name()));
906 __ Push(r2); 904 __ Push(r2);
907 // Push initial value for function declaration. 905 // Push initial value for function declaration.
908 VisitForStackValue(declaration->fun()); 906 VisitForStackValue(declaration->fun());
909 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); 907 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
908 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
910 break; 909 break;
911 } 910 }
912 } 911 }
913 } 912 }
914 913
915 914
916 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 915 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
917 // Call the runtime to declare the globals. 916 // Call the runtime to declare the globals.
918 __ mov(r1, Operand(pairs)); 917 __ mov(r1, Operand(pairs));
919 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); 918 __ mov(r0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
(...skipping 4360 matching lines...) Expand 10 before | Expand all | Expand 10 after
5280 DCHECK(interrupt_address == 5279 DCHECK(interrupt_address ==
5281 isolate->builtins()->OsrAfterStackCheck()->entry()); 5280 isolate->builtins()->OsrAfterStackCheck()->entry());
5282 return OSR_AFTER_STACK_CHECK; 5281 return OSR_AFTER_STACK_CHECK;
5283 } 5282 }
5284 5283
5285 5284
5286 } // namespace internal 5285 } // namespace internal
5287 } // namespace v8 5286 } // namespace v8
5288 5287
5289 #endif // V8_TARGET_ARCH_ARM 5288 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/contexts.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