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 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 return this; | 1224 return this; |
1225 } | 1225 } |
1226 | 1226 |
1227 | 1227 |
1228 HValue* HMod::Canonicalize() { | 1228 HValue* HMod::Canonicalize() { |
1229 return this; | 1229 return this; |
1230 } | 1230 } |
1231 | 1231 |
1232 | 1232 |
1233 HValue* HDiv::Canonicalize() { | 1233 HValue* HDiv::Canonicalize() { |
| 1234 if (IsIdentityOperation(left(), right(), 1)) return left(); |
1234 return this; | 1235 return this; |
1235 } | 1236 } |
1236 | 1237 |
1237 | 1238 |
1238 HValue* HChange::Canonicalize() { | 1239 HValue* HChange::Canonicalize() { |
1239 return (from().Equals(to())) ? value() : this; | 1240 return (from().Equals(to())) ? value() : this; |
1240 } | 1241 } |
1241 | 1242 |
1242 | 1243 |
1243 HValue* HWrapReceiver::Canonicalize() { | 1244 HValue* HWrapReceiver::Canonicalize() { |
(...skipping 2753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3997 break; | 3998 break; |
3998 case kExternalMemory: | 3999 case kExternalMemory: |
3999 stream->Add("[external-memory]"); | 4000 stream->Add("[external-memory]"); |
4000 break; | 4001 break; |
4001 } | 4002 } |
4002 | 4003 |
4003 stream->Add("@%d", offset()); | 4004 stream->Add("@%d", offset()); |
4004 } | 4005 } |
4005 | 4006 |
4006 } } // namespace v8::internal | 4007 } } // namespace v8::internal |
OLD | NEW |