Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 109213005: Merged r17432, r17526, r17545, r17620, r17747 into 3.20 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.20
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 } 1199 }
1200 1200
1201 1201
1202 static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) { 1202 static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) {
1203 return arg1->representation().IsSpecialization() && 1203 return arg1->representation().IsSpecialization() &&
1204 arg2->EqualsInteger32Constant(identity); 1204 arg2->EqualsInteger32Constant(identity);
1205 } 1205 }
1206 1206
1207 1207
1208 HValue* HAdd::Canonicalize() { 1208 HValue* HAdd::Canonicalize() {
1209 if (IsIdentityOperation(left(), right(), 0)) return left(); 1209 // Adding 0 is an identity operation except in case of -0: -0 + 0 = +0
1210 if (IsIdentityOperation(right(), left(), 0)) return right(); 1210 if (IsIdentityOperation(left(), right(), 0) &&
1211 !left()->representation().IsDouble()) { // Left could be -0.
1212 return left();
1213 }
1214 if (IsIdentityOperation(right(), left(), 0) &&
1215 !left()->representation().IsDouble()) { // Right could be -0.
1216 return right();
1217 }
1211 return this; 1218 return this;
1212 } 1219 }
1213 1220
1214 1221
1215 HValue* HSub::Canonicalize() { 1222 HValue* HSub::Canonicalize() {
1216 if (IsIdentityOperation(left(), right(), 0)) return left(); 1223 if (IsIdentityOperation(left(), right(), 0)) return left();
1217 return this; 1224 return this;
1218 } 1225 }
1219 1226
1220 1227
(...skipping 2952 matching lines...) Expand 10 before | Expand all | Expand 10 after
4173 break; 4180 break;
4174 case kExternalMemory: 4181 case kExternalMemory:
4175 stream->Add("[external-memory]"); 4182 stream->Add("[external-memory]");
4176 break; 4183 break;
4177 } 4184 }
4178 4185
4179 stream->Add("@%d", offset()); 4186 stream->Add("@%d", offset());
4180 } 4187 }
4181 4188
4182 } } // namespace v8::internal 4189 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698