| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 8628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8639 } else if (op == Token::SUB) { | 8639 } else if (op == Token::SUB) { |
| 8640 __ sub(left.reg(), Operand(right.reg())); | 8640 __ sub(left.reg(), Operand(right.reg())); |
| 8641 } else { | 8641 } else { |
| 8642 ASSERT(op == Token::MUL); | 8642 ASSERT(op == Token::MUL); |
| 8643 // We have statically verified that a negative zero can be ignored. | 8643 // We have statically verified that a negative zero can be ignored. |
| 8644 __ imul(left.reg(), Operand(right.reg())); | 8644 __ imul(left.reg(), Operand(right.reg())); |
| 8645 } | 8645 } |
| 8646 } | 8646 } |
| 8647 right.Unuse(); | 8647 right.Unuse(); |
| 8648 frame_->Push(&left); | 8648 frame_->Push(&left); |
| 8649 if (!node->to_int32()) { | 8649 if (!node->to_int32() || op == Token::MUL) { |
| 8650 // If ToInt32 is called on the result of ADD, SUB, or MUL, we don't | 8650 // If ToInt32 is called on the result of ADD, SUB, we don't |
| 8651 // care about overflows. | 8651 // care about overflows. |
| 8652 // Result of MUL can be non-representable precisely in double so |
| 8653 // we have to check for overflow. |
| 8652 unsafe_bailout_->Branch(overflow); | 8654 unsafe_bailout_->Branch(overflow); |
| 8653 } | 8655 } |
| 8654 break; | 8656 break; |
| 8655 case Token::DIV: | 8657 case Token::DIV: |
| 8656 case Token::MOD: { | 8658 case Token::MOD: { |
| 8657 if (right.is_register() && (right.reg().is(eax) || right.reg().is(edx))) { | 8659 if (right.is_register() && (right.reg().is(eax) || right.reg().is(edx))) { |
| 8658 if (left.is_register() && left.reg().is(edi)) { | 8660 if (left.is_register() && left.reg().is(edi)) { |
| 8659 right.ToRegister(ebx); | 8661 right.ToRegister(ebx); |
| 8660 } else { | 8662 } else { |
| 8661 right.ToRegister(edi); | 8663 right.ToRegister(edi); |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10137 masm.GetCode(&desc); | 10139 masm.GetCode(&desc); |
| 10138 // Call the function from C++. | 10140 // Call the function from C++. |
| 10139 return FUNCTION_CAST<MemCopyFunction>(buffer); | 10141 return FUNCTION_CAST<MemCopyFunction>(buffer); |
| 10140 } | 10142 } |
| 10141 | 10143 |
| 10142 #undef __ | 10144 #undef __ |
| 10143 | 10145 |
| 10144 } } // namespace v8::internal | 10146 } } // namespace v8::internal |
| 10145 | 10147 |
| 10146 #endif // V8_TARGET_ARCH_IA32 | 10148 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |