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

Side by Side Diff: src/full-codegen/ia32/full-codegen-ia32.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
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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 DCHECK(IsDeclaredVariableMode(mode)); 789 DCHECK(IsDeclaredVariableMode(mode));
790 // Push initial value, if any. 790 // Push initial value, if any.
791 // Note: For variables we must not push an initial value (such as 791 // Note: For variables we must not push an initial value (such as
792 // 'undefined') because we may have a (legal) redeclaration and we 792 // 'undefined') because we may have a (legal) redeclaration and we
793 // must not destroy the current value. 793 // must not destroy the current value.
794 if (hole_init) { 794 if (hole_init) {
795 __ push(Immediate(isolate()->factory()->the_hole_value())); 795 __ push(Immediate(isolate()->factory()->the_hole_value()));
796 } else { 796 } else {
797 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. 797 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value.
798 } 798 }
799 __ CallRuntime(IsImmutableVariableMode(mode) 799 __ push(
800 ? Runtime::kDeclareReadOnlyLookupSlot 800 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes())));
801 : Runtime::kDeclareLookupSlot, 801 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
802 2);
803 break; 802 break;
804 } 803 }
805 } 804 }
806 } 805 }
807 806
808 807
809 void FullCodeGenerator::VisitFunctionDeclaration( 808 void FullCodeGenerator::VisitFunctionDeclaration(
810 FunctionDeclaration* declaration) { 809 FunctionDeclaration* declaration) {
811 VariableProxy* proxy = declaration->proxy(); 810 VariableProxy* proxy = declaration->proxy();
812 Variable* variable = proxy->var(); 811 Variable* variable = proxy->var();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 EMIT_REMEMBERED_SET, 843 EMIT_REMEMBERED_SET,
845 OMIT_SMI_CHECK); 844 OMIT_SMI_CHECK);
846 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 845 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
847 break; 846 break;
848 } 847 }
849 848
850 case VariableLocation::LOOKUP: { 849 case VariableLocation::LOOKUP: {
851 Comment cmnt(masm_, "[ FunctionDeclaration"); 850 Comment cmnt(masm_, "[ FunctionDeclaration");
852 __ push(Immediate(variable->name())); 851 __ push(Immediate(variable->name()));
853 VisitForStackValue(declaration->fun()); 852 VisitForStackValue(declaration->fun());
854 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); 853 __ push(
854 Immediate(Smi::FromInt(variable->DeclarationPropertyAttributes())));
855 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
855 break; 856 break;
856 } 857 }
857 } 858 }
858 } 859 }
859 860
860 861
861 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 862 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
862 // Call the runtime to declare the globals. 863 // Call the runtime to declare the globals.
863 __ Push(pairs); 864 __ Push(pairs);
864 __ Push(Smi::FromInt(DeclareGlobalsFlags())); 865 __ Push(Smi::FromInt(DeclareGlobalsFlags()));
(...skipping 4287 matching lines...) Expand 10 before | Expand all | Expand 10 after
5152 Assembler::target_address_at(call_target_address, 5153 Assembler::target_address_at(call_target_address,
5153 unoptimized_code)); 5154 unoptimized_code));
5154 return OSR_AFTER_STACK_CHECK; 5155 return OSR_AFTER_STACK_CHECK;
5155 } 5156 }
5156 5157
5157 5158
5158 } // namespace internal 5159 } // namespace internal
5159 } // namespace v8 5160 } // namespace v8
5160 5161
5161 #endif // V8_TARGET_ARCH_IA32 5162 #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