OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
869 // Save all general purpose registers before messing with them. | 869 // Save all general purpose registers before messing with them. |
870 const int kNumberOfRegisters = Register::kNumRegisters; | 870 const int kNumberOfRegisters = Register::kNumRegisters; |
871 | 871 |
872 // Everything but pc, lr and ip which will be saved but not restored. | 872 // Everything but pc, lr and ip which will be saved but not restored. |
873 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); | 873 RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); |
874 | 874 |
875 const int kDoubleRegsSize = | 875 const int kDoubleRegsSize = |
876 kDoubleSize * DwVfpRegister::kMaxNumAllocatableRegisters; | 876 kDoubleSize * DwVfpRegister::kMaxNumAllocatableRegisters; |
877 | 877 |
878 if (CpuFeatures::IsSupported(VFP2)) { | 878 if (CpuFeatures::IsSupported(VFP2)) { |
879 CpuFeatures::Scope scope(VFP2); | 879 CpuFeatureScope scope(masm(), VFP2); |
880 // Save all allocatable VFP registers before messing with them. | 880 // Save all allocatable VFP registers before messing with them. |
881 ASSERT(kDoubleRegZero.code() == 14); | 881 ASSERT(kDoubleRegZero.code() == 14); |
882 ASSERT(kScratchDoubleReg.code() == 15); | 882 ASSERT(kScratchDoubleReg.code() == 15); |
883 | 883 |
884 // Check CPU flags for number of registers, setting the Z condition flag. | 884 // Check CPU flags for number of registers, setting the Z condition flag. |
885 __ CheckFor32DRegs(ip); | 885 __ CheckFor32DRegs(ip); |
886 | 886 |
887 // Push registers d0-d13, and possibly d16-d31, on the stack. | 887 // Push registers d0-d13, and possibly d16-d31, on the stack. |
888 // If d16-d31 are not pushed, decrease the stack pointer instead. | 888 // If d16-d31 are not pushed, decrease the stack pointer instead. |
889 __ vstm(db_w, sp, d16, d31, ne); | 889 __ vstm(db_w, sp, d16, d31, ne); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 | 944 |
945 // Copy core registers into FrameDescription::registers_[kNumRegisters]. | 945 // Copy core registers into FrameDescription::registers_[kNumRegisters]. |
946 ASSERT(Register::kNumRegisters == kNumberOfRegisters); | 946 ASSERT(Register::kNumRegisters == kNumberOfRegisters); |
947 for (int i = 0; i < kNumberOfRegisters; i++) { | 947 for (int i = 0; i < kNumberOfRegisters; i++) { |
948 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); | 948 int offset = (i * kPointerSize) + FrameDescription::registers_offset(); |
949 __ ldr(r2, MemOperand(sp, i * kPointerSize)); | 949 __ ldr(r2, MemOperand(sp, i * kPointerSize)); |
950 __ str(r2, MemOperand(r1, offset)); | 950 __ str(r2, MemOperand(r1, offset)); |
951 } | 951 } |
952 | 952 |
953 if (CpuFeatures::IsSupported(VFP2)) { | 953 if (CpuFeatures::IsSupported(VFP2)) { |
954 CpuFeatures::Scope scope(VFP2); | 954 CpuFeatureScope scope(masm(), VFP2); |
955 // Copy VFP registers to | 955 // Copy VFP registers to |
956 // double_registers_[DoubleRegister::kMaxNumAllocatableRegisters] | 956 // double_registers_[DoubleRegister::kMaxNumAllocatableRegisters] |
957 int double_regs_offset = FrameDescription::double_registers_offset(); | 957 int double_regs_offset = FrameDescription::double_registers_offset(); |
958 for (int i = 0; i < DwVfpRegister::kMaxNumAllocatableRegisters; ++i) { | 958 for (int i = 0; i < DwVfpRegister::kMaxNumAllocatableRegisters; ++i) { |
959 int dst_offset = i * kDoubleSize + double_regs_offset; | 959 int dst_offset = i * kDoubleSize + double_regs_offset; |
960 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; | 960 int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
961 __ vldr(d0, sp, src_offset); | 961 __ vldr(d0, sp, src_offset); |
962 __ vstr(d0, r1, dst_offset); | 962 __ vstr(d0, r1, dst_offset); |
963 } | 963 } |
964 } | 964 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1024 __ push(r7); | 1024 __ push(r7); |
1025 __ bind(&inner_loop_header); | 1025 __ bind(&inner_loop_header); |
1026 __ cmp(r3, Operand::Zero()); | 1026 __ cmp(r3, Operand::Zero()); |
1027 __ b(ne, &inner_push_loop); // test for gt? | 1027 __ b(ne, &inner_push_loop); // test for gt? |
1028 __ add(r4, r4, Operand(kPointerSize)); | 1028 __ add(r4, r4, Operand(kPointerSize)); |
1029 __ bind(&outer_loop_header); | 1029 __ bind(&outer_loop_header); |
1030 __ cmp(r4, r1); | 1030 __ cmp(r4, r1); |
1031 __ b(lt, &outer_push_loop); | 1031 __ b(lt, &outer_push_loop); |
1032 | 1032 |
1033 if (CpuFeatures::IsSupported(VFP2)) { | 1033 if (CpuFeatures::IsSupported(VFP2)) { |
1034 CpuFeatures::Scope scope(VFP2); | 1034 CpuFeatureScope scope(masm(), VFP2); |
1035 // Check CPU flags for number of registers, setting the Z condition flag. | 1035 // Check CPU flags for number of registers, setting the Z condition flag. |
1036 __ CheckFor32DRegs(ip); | 1036 __ CheckFor32DRegs(ip); |
1037 | 1037 |
1038 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); | 1038 __ ldr(r1, MemOperand(r0, Deoptimizer::input_offset())); |
1039 int src_offset = FrameDescription::double_registers_offset(); | 1039 int src_offset = FrameDescription::double_registers_offset(); |
1040 for (int i = 0; i < DwVfpRegister::kMaxNumRegisters; ++i) { | 1040 for (int i = 0; i < DwVfpRegister::kMaxNumRegisters; ++i) { |
1041 if (i == kDoubleRegZero.code()) continue; | 1041 if (i == kDoubleRegZero.code()) continue; |
1042 if (i == kScratchDoubleReg.code()) continue; | 1042 if (i == kScratchDoubleReg.code()) continue; |
1043 | 1043 |
1044 const DwVfpRegister reg = DwVfpRegister::from_code(i); | 1044 const DwVfpRegister reg = DwVfpRegister::from_code(i); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 __ push(ip); | 1097 __ push(ip); |
1098 __ b(&done); | 1098 __ b(&done); |
1099 ASSERT(masm()->pc_offset() - start == table_entry_size_); | 1099 ASSERT(masm()->pc_offset() - start == table_entry_size_); |
1100 } | 1100 } |
1101 __ bind(&done); | 1101 __ bind(&done); |
1102 } | 1102 } |
1103 | 1103 |
1104 #undef __ | 1104 #undef __ |
1105 | 1105 |
1106 } } // namespace v8::internal | 1106 } } // namespace v8::internal |
OLD | NEW |