| 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/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 #define kScratchReg r9 | 20 #define kScratchReg r9 |
| 21 | 21 |
| 22 | 22 |
| 23 // Adds Arm-specific methods to convert InstructionOperands. | 23 // Adds Arm-specific methods to convert InstructionOperands. |
| 24 class ArmOperandConverter FINAL : public InstructionOperandConverter { | 24 class ArmOperandConverter final : public InstructionOperandConverter { |
| 25 public: | 25 public: |
| 26 ArmOperandConverter(CodeGenerator* gen, Instruction* instr) | 26 ArmOperandConverter(CodeGenerator* gen, Instruction* instr) |
| 27 : InstructionOperandConverter(gen, instr) {} | 27 : InstructionOperandConverter(gen, instr) {} |
| 28 | 28 |
| 29 SwVfpRegister OutputFloat32Register(size_t index = 0) { | 29 SwVfpRegister OutputFloat32Register(size_t index = 0) { |
| 30 return ToFloat32Register(instr_->OutputAt(index)); | 30 return ToFloat32Register(instr_->OutputAt(index)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 SwVfpRegister InputFloat32Register(size_t index) { | 33 SwVfpRegister InputFloat32Register(size_t index) { |
| 34 return ToFloat32Register(instr_->InputAt(index)); | 34 return ToFloat32Register(instr_->InputAt(index)); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // The linkage computes where all spill slots are located. | 153 // The linkage computes where all spill slots are located. |
| 154 FrameOffset offset = linkage()->GetFrameOffset( | 154 FrameOffset offset = linkage()->GetFrameOffset( |
| 155 AllocatedOperand::cast(op)->index(), frame(), 0); | 155 AllocatedOperand::cast(op)->index(), frame(), 0); |
| 156 return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); | 156 return MemOperand(offset.from_stack_pointer() ? sp : fp, offset.offset()); |
| 157 } | 157 } |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 | 160 |
| 161 namespace { | 161 namespace { |
| 162 | 162 |
| 163 class OutOfLineLoadFloat32 FINAL : public OutOfLineCode { | 163 class OutOfLineLoadFloat32 final : public OutOfLineCode { |
| 164 public: | 164 public: |
| 165 OutOfLineLoadFloat32(CodeGenerator* gen, SwVfpRegister result) | 165 OutOfLineLoadFloat32(CodeGenerator* gen, SwVfpRegister result) |
| 166 : OutOfLineCode(gen), result_(result) {} | 166 : OutOfLineCode(gen), result_(result) {} |
| 167 | 167 |
| 168 void Generate() FINAL { | 168 void Generate() final { |
| 169 __ vmov(result_, std::numeric_limits<float>::quiet_NaN()); | 169 __ vmov(result_, std::numeric_limits<float>::quiet_NaN()); |
| 170 } | 170 } |
| 171 | 171 |
| 172 private: | 172 private: |
| 173 SwVfpRegister const result_; | 173 SwVfpRegister const result_; |
| 174 }; | 174 }; |
| 175 | 175 |
| 176 | 176 |
| 177 class OutOfLineLoadFloat64 FINAL : public OutOfLineCode { | 177 class OutOfLineLoadFloat64 final : public OutOfLineCode { |
| 178 public: | 178 public: |
| 179 OutOfLineLoadFloat64(CodeGenerator* gen, DwVfpRegister result) | 179 OutOfLineLoadFloat64(CodeGenerator* gen, DwVfpRegister result) |
| 180 : OutOfLineCode(gen), result_(result) {} | 180 : OutOfLineCode(gen), result_(result) {} |
| 181 | 181 |
| 182 void Generate() FINAL { | 182 void Generate() final { |
| 183 __ vmov(result_, std::numeric_limits<double>::quiet_NaN(), kScratchReg); | 183 __ vmov(result_, std::numeric_limits<double>::quiet_NaN(), kScratchReg); |
| 184 } | 184 } |
| 185 | 185 |
| 186 private: | 186 private: |
| 187 DwVfpRegister const result_; | 187 DwVfpRegister const result_; |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 | 190 |
| 191 class OutOfLineLoadInteger FINAL : public OutOfLineCode { | 191 class OutOfLineLoadInteger final : public OutOfLineCode { |
| 192 public: | 192 public: |
| 193 OutOfLineLoadInteger(CodeGenerator* gen, Register result) | 193 OutOfLineLoadInteger(CodeGenerator* gen, Register result) |
| 194 : OutOfLineCode(gen), result_(result) {} | 194 : OutOfLineCode(gen), result_(result) {} |
| 195 | 195 |
| 196 void Generate() FINAL { __ mov(result_, Operand::Zero()); } | 196 void Generate() final { __ mov(result_, Operand::Zero()); } |
| 197 | 197 |
| 198 private: | 198 private: |
| 199 Register const result_; | 199 Register const result_; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 | 202 |
| 203 Condition FlagsConditionToCondition(FlagsCondition condition) { | 203 Condition FlagsConditionToCondition(FlagsCondition condition) { |
| 204 switch (condition) { | 204 switch (condition) { |
| 205 case kEqual: | 205 case kEqual: |
| 206 return eq; | 206 return eq; |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 } | 1174 } |
| 1175 } | 1175 } |
| 1176 MarkLazyDeoptSite(); | 1176 MarkLazyDeoptSite(); |
| 1177 } | 1177 } |
| 1178 | 1178 |
| 1179 #undef __ | 1179 #undef __ |
| 1180 | 1180 |
| 1181 } // namespace compiler | 1181 } // namespace compiler |
| 1182 } // namespace internal | 1182 } // namespace internal |
| 1183 } // namespace v8 | 1183 } // namespace v8 |
| OLD | NEW |