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/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 // Check function data field is actually a BytecodeArray object. | 892 // Check function data field is actually a BytecodeArray object. |
893 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0); | 893 __ TestIfSmi(kInterpreterBytecodeArrayRegister, r0); |
894 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 894 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
895 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r3, no_reg, | 895 __ CompareObjectType(kInterpreterBytecodeArrayRegister, r3, no_reg, |
896 BYTECODE_ARRAY_TYPE); | 896 BYTECODE_ARRAY_TYPE); |
897 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 897 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
898 } | 898 } |
899 | 899 |
900 // Allocate the local and temporary register file on the stack. | 900 // Allocate the local and temporary register file on the stack. |
901 { | 901 { |
902 // Load frame size from the BytecodeArray object. | 902 // Load frame size (word) from the BytecodeArray object. |
903 __ LoadP(r5, FieldMemOperand(kInterpreterBytecodeArrayRegister, | 903 __ lwz(r5, FieldMemOperand(kInterpreterBytecodeArrayRegister, |
904 BytecodeArray::kFrameSizeOffset)); | 904 BytecodeArray::kFrameSizeOffset)); |
905 | 905 |
906 // Do a stack check to ensure we don't go over the limit. | 906 // Do a stack check to ensure we don't go over the limit. |
907 Label ok; | 907 Label ok; |
908 __ sub(r6, sp, r5); | 908 __ sub(r6, sp, r5); |
909 __ LoadRoot(r0, Heap::kRealStackLimitRootIndex); | 909 __ LoadRoot(r0, Heap::kRealStackLimitRootIndex); |
910 __ cmp(r6, r0); | 910 __ cmp(r6, r0); |
911 __ bge(&ok); | 911 __ bge(&ok); |
912 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 912 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
913 __ bind(&ok); | 913 __ bind(&ok); |
914 | 914 |
915 // If ok, push undefined as the initial value for all register file entries. | 915 // If ok, push undefined as the initial value for all register file entries. |
916 // Note: there should always be at least one stack slot for the return | 916 // Note: there should always be at least one stack slot for the return |
917 // register in the register file. | 917 // register in the register file. |
918 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 918 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
919 Label loop_header; | 919 Label loop_header; |
920 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); | 920 __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
921 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2)); | 921 __ ShiftRightImm(r5, r5, Operand(kPointerSizeLog2)); |
| 922 __ mtctr(r5); |
922 __ bind(&loop_header); | 923 __ bind(&loop_header); |
923 __ push(r6); | 924 __ push(r6); |
924 __ bdnz(&loop_header); | 925 __ bdnz(&loop_header); |
925 } | 926 } |
926 | 927 |
927 // TODO(rmcilroy): List of things not currently dealt with here but done in | 928 // TODO(rmcilroy): List of things not currently dealt with here but done in |
928 // fullcodegen's prologue: | 929 // fullcodegen's prologue: |
929 // - Support profiler (specifically profiling_counter). | 930 // - Support profiler (specifically profiling_counter). |
930 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 931 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
931 // - Allow simulator stop operations if FLAG_stop_at is set. | 932 // - Allow simulator stop operations if FLAG_stop_at is set. |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 __ bkpt(0); | 1921 __ bkpt(0); |
1921 } | 1922 } |
1922 } | 1923 } |
1923 | 1924 |
1924 | 1925 |
1925 #undef __ | 1926 #undef __ |
1926 } // namespace internal | 1927 } // namespace internal |
1927 } // namespace v8 | 1928 } // namespace v8 |
1928 | 1929 |
1929 #endif // V8_TARGET_ARCH_PPC | 1930 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |