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