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/arm64/macro-assembler-arm64.h" | 7 #include "src/arm64/macro-assembler-arm64.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
11 #include "src/scopes.h" | 11 #include "src/scopes.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 namespace compiler { | 15 namespace compiler { |
16 | 16 |
17 #define __ masm()-> | 17 #define __ masm()-> |
18 | 18 |
19 | 19 |
20 // Adds Arm64-specific methods to convert InstructionOperands. | 20 // Adds Arm64-specific methods to convert InstructionOperands. |
21 class Arm64OperandConverter FINAL : public InstructionOperandConverter { | 21 class Arm64OperandConverter final : public InstructionOperandConverter { |
22 public: | 22 public: |
23 Arm64OperandConverter(CodeGenerator* gen, Instruction* instr) | 23 Arm64OperandConverter(CodeGenerator* gen, Instruction* instr) |
24 : InstructionOperandConverter(gen, instr) {} | 24 : InstructionOperandConverter(gen, instr) {} |
25 | 25 |
26 DoubleRegister InputFloat32Register(size_t index) { | 26 DoubleRegister InputFloat32Register(size_t index) { |
27 return InputDoubleRegister(index).S(); | 27 return InputDoubleRegister(index).S(); |
28 } | 28 } |
29 | 29 |
30 DoubleRegister InputFloat64Register(size_t index) { | 30 DoubleRegister InputFloat64Register(size_t index) { |
31 return InputDoubleRegister(index); | 31 return InputDoubleRegister(index); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 FrameOffset offset = linkage()->GetFrameOffset( | 191 FrameOffset offset = linkage()->GetFrameOffset( |
192 AllocatedOperand::cast(op)->index(), frame(), 0); | 192 AllocatedOperand::cast(op)->index(), frame(), 0); |
193 return MemOperand(offset.from_stack_pointer() ? masm->StackPointer() : fp, | 193 return MemOperand(offset.from_stack_pointer() ? masm->StackPointer() : fp, |
194 offset.offset()); | 194 offset.offset()); |
195 } | 195 } |
196 }; | 196 }; |
197 | 197 |
198 | 198 |
199 namespace { | 199 namespace { |
200 | 200 |
201 class OutOfLineLoadNaN32 FINAL : public OutOfLineCode { | 201 class OutOfLineLoadNaN32 final : public OutOfLineCode { |
202 public: | 202 public: |
203 OutOfLineLoadNaN32(CodeGenerator* gen, DoubleRegister result) | 203 OutOfLineLoadNaN32(CodeGenerator* gen, DoubleRegister result) |
204 : OutOfLineCode(gen), result_(result) {} | 204 : OutOfLineCode(gen), result_(result) {} |
205 | 205 |
206 void Generate() FINAL { | 206 void Generate() final { |
207 __ Fmov(result_, std::numeric_limits<float>::quiet_NaN()); | 207 __ Fmov(result_, std::numeric_limits<float>::quiet_NaN()); |
208 } | 208 } |
209 | 209 |
210 private: | 210 private: |
211 DoubleRegister const result_; | 211 DoubleRegister const result_; |
212 }; | 212 }; |
213 | 213 |
214 | 214 |
215 class OutOfLineLoadNaN64 FINAL : public OutOfLineCode { | 215 class OutOfLineLoadNaN64 final : public OutOfLineCode { |
216 public: | 216 public: |
217 OutOfLineLoadNaN64(CodeGenerator* gen, DoubleRegister result) | 217 OutOfLineLoadNaN64(CodeGenerator* gen, DoubleRegister result) |
218 : OutOfLineCode(gen), result_(result) {} | 218 : OutOfLineCode(gen), result_(result) {} |
219 | 219 |
220 void Generate() FINAL { | 220 void Generate() final { |
221 __ Fmov(result_, std::numeric_limits<double>::quiet_NaN()); | 221 __ Fmov(result_, std::numeric_limits<double>::quiet_NaN()); |
222 } | 222 } |
223 | 223 |
224 private: | 224 private: |
225 DoubleRegister const result_; | 225 DoubleRegister const result_; |
226 }; | 226 }; |
227 | 227 |
228 | 228 |
229 class OutOfLineLoadZero FINAL : public OutOfLineCode { | 229 class OutOfLineLoadZero final : public OutOfLineCode { |
230 public: | 230 public: |
231 OutOfLineLoadZero(CodeGenerator* gen, Register result) | 231 OutOfLineLoadZero(CodeGenerator* gen, Register result) |
232 : OutOfLineCode(gen), result_(result) {} | 232 : OutOfLineCode(gen), result_(result) {} |
233 | 233 |
234 void Generate() FINAL { __ Mov(result_, 0); } | 234 void Generate() final { __ Mov(result_, 0); } |
235 | 235 |
236 private: | 236 private: |
237 Register const result_; | 237 Register const result_; |
238 }; | 238 }; |
239 | 239 |
240 | 240 |
241 Condition FlagsConditionToCondition(FlagsCondition condition) { | 241 Condition FlagsConditionToCondition(FlagsCondition condition) { |
242 switch (condition) { | 242 switch (condition) { |
243 case kEqual: | 243 case kEqual: |
244 return eq; | 244 return eq; |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 } | 1277 } |
1278 } | 1278 } |
1279 MarkLazyDeoptSite(); | 1279 MarkLazyDeoptSite(); |
1280 } | 1280 } |
1281 | 1281 |
1282 #undef __ | 1282 #undef __ |
1283 | 1283 |
1284 } // namespace compiler | 1284 } // namespace compiler |
1285 } // namespace internal | 1285 } // namespace internal |
1286 } // namespace v8 | 1286 } // namespace v8 |
OLD | NEW |