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/mips/full-codegen-mips.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_MIPS 5 #if V8_TARGET_ARCH_MIPS
6 6
7 // Note on Mips implementation: 7 // Note on Mips implementation:
8 // 8 //
9 // The result_register() for mips is the 'v0' register, which is defined 9 // The result_register() for mips is the 'v0' register, which is defined
10 // by the ABI to contain function return values. However, the first 10 // by the ABI to contain function return values. However, the first
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 // Note: For variables we must not push an initial value (such as 844 // Note: For variables we must not push an initial value (such as
845 // 'undefined') because we may have a (legal) redeclaration and we 845 // 'undefined') because we may have a (legal) redeclaration and we
846 // must not destroy the current value. 846 // must not destroy the current value.
847 if (hole_init) { 847 if (hole_init) {
848 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); 848 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex);
849 } else { 849 } else {
850 DCHECK(Smi::FromInt(0) == 0); 850 DCHECK(Smi::FromInt(0) == 0);
851 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. 851 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value.
852 } 852 }
853 __ Push(a2, a0); 853 __ Push(a2, a0);
854 __ CallRuntime(IsImmutableVariableMode(mode) 854 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
855 ? Runtime::kDeclareReadOnlyLookupSlot 855 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
856 : Runtime::kDeclareLookupSlot,
857 2);
858 break; 856 break;
859 } 857 }
860 } 858 }
861 } 859 }
862 860
863 861
864 void FullCodeGenerator::VisitFunctionDeclaration( 862 void FullCodeGenerator::VisitFunctionDeclaration(
865 FunctionDeclaration* declaration) { 863 FunctionDeclaration* declaration) {
866 VariableProxy* proxy = declaration->proxy(); 864 VariableProxy* proxy = declaration->proxy();
867 Variable* variable = proxy->var(); 865 Variable* variable = proxy->var();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 901 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
904 break; 902 break;
905 } 903 }
906 904
907 case VariableLocation::LOOKUP: { 905 case VariableLocation::LOOKUP: {
908 Comment cmnt(masm_, "[ FunctionDeclaration"); 906 Comment cmnt(masm_, "[ FunctionDeclaration");
909 __ li(a2, Operand(variable->name())); 907 __ li(a2, Operand(variable->name()));
910 __ Push(a2); 908 __ Push(a2);
911 // Push initial value for function declaration. 909 // Push initial value for function declaration.
912 VisitForStackValue(declaration->fun()); 910 VisitForStackValue(declaration->fun());
913 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); 911 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
912 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
914 break; 913 break;
915 } 914 }
916 } 915 }
917 } 916 }
918 917
919 918
920 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 919 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
921 // Call the runtime to declare the globals. 920 // Call the runtime to declare the globals.
922 __ li(a1, Operand(pairs)); 921 __ li(a1, Operand(pairs));
923 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); 922 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
(...skipping 4326 matching lines...) Expand 10 before | Expand all | Expand 10 after
5250 reinterpret_cast<uint32_t>( 5249 reinterpret_cast<uint32_t>(
5251 isolate->builtins()->OsrAfterStackCheck()->entry())); 5250 isolate->builtins()->OsrAfterStackCheck()->entry()));
5252 return OSR_AFTER_STACK_CHECK; 5251 return OSR_AFTER_STACK_CHECK;
5253 } 5252 }
5254 5253
5255 5254
5256 } // namespace internal 5255 } // namespace internal
5257 } // namespace v8 5256 } // namespace v8
5258 5257
5259 #endif // V8_TARGET_ARCH_MIPS 5258 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698