OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Rrdistribution and use in source and binary forms, with or without | 2 // Rrdistribution 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 // * Rrdistributions of source code must retain the above copyright | 6 // * Rrdistributions 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 // * Rrdistributions in binary form must reproduce the above | 8 // * Rrdistributions 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 __ sub(sp, sp, Operand(kDoubleSize)); | 71 __ sub(sp, sp, Operand(kDoubleSize)); |
72 __ vstr(d0, sp, 0); | 72 __ vstr(d0, sp, 0); |
73 if (!source_reg.is(sp)) { | 73 if (!source_reg.is(sp)) { |
74 __ mov(source_reg, sp); | 74 __ mov(source_reg, sp); |
75 } | 75 } |
76 | 76 |
77 // Save registers make sure they don't get clobbered. | 77 // Save registers make sure they don't get clobbered. |
78 int source_reg_offset = kDoubleSize; | 78 int source_reg_offset = kDoubleSize; |
79 int reg_num = 0; | 79 int reg_num = 0; |
80 for (; reg_num < Register::kNumRegisters; ++reg_num) { | 80 for (; reg_num < Register::kNumRegisters; ++reg_num) { |
81 Register reg = Register::from_code(reg_num); | 81 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
82 if (reg.IsAllocatable()) { | 82 reg_num)) { |
| 83 Register reg = Register::from_code(reg_num); |
83 if (!reg.is(destination_reg)) { | 84 if (!reg.is(destination_reg)) { |
84 __ push(reg); | 85 __ push(reg); |
85 source_reg_offset += kPointerSize; | 86 source_reg_offset += kPointerSize; |
86 } | 87 } |
87 } | 88 } |
88 } | 89 } |
89 | 90 |
90 // Re-push the double argument. | 91 // Re-push the double argument. |
91 __ sub(sp, sp, Operand(kDoubleSize)); | 92 __ sub(sp, sp, Operand(kDoubleSize)); |
92 __ vstr(d0, sp, 0); | 93 __ vstr(d0, sp, 0); |
93 | 94 |
94 // Call through to the actual stub | 95 // Call through to the actual stub |
95 if (inline_fastpath) { | 96 if (inline_fastpath) { |
96 __ vldr(d0, MemOperand(source_reg)); | 97 __ vldr(d0, MemOperand(source_reg)); |
97 __ TryInlineTruncateDoubleToI(destination_reg, d0, &done); | 98 __ TryInlineTruncateDoubleToI(destination_reg, d0, &done); |
98 if (destination_reg.is(source_reg) && !source_reg.is(sp)) { | 99 if (destination_reg.is(source_reg) && !source_reg.is(sp)) { |
99 // Restore clobbered source_reg. | 100 // Restore clobbered source_reg. |
100 __ add(source_reg, sp, Operand(source_reg_offset)); | 101 __ add(source_reg, sp, Operand(source_reg_offset)); |
101 } | 102 } |
102 } | 103 } |
103 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); | 104 __ Call(start, RelocInfo::EXTERNAL_REFERENCE); |
104 __ bind(&done); | 105 __ bind(&done); |
105 | 106 |
106 __ add(sp, sp, Operand(kDoubleSize)); | 107 __ add(sp, sp, Operand(kDoubleSize)); |
107 | 108 |
108 // Make sure no registers have been unexpectedly clobbered | 109 // Make sure no registers have been unexpectedly clobbered |
109 for (--reg_num; reg_num >= 0; --reg_num) { | 110 for (--reg_num; reg_num >= 0; --reg_num) { |
110 Register reg = Register::from_code(reg_num); | 111 if (RegisterConfiguration::Crankshaft()->IsAllocatableGeneralCode( |
111 if (reg.IsAllocatable()) { | 112 reg_num)) { |
| 113 Register reg = Register::from_code(reg_num); |
112 if (!reg.is(destination_reg)) { | 114 if (!reg.is(destination_reg)) { |
113 __ ldr(ip, MemOperand(sp, 0)); | 115 __ ldr(ip, MemOperand(sp, 0)); |
114 __ cmp(reg, ip); | 116 __ cmp(reg, ip); |
115 __ Assert(eq, kRegisterWasClobbered); | 117 __ Assert(eq, kRegisterWasClobbered); |
116 __ add(sp, sp, Operand(kPointerSize)); | 118 __ add(sp, sp, Operand(kPointerSize)); |
117 } | 119 } |
118 } | 120 } |
119 } | 121 } |
120 | 122 |
121 __ add(sp, sp, Operand(kDoubleSize)); | 123 __ add(sp, sp, Operand(kDoubleSize)); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 false)); | 182 false)); |
181 RunAllTruncationTests( | 183 RunAllTruncationTests( |
182 RunGeneratedCodeCallWrapper, | 184 RunGeneratedCodeCallWrapper, |
183 MakeConvertDToIFuncTrampoline(isolate, | 185 MakeConvertDToIFuncTrampoline(isolate, |
184 source_registers[s], | 186 source_registers[s], |
185 dest_registers[d], | 187 dest_registers[d], |
186 true)); | 188 true)); |
187 } | 189 } |
188 } | 190 } |
189 } | 191 } |
OLD | NEW |