OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 Comment cmnt(masm_, "[ VariableDeclaration"); | 805 Comment cmnt(masm_, "[ VariableDeclaration"); |
806 __ mov(r5, Operand(variable->name())); | 806 __ mov(r5, Operand(variable->name())); |
807 // Declaration nodes are always introduced in one of four modes. | 807 // Declaration nodes are always introduced in one of four modes. |
808 DCHECK(IsDeclaredVariableMode(mode)); | 808 DCHECK(IsDeclaredVariableMode(mode)); |
809 // Push initial value, if any. | 809 // Push initial value, if any. |
810 // Note: For variables we must not push an initial value (such as | 810 // Note: For variables we must not push an initial value (such as |
811 // 'undefined') because we may have a (legal) redeclaration and we | 811 // 'undefined') because we may have a (legal) redeclaration and we |
812 // must not destroy the current value. | 812 // must not destroy the current value. |
813 if (hole_init) { | 813 if (hole_init) { |
814 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); | 814 __ LoadRoot(r3, Heap::kTheHoleValueRootIndex); |
815 __ Push(r5, r3); | |
816 } else { | 815 } else { |
817 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. | 816 __ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value. |
818 __ Push(r5, r3); | |
819 } | 817 } |
820 __ LoadSmiLiteral( | 818 __ Push(r5, r3); |
821 r3, Smi::FromInt(variable->DeclarationPropertyAttributes())); | 819 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
822 __ Push(r3); | |
823 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); | 820 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
824 break; | 821 break; |
825 } | 822 } |
826 } | 823 } |
827 } | 824 } |
828 | 825 |
829 | 826 |
830 void FullCodeGenerator::VisitFunctionDeclaration( | 827 void FullCodeGenerator::VisitFunctionDeclaration( |
831 FunctionDeclaration* declaration) { | 828 FunctionDeclaration* declaration) { |
832 VariableProxy* proxy = declaration->proxy(); | 829 VariableProxy* proxy = declaration->proxy(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); | 861 PrepareForBailoutForId(proxy->id(), NO_REGISTERS); |
865 break; | 862 break; |
866 } | 863 } |
867 | 864 |
868 case VariableLocation::LOOKUP: { | 865 case VariableLocation::LOOKUP: { |
869 Comment cmnt(masm_, "[ FunctionDeclaration"); | 866 Comment cmnt(masm_, "[ FunctionDeclaration"); |
870 __ mov(r5, Operand(variable->name())); | 867 __ mov(r5, Operand(variable->name())); |
871 __ Push(r5); | 868 __ Push(r5); |
872 // Push initial value for function declaration. | 869 // Push initial value for function declaration. |
873 VisitForStackValue(declaration->fun()); | 870 VisitForStackValue(declaration->fun()); |
874 __ LoadSmiLiteral( | 871 __ Push(Smi::FromInt(variable->DeclarationPropertyAttributes())); |
875 r5, Smi::FromInt(variable->DeclarationPropertyAttributes())); | |
876 __ Push(r5); | |
877 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); | 872 __ CallRuntime(Runtime::kDeclareLookupSlot, 3); |
878 break; | 873 break; |
879 } | 874 } |
880 } | 875 } |
881 } | 876 } |
882 | 877 |
883 | 878 |
884 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { | 879 void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) { |
885 // Call the runtime to declare the globals. | 880 // Call the runtime to declare the globals. |
886 __ mov(r4, Operand(pairs)); | 881 __ mov(r4, Operand(pairs)); |
(...skipping 4344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5231 return ON_STACK_REPLACEMENT; | 5226 return ON_STACK_REPLACEMENT; |
5232 } | 5227 } |
5233 | 5228 |
5234 DCHECK(interrupt_address == | 5229 DCHECK(interrupt_address == |
5235 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5230 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5236 return OSR_AFTER_STACK_CHECK; | 5231 return OSR_AFTER_STACK_CHECK; |
5237 } | 5232 } |
5238 } // namespace internal | 5233 } // namespace internal |
5239 } // namespace v8 | 5234 } // namespace v8 |
5240 #endif // V8_TARGET_ARCH_PPC | 5235 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |