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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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/full-codegen/x64/full-codegen-x64.cc ('k') | src/parser.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_X87 5 #if V8_TARGET_ARCH_X87
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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 DCHECK(IsDeclaredVariableMode(mode)); 786 DCHECK(IsDeclaredVariableMode(mode));
787 // Push initial value, if any. 787 // Push initial value, if any.
788 // Note: For variables we must not push an initial value (such as 788 // Note: For variables we must not push an initial value (such as
789 // 'undefined') because we may have a (legal) redeclaration and we 789 // 'undefined') because we may have a (legal) redeclaration and we
790 // must not destroy the current value. 790 // must not destroy the current value.
791 if (hole_init) { 791 if (hole_init) {
792 __ push(Immediate(isolate()->factory()->the_hole_value())); 792 __ push(Immediate(isolate()->factory()->the_hole_value()));
793 } else { 793 } else {
794 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value. 794 __ push(Immediate(Smi::FromInt(0))); // Indicates no initial value.
795 } 795 }
796 __ CallRuntime(IsImmutableVariableMode(mode) 796 __ push(Immediate(variable->DeclarationPropertyAttributes()));
797 ? Runtime::kDeclareReadOnlyLookupSlot 797 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
798 : Runtime::kDeclareLookupSlot,
799 2);
800 break; 798 break;
801 } 799 }
802 } 800 }
803 } 801 }
804 802
805 803
806 void FullCodeGenerator::VisitFunctionDeclaration( 804 void FullCodeGenerator::VisitFunctionDeclaration(
807 FunctionDeclaration* declaration) { 805 FunctionDeclaration* declaration) {
808 VariableProxy* proxy = declaration->proxy(); 806 VariableProxy* proxy = declaration->proxy();
809 Variable* variable = proxy->var(); 807 Variable* variable = proxy->var();
(...skipping 27 matching lines...) Expand all
837 result_register(), ecx, kDontSaveFPRegs, 835 result_register(), ecx, kDontSaveFPRegs,
838 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); 836 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
839 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 837 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
840 break; 838 break;
841 } 839 }
842 840
843 case VariableLocation::LOOKUP: { 841 case VariableLocation::LOOKUP: {
844 Comment cmnt(masm_, "[ FunctionDeclaration"); 842 Comment cmnt(masm_, "[ FunctionDeclaration");
845 __ push(Immediate(variable->name())); 843 __ push(Immediate(variable->name()));
846 VisitForStackValue(declaration->fun()); 844 VisitForStackValue(declaration->fun());
847 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); 845 __ push(Immediate(variable->DeclarationPropertyAttributes()));
846 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
848 break; 847 break;
849 } 848 }
850 } 849 }
851 } 850 }
852 851
853 852
854 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 853 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
855 // Call the runtime to declare the globals. 854 // Call the runtime to declare the globals.
856 __ Push(pairs); 855 __ Push(pairs);
857 __ Push(Smi::FromInt(DeclareGlobalsFlags())); 856 __ Push(Smi::FromInt(DeclareGlobalsFlags()));
(...skipping 4285 matching lines...) Expand 10 before | Expand all | Expand 10 after
5143 Assembler::target_address_at(call_target_address, 5142 Assembler::target_address_at(call_target_address,
5144 unoptimized_code)); 5143 unoptimized_code));
5145 return OSR_AFTER_STACK_CHECK; 5144 return OSR_AFTER_STACK_CHECK;
5146 } 5145 }
5147 5146
5148 5147
5149 } // namespace internal 5148 } // namespace internal
5150 } // namespace v8 5149 } // namespace v8
5151 5150
5152 #endif // V8_TARGET_ARCH_X87 5151 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698