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 1395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 // Do the test only if it hadn't be done above. | 1406 // Do the test only if it hadn't be done above. |
1407 __ cmp(right, Operand::Zero()); | 1407 __ cmp(right, Operand::Zero()); |
1408 } | 1408 } |
1409 __ b(pl, &positive); | 1409 __ b(pl, &positive); |
1410 __ cmp(left, Operand::Zero()); | 1410 __ cmp(left, Operand::Zero()); |
1411 DeoptimizeIf(eq, instr->environment()); | 1411 DeoptimizeIf(eq, instr->environment()); |
1412 __ bind(&positive); | 1412 __ bind(&positive); |
1413 } | 1413 } |
1414 | 1414 |
1415 // Check for (kMinInt / -1). | 1415 // Check for (kMinInt / -1). |
1416 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow)) { | 1416 if (instr->hydrogen()->CheckFlag(HValue::kCanOverflow) && |
| 1417 (!CpuFeatures::IsSupported(SUDIV) || |
| 1418 !instr->hydrogen()->CheckFlag(HValue::kAllUsesTruncatingToInt32))) { |
| 1419 // We don't need to check for overflow when truncating with sdiv |
| 1420 // support because, on ARM, sdiv kMinInt, -1 -> kMinInt. |
1417 Label left_not_min_int; | 1421 Label left_not_min_int; |
1418 __ cmp(left, Operand(kMinInt)); | 1422 __ cmp(left, Operand(kMinInt)); |
1419 __ b(ne, &left_not_min_int); | 1423 __ b(ne, &left_not_min_int); |
1420 __ cmp(right, Operand(-1)); | 1424 __ cmp(right, Operand(-1)); |
1421 DeoptimizeIf(eq, instr->environment()); | 1425 DeoptimizeIf(eq, instr->environment()); |
1422 __ bind(&left_not_min_int); | 1426 __ bind(&left_not_min_int); |
1423 } | 1427 } |
1424 | 1428 |
1425 if (CpuFeatures::IsSupported(SUDIV)) { | 1429 if (CpuFeatures::IsSupported(SUDIV)) { |
1426 CpuFeatureScope scope(masm(), SUDIV); | 1430 CpuFeatureScope scope(masm(), SUDIV); |
(...skipping 4397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5824 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); | 5828 __ sub(scratch, result, Operand::PointerOffsetFromSmiKey(index)); |
5825 __ ldr(result, FieldMemOperand(scratch, | 5829 __ ldr(result, FieldMemOperand(scratch, |
5826 FixedArray::kHeaderSize - kPointerSize)); | 5830 FixedArray::kHeaderSize - kPointerSize)); |
5827 __ bind(&done); | 5831 __ bind(&done); |
5828 } | 5832 } |
5829 | 5833 |
5830 | 5834 |
5831 #undef __ | 5835 #undef __ |
5832 | 5836 |
5833 } } // namespace v8::internal | 5837 } } // namespace v8::internal |
OLD | NEW |