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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm/macro-assembler-arm.h" | 7 #include "src/arm/macro-assembler-arm.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/compiler/code-generator-impl.h" | 9 #include "src/compiler/code-generator-impl.h" |
10 #include "src/compiler/gap-resolver.h" | 10 #include "src/compiler/gap-resolver.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 | 159 |
160 namespace { | 160 namespace { |
161 | 161 |
162 class OutOfLineLoadFloat32 final : public OutOfLineCode { | 162 class OutOfLineLoadFloat32 final : public OutOfLineCode { |
163 public: | 163 public: |
164 OutOfLineLoadFloat32(CodeGenerator* gen, SwVfpRegister result) | 164 OutOfLineLoadFloat32(CodeGenerator* gen, SwVfpRegister result) |
165 : OutOfLineCode(gen), result_(result) {} | 165 : OutOfLineCode(gen), result_(result) {} |
166 | 166 |
167 void Generate() final { | 167 void Generate() final { |
168 __ vmov(result_, std::numeric_limits<float>::quiet_NaN()); | 168 // Compute sqrtf(-1.0f), which results in a quiet single-precision NaN. |
| 169 __ vmov(result_, -1.0f); |
| 170 __ vsqrt(result_, result_); |
169 } | 171 } |
170 | 172 |
171 private: | 173 private: |
172 SwVfpRegister const result_; | 174 SwVfpRegister const result_; |
173 }; | 175 }; |
174 | 176 |
175 | 177 |
176 class OutOfLineLoadFloat64 final : public OutOfLineCode { | 178 class OutOfLineLoadFloat64 final : public OutOfLineCode { |
177 public: | 179 public: |
178 OutOfLineLoadFloat64(CodeGenerator* gen, DwVfpRegister result) | 180 OutOfLineLoadFloat64(CodeGenerator* gen, DwVfpRegister result) |
179 : OutOfLineCode(gen), result_(result) {} | 181 : OutOfLineCode(gen), result_(result) {} |
180 | 182 |
181 void Generate() final { | 183 void Generate() final { |
182 __ vmov(result_, std::numeric_limits<double>::quiet_NaN(), kScratchReg); | 184 // Compute sqrt(-1.0), which results in a quiet double-precision NaN. |
| 185 __ vmov(result_, -1.0); |
| 186 __ vsqrt(result_, result_); |
183 } | 187 } |
184 | 188 |
185 private: | 189 private: |
186 DwVfpRegister const result_; | 190 DwVfpRegister const result_; |
187 }; | 191 }; |
188 | 192 |
189 | 193 |
190 class OutOfLineLoadInteger final : public OutOfLineCode { | 194 class OutOfLineLoadInteger final : public OutOfLineCode { |
191 public: | 195 public: |
192 OutOfLineLoadInteger(CodeGenerator* gen, Register result) | 196 OutOfLineLoadInteger(CodeGenerator* gen, Register result) |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 padding_size -= v8::internal::Assembler::kInstrSize; | 1476 padding_size -= v8::internal::Assembler::kInstrSize; |
1473 } | 1477 } |
1474 } | 1478 } |
1475 } | 1479 } |
1476 | 1480 |
1477 #undef __ | 1481 #undef __ |
1478 | 1482 |
1479 } // namespace compiler | 1483 } // namespace compiler |
1480 } // namespace internal | 1484 } // namespace internal |
1481 } // namespace v8 | 1485 } // namespace v8 |
OLD | NEW |