Chromium Code Reviews| Index: src/mips/code-stubs-mips.cc |
| diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
| index 47a0a8ea7930394875b406521881cda289432e48..e7ca6d02bee7fd8c80dda17b7a8809997679d92f 100644 |
| --- a/src/mips/code-stubs-mips.cc |
| +++ b/src/mips/code-stubs-mips.cc |
| @@ -823,10 +823,14 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
| __ Move(double_result, 1.0); |
| // Get absolute value of exponent. |
| - Label positive_exponent; |
| + Label positive_exponent, bail_out; |
| __ Branch(&positive_exponent, ge, scratch, Operand(zero_reg)); |
| __ Subu(scratch, zero_reg, scratch); |
| + // Check when Subu overflows and we get negative result |
| + // (happens only when input is MIN_INT) |
|
akos.palfi.imgtec
2016/07/21 11:23:27
Nit: please put period at the end of the sentence.
ivica.bogosavljevic
2016/07/22 14:45:07
Acknowledged.
|
| + __ BranchShort(&bail_out, gt, zero_reg, Operand(scratch)); |
|
akos.palfi.imgtec
2016/07/21 11:23:27
You should use Branch() instead of BranchShort().
ivica.bogosavljevic
2016/07/22 14:45:07
Acknowledged.
|
| __ bind(&positive_exponent); |
| + __ Assert(ge, kUnexpectedNegativeValue, scratch, Operand(zero_reg)); |
| Label while_true, no_carry, loop_end; |
| __ bind(&while_true); |
| @@ -859,6 +863,7 @@ void MathPowStub::Generate(MacroAssembler* masm) { |
| __ cvt_d_w(double_exponent, single_scratch); |
| // Returning or bailing out. |
| + __ bind(&bail_out); |
| __ push(ra); |
| { |
| AllowExternalCallThatCantCauseGC scope(masm); |