OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2675 __ subsd(scratch, input_reg); | 2675 __ subsd(scratch, input_reg); |
2676 __ andpd(input_reg, scratch); | 2676 __ andpd(input_reg, scratch); |
2677 } else if (r.IsInteger32()) { | 2677 } else if (r.IsInteger32()) { |
2678 EmitIntegerMathAbs(instr); | 2678 EmitIntegerMathAbs(instr); |
2679 } else { // Tagged case. | 2679 } else { // Tagged case. |
2680 DeferredMathAbsTaggedHeapNumber* deferred = | 2680 DeferredMathAbsTaggedHeapNumber* deferred = |
2681 new DeferredMathAbsTaggedHeapNumber(this, instr); | 2681 new DeferredMathAbsTaggedHeapNumber(this, instr); |
2682 Register input_reg = ToRegister(instr->InputAt(0)); | 2682 Register input_reg = ToRegister(instr->InputAt(0)); |
2683 // Smi check. | 2683 // Smi check. |
2684 __ JumpIfNotSmi(input_reg, deferred->entry()); | 2684 __ JumpIfNotSmi(input_reg, deferred->entry()); |
| 2685 __ SmiToInteger32(input_reg, input_reg); |
2685 EmitIntegerMathAbs(instr); | 2686 EmitIntegerMathAbs(instr); |
| 2687 __ Integer32ToSmi(input_reg, input_reg); |
2686 __ bind(deferred->exit()); | 2688 __ bind(deferred->exit()); |
2687 } | 2689 } |
2688 } | 2690 } |
2689 | 2691 |
2690 | 2692 |
2691 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { | 2693 void LCodeGen::DoMathFloor(LUnaryMathOperation* instr) { |
2692 XMMRegister xmm_scratch = xmm0; | 2694 XMMRegister xmm_scratch = xmm0; |
2693 Register output_reg = ToRegister(instr->result()); | 2695 Register output_reg = ToRegister(instr->result()); |
2694 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); | 2696 XMMRegister input_reg = ToDoubleRegister(instr->InputAt(0)); |
2695 | 2697 |
(...skipping 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4014 RegisterEnvironmentForDeoptimization(environment); | 4016 RegisterEnvironmentForDeoptimization(environment); |
4015 ASSERT(osr_pc_offset_ == -1); | 4017 ASSERT(osr_pc_offset_ == -1); |
4016 osr_pc_offset_ = masm()->pc_offset(); | 4018 osr_pc_offset_ = masm()->pc_offset(); |
4017 } | 4019 } |
4018 | 4020 |
4019 #undef __ | 4021 #undef __ |
4020 | 4022 |
4021 } } // namespace v8::internal | 4023 } } // namespace v8::internal |
4022 | 4024 |
4023 #endif // V8_TARGET_ARCH_X64 | 4025 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |