OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 | 1208 |
1209 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI. | 1209 // TODO(svenpanne) Refactor this to avoid code duplication with DoFlooringDivI. |
1210 void LCodeGen::DoDivI(LDivI* instr) { | 1210 void LCodeGen::DoDivI(LDivI* instr) { |
1211 HBinaryOperation* hdiv = instr->hydrogen(); | 1211 HBinaryOperation* hdiv = instr->hydrogen(); |
1212 Register dividend = ToRegister(instr->dividend()); | 1212 Register dividend = ToRegister(instr->dividend()); |
1213 Register divisor = ToRegister(instr->divisor()); | 1213 Register divisor = ToRegister(instr->divisor()); |
1214 const Register result = ToRegister(instr->result()); | 1214 const Register result = ToRegister(instr->result()); |
1215 | 1215 |
1216 // On MIPS div is asynchronous - it will run in the background while we | 1216 // On MIPS div is asynchronous - it will run in the background while we |
1217 // check for special cases. | 1217 // check for special cases. |
1218 __ Ddiv(result, dividend, divisor); | 1218 __ Div(result, dividend, divisor); |
1219 | 1219 |
1220 // Check for x / 0. | 1220 // Check for x / 0. |
1221 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { | 1221 if (hdiv->CheckFlag(HValue::kCanBeDivByZero)) { |
1222 DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, | 1222 DeoptimizeIf(eq, instr, Deoptimizer::kDivisionByZero, divisor, |
1223 Operand(zero_reg)); | 1223 Operand(zero_reg)); |
1224 } | 1224 } |
1225 | 1225 |
1226 // Check for (0 / -x) that will produce negative zero. | 1226 // Check for (0 / -x) that will produce negative zero. |
1227 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { | 1227 if (hdiv->CheckFlag(HValue::kBailoutOnMinusZero)) { |
1228 Label left_not_zero; | 1228 Label left_not_zero; |
(...skipping 5013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6242 __ Push(at, ToRegister(instr->function())); | 6242 __ Push(at, ToRegister(instr->function())); |
6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6243 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6244 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6244 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6245 } | 6245 } |
6246 | 6246 |
6247 | 6247 |
6248 #undef __ | 6248 #undef __ |
6249 | 6249 |
6250 } // namespace internal | 6250 } // namespace internal |
6251 } // namespace v8 | 6251 } // namespace v8 |
OLD | NEW |