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

Side by Side Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.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_MIPS64 5 #if V8_TARGET_ARCH_MIPS64
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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after
842 // Note: For variables we must not push an initial value (such as 842 // Note: For variables we must not push an initial value (such as
843 // 'undefined') because we may have a (legal) redeclaration and we 843 // 'undefined') because we may have a (legal) redeclaration and we
844 // must not destroy the current value. 844 // must not destroy the current value.
845 if (hole_init) { 845 if (hole_init) {
846 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); 846 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex);
847 } else { 847 } else {
848 DCHECK(Smi::FromInt(0) == 0); 848 DCHECK(Smi::FromInt(0) == 0);
849 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. 849 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value.
850 } 850 }
851 __ Push(a2, a0); 851 __ Push(a2, a0);
852 __ CallRuntime(IsImmutableVariableMode(mode) 852 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
853 ? Runtime::kDeclareReadOnlyLookupSlot 853 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
854 : Runtime::kDeclareLookupSlot,
855 2);
856 break; 854 break;
857 } 855 }
858 } 856 }
859 } 857 }
860 858
861 859
862 void FullCodeGenerator::VisitFunctionDeclaration( 860 void FullCodeGenerator::VisitFunctionDeclaration(
863 FunctionDeclaration* declaration) { 861 FunctionDeclaration* declaration) {
864 VariableProxy* proxy = declaration->proxy(); 862 VariableProxy* proxy = declaration->proxy();
865 Variable* variable = proxy->var(); 863 Variable* variable = proxy->var();
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); 899 PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
902 break; 900 break;
903 } 901 }
904 902
905 case VariableLocation::LOOKUP: { 903 case VariableLocation::LOOKUP: {
906 Comment cmnt(masm_, "[ FunctionDeclaration"); 904 Comment cmnt(masm_, "[ FunctionDeclaration");
907 __ li(a2, Operand(variable->name())); 905 __ li(a2, Operand(variable->name()));
908 __ Push(a2); 906 __ Push(a2);
909 // Push initial value for function declaration. 907 // Push initial value for function declaration.
910 VisitForStackValue(declaration->fun()); 908 VisitForStackValue(declaration->fun());
911 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); 909 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
910 __ CallRuntime(Runtime::kDeclareLookupSlot, 3);
912 break; 911 break;
913 } 912 }
914 } 913 }
915 } 914 }
916 915
917 916
918 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { 917 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
919 // Call the runtime to declare the globals. 918 // Call the runtime to declare the globals.
920 __ li(a1, Operand(pairs)); 919 __ li(a1, Operand(pairs));
921 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); 920 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags())));
(...skipping 4334 matching lines...) Expand 10 before | Expand all | Expand 10 after
5256 reinterpret_cast<uint64_t>( 5255 reinterpret_cast<uint64_t>(
5257 isolate->builtins()->OsrAfterStackCheck()->entry())); 5256 isolate->builtins()->OsrAfterStackCheck()->entry()));
5258 return OSR_AFTER_STACK_CHECK; 5257 return OSR_AFTER_STACK_CHECK;
5259 } 5258 }
5260 5259
5261 5260
5262 } // namespace internal 5261 } // namespace internal
5263 } // namespace v8 5262 } // namespace v8
5264 5263
5265 #endif // V8_TARGET_ARCH_MIPS64 5264 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/ppc/full-codegen-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698