OLD | NEW |
---|---|
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 5316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5327 // Do multiplication | 5327 // Do multiplication |
5328 __ smull(r3, r2, r1, ip); // r3 = lower 32 bits of ip*r1. | 5328 __ smull(r3, r2, r1, ip); // r3 = lower 32 bits of ip*r1. |
5329 // Go slow on overflows (overflow bit is not set). | 5329 // Go slow on overflows (overflow bit is not set). |
5330 __ mov(ip, Operand(r3, ASR, 31)); | 5330 __ mov(ip, Operand(r3, ASR, 31)); |
5331 __ cmp(ip, Operand(r2)); // no overflow if higher 33 bits are identical | 5331 __ cmp(ip, Operand(r2)); // no overflow if higher 33 bits are identical |
5332 __ b(ne, &slow); | 5332 __ b(ne, &slow); |
5333 // Go slow on zero result to handle -0. | 5333 // Go slow on zero result to handle -0. |
5334 __ tst(r3, Operand(r3)); | 5334 __ tst(r3, Operand(r3)); |
5335 __ mov(r0, Operand(r3), LeaveCC, ne); | 5335 __ mov(r0, Operand(r3), LeaveCC, ne); |
5336 __ Ret(ne); | 5336 __ Ret(ne); |
5337 // Slow case. | 5337 // We need -0 if we were multiplying a negative number with 0 to get 0. |
5338 // We know one of them was zero. | |
5339 __ add(r2, r0, Operand(r1), SetCC); | |
5340 __ mov(r0, Operand(Smi::FromInt(0)), LeaveCC, pl); | |
Lasse Reichstein
2009/07/01 11:11:14
Is it more efficient to use r3 instead of Operand(
Erik Corry
2009/07/01 11:31:05
I'm fairly certain it makes no difference, so I th
| |
5341 __ Ret(pl); // Return Smi 0 if the non-zero one was positive. | |
5342 // Slow case. We fall through here if we multiplied a negative number | |
5343 // with 0, because that would mean we should produce -0. | |
5338 __ bind(&slow); | 5344 __ bind(&slow); |
5339 | 5345 |
5340 HandleBinaryOpSlowCases(masm, | 5346 HandleBinaryOpSlowCases(masm, |
5341 ¬_smi, | 5347 ¬_smi, |
5342 Builtins::MUL, | 5348 Builtins::MUL, |
5343 Token::MUL, | 5349 Token::MUL, |
5344 mode_); | 5350 mode_); |
5345 break; | 5351 break; |
5346 } | 5352 } |
5347 | 5353 |
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6043 int CompareStub::MinorKey() { | 6049 int CompareStub::MinorKey() { |
6044 // Encode the two parameters in a unique 16 bit value. | 6050 // Encode the two parameters in a unique 16 bit value. |
6045 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6051 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6046 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6052 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6047 } | 6053 } |
6048 | 6054 |
6049 | 6055 |
6050 #undef __ | 6056 #undef __ |
6051 | 6057 |
6052 } } // namespace v8::internal | 6058 } } // namespace v8::internal |
OLD | NEW |