OLD | NEW |
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 // Note: For variables we must not push an initial value (such as | 848 // Note: For variables we must not push an initial value (such as |
849 // 'undefined') because we may have a (legal) redeclaration and we | 849 // 'undefined') because we may have a (legal) redeclaration and we |
850 // must not destroy the current value. | 850 // must not destroy the current value. |
851 if (hole_init) { | 851 if (hole_init) { |
852 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); | 852 __ LoadRoot(a0, Heap::kTheHoleValueRootIndex); |
853 } else { | 853 } else { |
854 DCHECK(Smi::FromInt(0) == 0); | 854 DCHECK(Smi::FromInt(0) == 0); |
855 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. | 855 __ mov(a0, zero_reg); // Smi::FromInt(0) indicates no initial value. |
856 } | 856 } |
857 __ Push(a2, a0); | 857 __ Push(a2, a0); |
858 __ CallRuntime(IsImmutableVariableMode(mode) | 858 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
859 ? Runtime::kDeclareReadOnlyLookupSlot | 859 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
860 : Runtime::kDeclareLookupSlot, | |
861 2); | |
862 break; | 860 break; |
863 } | 861 } |
864 } | 862 } |
865 } | 863 } |
866 | 864 |
867 | 865 |
868 void FullCodeGenerator::VisitFunctionDeclaration( | 866 void FullCodeGenerator::VisitFunctionDeclaration( |
869 FunctionDeclaration* declaration) { | 867 FunctionDeclaration* declaration) { |
870 VariableProxy* proxy = declaration->proxy(); | 868 VariableProxy* proxy = declaration->proxy(); |
871 Variable* variable = proxy->var(); | 869 Variable* variable = proxy->var(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 905 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
908 break; | 906 break; |
909 } | 907 } |
910 | 908 |
911 case VariableLocation::LOOKUP: { | 909 case VariableLocation::LOOKUP: { |
912 Comment cmnt(masm_, "[ FunctionDeclaration"); | 910 Comment cmnt(masm_, "[ FunctionDeclaration"); |
913 __ li(a2, Operand(variable->name())); | 911 __ li(a2, Operand(variable->name())); |
914 __ Push(a2); | 912 __ Push(a2); |
915 // Push initial value for function declaration. | 913 // Push initial value for function declaration. |
916 VisitForStackValue(declaration->fun()); | 914 VisitForStackValue(declaration->fun()); |
917 __ CallRuntime(Runtime::kDeclareLookupSlot, 2); | 915 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
| 916 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
918 break; | 917 break; |
919 } | 918 } |
920 } | 919 } |
921 } | 920 } |
922 | 921 |
923 | 922 |
924 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 923 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
925 // Call the runtime to declare the globals. | 924 // Call the runtime to declare the globals. |
926 __ li(a1, Operand(pairs)); | 925 __ li(a1, Operand(pairs)); |
927 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); | 926 __ li(a0, Operand(Smi::FromInt(DeclareGlobalsFlags()))); |
(...skipping 4311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5239 reinterpret_cast<uint32_t>( | 5238 reinterpret_cast<uint32_t>( |
5240 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5239 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5241 return OSR_AFTER_STACK_CHECK; | 5240 return OSR_AFTER_STACK_CHECK; |
5242 } | 5241 } |
5243 | 5242 |
5244 | 5243 |
5245 } // namespace internal | 5244 } // namespace internal |
5246 } // namespace v8 | 5245 } // namespace v8 |
5247 | 5246 |
5248 #endif // V8_TARGET_ARCH_MIPS | 5247 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |