| 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 3758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3769 virtual LInstruction* instr() { return instr_; } | 3769 virtual LInstruction* instr() { return instr_; } |
| 3770 private: | 3770 private: |
| 3771 LMathAbs* instr_; | 3771 LMathAbs* instr_; |
| 3772 }; | 3772 }; |
| 3773 | 3773 |
| 3774 Representation r = instr->hydrogen()->value()->representation(); | 3774 Representation r = instr->hydrogen()->value()->representation(); |
| 3775 if (r.IsDouble()) { | 3775 if (r.IsDouble()) { |
| 3776 DwVfpRegister input = ToDoubleRegister(instr->value()); | 3776 DwVfpRegister input = ToDoubleRegister(instr->value()); |
| 3777 DwVfpRegister result = ToDoubleRegister(instr->result()); | 3777 DwVfpRegister result = ToDoubleRegister(instr->result()); |
| 3778 __ vabs(result, input); | 3778 __ vabs(result, input); |
| 3779 } else if (r.IsInteger32()) { | 3779 } else if (r.IsSmiOrInteger32()) { |
| 3780 EmitIntegerMathAbs(instr); | 3780 EmitIntegerMathAbs(instr); |
| 3781 } else { | 3781 } else { |
| 3782 // Representation is tagged. | 3782 // Representation is tagged. |
| 3783 DeferredMathAbsTaggedHeapNumber* deferred = | 3783 DeferredMathAbsTaggedHeapNumber* deferred = |
| 3784 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); | 3784 new(zone()) DeferredMathAbsTaggedHeapNumber(this, instr); |
| 3785 Register input = ToRegister(instr->value()); | 3785 Register input = ToRegister(instr->value()); |
| 3786 // Smi check. | 3786 // Smi check. |
| 3787 __ JumpIfNotSmi(input, deferred->entry()); | 3787 __ JumpIfNotSmi(input, deferred->entry()); |
| 3788 // If smi, handle it directly. | 3788 // If smi, handle it directly. |
| 3789 EmitIntegerMathAbs(instr); | 3789 EmitIntegerMathAbs(instr); |
| (...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5838 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
| 5839 __ ldr(result, FieldMemOperand(scratch, | 5839 __ ldr(result, FieldMemOperand(scratch, |
| 5840 FixedArray::kHeaderSize - kPointerSize)); | 5840 FixedArray::kHeaderSize - kPointerSize)); |
| 5841 __ bind(&done); | 5841 __ bind(&done); |
| 5842 } | 5842 } |
| 5843 | 5843 |
| 5844 | 5844 |
| 5845 #undef __ | 5845 #undef __ |
| 5846 | 5846 |
| 5847 } } // namespace v8::internal | 5847 } } // namespace v8::internal |
| OLD | NEW |