| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 3607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3618 } | 3618 } |
| 3619 | 3619 |
| 3620 | 3620 |
| 3621 void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { | 3621 void LCodeGen::EmitIntegerMathAbs(LMathAbs* instr) { |
| 3622 Register input = ToRegister(instr->value()); | 3622 Register input = ToRegister(instr->value()); |
| 3623 Register result = ToRegister(instr->result()); | 3623 Register result = ToRegister(instr->result()); |
| 3624 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); | 3624 Assembler::BlockTrampolinePoolScope block_trampoline_pool(masm_); |
| 3625 Label done; | 3625 Label done; |
| 3626 __ Branch(USE_DELAY_SLOT, &done, ge, input, Operand(zero_reg)); | 3626 __ Branch(USE_DELAY_SLOT, &done, ge, input, Operand(zero_reg)); |
| 3627 __ mov(result, input); | 3627 __ mov(result, input); |
| 3628 __ subu(result, zero_reg, input); |
| 3628 // Overflow if result is still negative, i.e. 0x80000000. | 3629 // Overflow if result is still negative, i.e. 0x80000000. |
| 3629 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); | 3630 DeoptimizeIf(lt, instr->environment(), result, Operand(zero_reg)); |
| 3630 __ bind(&done); | 3631 __ bind(&done); |
| 3631 } | 3632 } |
| 3632 | 3633 |
| 3633 | 3634 |
| 3634 void LCodeGen::DoMathAbs(LMathAbs* instr) { | 3635 void LCodeGen::DoMathAbs(LMathAbs* instr) { |
| 3635 // Class for deferred case. | 3636 // Class for deferred case. |
| 3636 class DeferredMathAbsTaggedHeapNumber: public LDeferredCode { | 3637 class DeferredMathAbsTaggedHeapNumber: public LDeferredCode { |
| 3637 public: | 3638 public: |
| (...skipping 2210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5848 __ Subu(scratch, result, scratch); | 5849 __ Subu(scratch, result, scratch); |
| 5849 __ lw(result, FieldMemOperand(scratch, | 5850 __ lw(result, FieldMemOperand(scratch, |
| 5850 FixedArray::kHeaderSize - kPointerSize)); | 5851 FixedArray::kHeaderSize - kPointerSize)); |
| 5851 __ bind(&done); | 5852 __ bind(&done); |
| 5852 } | 5853 } |
| 5853 | 5854 |
| 5854 | 5855 |
| 5855 #undef __ | 5856 #undef __ |
| 5856 | 5857 |
| 5857 } } // namespace v8::internal | 5858 } } // namespace v8::internal |
| OLD | NEW |