| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 // For the rest, there are gaps on the stack, so the offsets remain the same. | 861 // For the rest, there are gaps on the stack, so the offsets remain the same. |
| 862 const int kNumberOfRegisters = Register::kNumRegisters; | 862 const int kNumberOfRegisters = Register::kNumRegisters; |
| 863 | 863 |
| 864 RegList restored_regs = kJSCallerSaved | kCalleeSaved; | 864 RegList restored_regs = kJSCallerSaved | kCalleeSaved; |
| 865 RegList saved_regs = restored_regs | sp.bit() | ra.bit(); | 865 RegList saved_regs = restored_regs | sp.bit() | ra.bit(); |
| 866 | 866 |
| 867 const int kDoubleRegsSize = | 867 const int kDoubleRegsSize = |
| 868 kDoubleSize * FPURegister::kMaxNumAllocatableRegisters; | 868 kDoubleSize * FPURegister::kMaxNumAllocatableRegisters; |
| 869 | 869 |
| 870 if (CpuFeatures::IsSupported(FPU)) { | 870 if (CpuFeatures::IsSupported(FPU)) { |
| 871 CpuFeatures::Scope scope(FPU); | 871 CpuFeatureScope scope(masm(), FPU); |
| 872 // Save all FPU registers before messing with them. | 872 // Save all FPU registers before messing with them. |
| 873 __ Subu(sp, sp, Operand(kDoubleRegsSize)); | 873 __ Subu(sp, sp, Operand(kDoubleRegsSize)); |
| 874 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) { | 874 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) { |
| 875 FPURegister fpu_reg = FPURegister::FromAllocationIndex(i); | 875 FPURegister fpu_reg = FPURegister::FromAllocationIndex(i); |
| 876 int offset = i * kDoubleSize; | 876 int offset = i * kDoubleSize; |
| 877 __ sdc1(fpu_reg, MemOperand(sp, offset)); | 877 __ sdc1(fpu_reg, MemOperand(sp, offset)); |
| 878 } | 878 } |
| 879 } else { | 879 } else { |
| 880 __ Subu(sp, sp, Operand(kDoubleRegsSize)); | 880 __ Subu(sp, sp, Operand(kDoubleRegsSize)); |
| 881 } | 881 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 __ lw(a2, MemOperand(sp, i * kPointerSize)); | 944 __ lw(a2, MemOperand(sp, i * kPointerSize)); |
| 945 __ sw(a2, MemOperand(a1, offset)); | 945 __ sw(a2, MemOperand(a1, offset)); |
| 946 } else if (FLAG_debug_code) { | 946 } else if (FLAG_debug_code) { |
| 947 __ li(a2, kDebugZapValue); | 947 __ li(a2, kDebugZapValue); |
| 948 __ sw(a2, MemOperand(a1, offset)); | 948 __ sw(a2, MemOperand(a1, offset)); |
| 949 } | 949 } |
| 950 } | 950 } |
| 951 | 951 |
| 952 int double_regs_offset = FrameDescription::double_registers_offset(); | 952 int double_regs_offset = FrameDescription::double_registers_offset(); |
| 953 if (CpuFeatures::IsSupported(FPU)) { | 953 if (CpuFeatures::IsSupported(FPU)) { |
| 954 CpuFeatures::Scope scope(FPU); | 954 CpuFeatureScope scope(masm(), FPU); |
| 955 // Copy FPU registers to | 955 // Copy FPU registers to |
| 956 // double_registers_[DoubleRegister::kNumAllocatableRegisters] | 956 // double_registers_[DoubleRegister::kNumAllocatableRegisters] |
| 957 for (int i = 0; i < FPURegister::NumAllocatableRegisters(); ++i) { | 957 for (int i = 0; i < FPURegister::NumAllocatableRegisters(); ++i) { |
| 958 int dst_offset = i * kDoubleSize + double_regs_offset; | 958 int dst_offset = i * kDoubleSize + double_regs_offset; |
| 959 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; | 959 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
| 960 __ ldc1(f0, MemOperand(sp, src_offset)); | 960 __ ldc1(f0, MemOperand(sp, src_offset)); |
| 961 __ sdc1(f0, MemOperand(a1, dst_offset)); | 961 __ sdc1(f0, MemOperand(a1, dst_offset)); |
| 962 } | 962 } |
| 963 } | 963 } |
| 964 | 964 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 __ lw(t3, MemOperand(t2, FrameDescription::frame_content_offset())); | 1022 __ lw(t3, MemOperand(t2, FrameDescription::frame_content_offset())); |
| 1023 __ push(t3); | 1023 __ push(t3); |
| 1024 __ bind(&inner_loop_header); | 1024 __ bind(&inner_loop_header); |
| 1025 __ Branch(&inner_push_loop, ne, a3, Operand(zero_reg)); | 1025 __ Branch(&inner_push_loop, ne, a3, Operand(zero_reg)); |
| 1026 | 1026 |
| 1027 __ Addu(t0, t0, Operand(kPointerSize)); | 1027 __ Addu(t0, t0, Operand(kPointerSize)); |
| 1028 __ bind(&outer_loop_header); | 1028 __ bind(&outer_loop_header); |
| 1029 __ Branch(&outer_push_loop, lt, t0, Operand(a1)); | 1029 __ Branch(&outer_push_loop, lt, t0, Operand(a1)); |
| 1030 | 1030 |
| 1031 if (CpuFeatures::IsSupported(FPU)) { | 1031 if (CpuFeatures::IsSupported(FPU)) { |
| 1032 CpuFeatures::Scope scope(FPU); | 1032 CpuFeatureScope scope(masm(), FPU); |
| 1033 | 1033 |
| 1034 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset())); | 1034 __ lw(a1, MemOperand(a0, Deoptimizer::input_offset())); |
| 1035 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) { | 1035 for (int i = 0; i < FPURegister::kMaxNumAllocatableRegisters; ++i) { |
| 1036 const FPURegister fpu_reg = FPURegister::FromAllocationIndex(i); | 1036 const FPURegister fpu_reg = FPURegister::FromAllocationIndex(i); |
| 1037 int src_offset = i * kDoubleSize + double_regs_offset; | 1037 int src_offset = i * kDoubleSize + double_regs_offset; |
| 1038 __ ldc1(fpu_reg, MemOperand(a1, src_offset)); | 1038 __ ldc1(fpu_reg, MemOperand(a1, src_offset)); |
| 1039 } | 1039 } |
| 1040 } | 1040 } |
| 1041 | 1041 |
| 1042 // Push state, pc, and continuation from the last output frame. | 1042 // Push state, pc, and continuation from the last output frame. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), | 1113 ASSERT_EQ(masm()->SizeOfCodeGeneratedSince(&table_start), |
| 1114 count() * table_entry_size_); | 1114 count() * table_entry_size_); |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 #undef __ | 1117 #undef __ |
| 1118 | 1118 |
| 1119 | 1119 |
| 1120 } } // namespace v8::internal | 1120 } } // namespace v8::internal |
| OLD | NEW |