| 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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 } | 933 } |
| 934 | 934 |
| 935 | 935 |
| 936 HValue* HUnaryMathOperation::Canonicalize() { | 936 HValue* HUnaryMathOperation::Canonicalize() { |
| 937 if (op() == kMathFloor) { | 937 if (op() == kMathFloor) { |
| 938 // If the input is integer32 then we replace the floor instruction | 938 // If the input is integer32 then we replace the floor instruction |
| 939 // with its input. This happens before the representation changes are | 939 // with its input. This happens before the representation changes are |
| 940 // introduced. | 940 // introduced. |
| 941 if (value()->representation().IsInteger32()) return value(); | 941 if (value()->representation().IsInteger32()) return value(); |
| 942 | 942 |
| 943 #ifdef V8_TARGET_ARCH_ARM | 943 #if defined(V8_TARGET_ARCH_ARM) || defined(V8_TARGET_ARCH_IA32) || \ |
| 944 defined(V8_TARGET_ARCH_X64) |
| 944 if (value()->IsDiv() && (value()->UseCount() == 1)) { | 945 if (value()->IsDiv() && (value()->UseCount() == 1)) { |
| 945 // TODO(2038): Implement this optimization for non ARM architectures. | 946 // TODO(2038): Implement this optimization for non ARM architectures. |
| 946 HDiv* hdiv = HDiv::cast(value()); | 947 HDiv* hdiv = HDiv::cast(value()); |
| 947 HValue* left = hdiv->left(); | 948 HValue* left = hdiv->left(); |
| 948 HValue* right = hdiv->right(); | 949 HValue* right = hdiv->right(); |
| 949 // Try to simplify left and right values of the division. | 950 // Try to simplify left and right values of the division. |
| 950 HValue* new_left = | 951 HValue* new_left = |
| 951 LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(left); | 952 LChunkBuilder::SimplifiedDividendForMathFloorOfDiv(left); |
| 952 HValue* new_right = | 953 HValue* new_right = |
| 953 LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right); | 954 LChunkBuilder::SimplifiedDivisorForMathFloorOfDiv(right); |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2436 | 2437 |
| 2437 | 2438 |
| 2438 void HCheckPrototypeMaps::Verify() { | 2439 void HCheckPrototypeMaps::Verify() { |
| 2439 HInstruction::Verify(); | 2440 HInstruction::Verify(); |
| 2440 ASSERT(HasNoUses()); | 2441 ASSERT(HasNoUses()); |
| 2441 } | 2442 } |
| 2442 | 2443 |
| 2443 #endif | 2444 #endif |
| 2444 | 2445 |
| 2445 } } // namespace v8::internal | 2446 } } // namespace v8::internal |
| OLD | NEW |