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

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

Issue 59023003: Generate TypedArrayInitialize builtin in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 years, 1 month 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
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 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 } 1255 }
1256 // Optimize double negation, a common pattern used for ToInt32(x). 1256 // Optimize double negation, a common pattern used for ToInt32(x).
1257 HValue* arg; 1257 HValue* arg;
1258 if (MatchDoubleNegation(this, &arg) && !arg->CheckFlag(kUint32)) { 1258 if (MatchDoubleNegation(this, &arg) && !arg->CheckFlag(kUint32)) {
1259 return arg; 1259 return arg;
1260 } 1260 }
1261 return this; 1261 return this;
1262 } 1262 }
1263 1263
1264 1264
1265 Representation HAdd::RepresentationFromInputs() {
1266 Representation left_rep = left()->representation();
1267 if (left_rep.IsExternal()) {
1268 return Representation::External();
1269 }
1270 return HArithmeticBinaryOperation::RepresentationFromInputs();
1271 }
1272
1273
1274 Representation HAdd::RequiredInputRepresentation(int index) {
1275 if (index == 2) {
1276 Representation left_rep = left()->representation();
1277 if (left_rep.IsExternal()) {
1278 return Representation::Integer32();
1279 }
1280 }
1281 return HArithmeticBinaryOperation::RequiredInputRepresentation(index);
1282 }
1283
1284
1265 static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) { 1285 static bool IsIdentityOperation(HValue* arg1, HValue* arg2, int32_t identity) {
1266 return arg1->representation().IsSpecialization() && 1286 return arg1->representation().IsSpecialization() &&
1267 arg2->EqualsInteger32Constant(identity); 1287 arg2->EqualsInteger32Constant(identity);
1268 } 1288 }
1269 1289
1270 1290
1271 HValue* HAdd::Canonicalize() { 1291 HValue* HAdd::Canonicalize() {
1272 // Adding 0 is an identity operation except in case of -0: -0 + 0 = +0 1292 // Adding 0 is an identity operation except in case of -0: -0 + 0 = +0
1273 if (IsIdentityOperation(left(), right(), 0) && 1293 if (IsIdentityOperation(left(), right(), 0) &&
1274 !left()->representation().IsDouble()) { // Left could be -0. 1294 !left()->representation().IsDouble()) { // Left could be -0.
(...skipping 3099 matching lines...) Expand 10 before | Expand all | Expand 10 after
4374 break; 4394 break;
4375 case kExternalMemory: 4395 case kExternalMemory:
4376 stream->Add("[external-memory]"); 4396 stream->Add("[external-memory]");
4377 break; 4397 break;
4378 } 4398 }
4379 4399
4380 stream->Add("@%d", offset()); 4400 stream->Add("@%d", offset());
4381 } 4401 }
4382 4402
4383 } } // namespace v8::internal 4403 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698