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

Side by Side Diff: src/x64/lithium-x64.cc

Issue 6366010: X64 Crankshaft: Added a bunch of operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge/build-x64
Patch Set: Created 9 years, 11 months 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1236 LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx); 1236 LOperand* left = UseFixed(instr->left(), reversed ? rax : rdx);
1237 LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax); 1237 LOperand* right = UseFixed(instr->right(), reversed ? rdx : rax);
1238 LCmpT* result = new LCmpT(left, right); 1238 LCmpT* result = new LCmpT(left, right);
1239 return MarkAsCall(DefineFixed(result, rax), instr); 1239 return MarkAsCall(DefineFixed(result, rax), instr);
1240 } 1240 }
1241 } 1241 }
1242 1242
1243 1243
1244 LInstruction* LChunkBuilder::DoCompareJSObjectEq( 1244 LInstruction* LChunkBuilder::DoCompareJSObjectEq(
1245 HCompareJSObjectEq* instr) { 1245 HCompareJSObjectEq* instr) {
1246 Abort("Unimplemented: %s", "DoCompareJSObjectEq"); 1246 LOperand* left = UseRegisterAtStart(instr->left());
1247 return NULL; 1247 LOperand* right = UseRegisterAtStart(instr->right());
1248 LCmpJSObjectEq* result = new LCmpJSObjectEq(left, right);
1249 return DefineAsRegister(result);
1248 } 1250 }
1249 1251
1250 1252
1251 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) { 1253 LInstruction* LChunkBuilder::DoIsNull(HIsNull* instr) {
1252 Abort("Unimplemented: %s", "DoIsNull"); 1254 ASSERT(instr->value()->representation().IsTagged());
1253 return NULL; 1255 LOperand* value = UseRegisterAtStart(instr->value());
1256
1257 return DefineAsRegister(new LIsNull(value));
1254 } 1258 }
1255 1259
1256 1260
1257 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) { 1261 LInstruction* LChunkBuilder::DoIsObject(HIsObject* instr) {
1258 Abort("Unimplemented: %s", "DoIsObject"); 1262 ASSERT(instr->value()->representation().IsTagged());
1259 return NULL; 1263 LOperand* value = UseRegister(instr->value());
1264
1265 return DefineAsRegister(new LIsObject(value, TempRegister()));
1260 } 1266 }
1261 1267
1262 1268
1263 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) { 1269 LInstruction* LChunkBuilder::DoIsSmi(HIsSmi* instr) {
1264 Abort("Unimplemented: %s", "DoIsSmi"); 1270 ASSERT(instr->value()->representation().IsTagged());
1265 return NULL; 1271 LOperand* value = UseAtStart(instr->value());
1272
1273 return DefineAsRegister(new LIsSmi(value));
1266 } 1274 }
1267 1275
1268 1276
1269 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) { 1277 LInstruction* LChunkBuilder::DoHasInstanceType(HHasInstanceType* instr) {
1270 Abort("Unimplemented: %s", "DoHasInstanceType"); 1278 Abort("Unimplemented: %s", "DoHasInstanceType");
1271 return NULL; 1279 return NULL;
1272 } 1280 }
1273 1281
1274 1282
1275 LInstruction* LChunkBuilder::DoHasCachedArrayIndex( 1283 LInstruction* LChunkBuilder::DoHasCachedArrayIndex(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 } 1317 }
1310 1318
1311 1319
1312 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { 1320 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
1313 Abort("Unimplemented: %s", "DoThrow"); 1321 Abort("Unimplemented: %s", "DoThrow");
1314 return NULL; 1322 return NULL;
1315 } 1323 }
1316 1324
1317 1325
1318 LInstruction* LChunkBuilder::DoChange(HChange* instr) { 1326 LInstruction* LChunkBuilder::DoChange(HChange* instr) {
1319 Abort("Unimplemented: %s", "DoChange"); 1327 Representation from = instr->from();
1328 Representation to = instr->to();
1329 if (from.IsTagged()) {
1330 if (to.IsDouble()) {
1331 LOperand* value = UseRegister(instr->value());
1332 LNumberUntagD* res = new LNumberUntagD(value);
1333 return AssignEnvironment(DefineAsRegister(res));
1334 } else {
1335 ASSERT(to.IsInteger32());
1336 LOperand* value = UseRegister(instr->value());
1337 bool needs_check = !instr->value()->type().IsSmi();
1338 if (needs_check) {
1339 LOperand* xmm_temp =
1340 (instr->CanTruncateToInt32() && CpuFeatures::IsSupported(SSE3))
1341 ? NULL
1342 : FixedTemp(xmm1);
1343 LTaggedToI* res = new LTaggedToI(value, xmm_temp);
1344 return AssignEnvironment(DefineSameAsFirst(res));
1345 } else {
1346 return DefineSameAsFirst(new LSmiUntag(value, needs_check));
1347 }
1348 }
1349 } else if (from.IsDouble()) {
1350 if (to.IsTagged()) {
1351 LOperand* value = UseRegister(instr->value());
1352 LOperand* temp = TempRegister();
1353
1354 // Make sure that temp and result_temp are different registers.
1355 LUnallocated* result_temp = TempRegister();
1356 LNumberTagD* result = new LNumberTagD(value, temp);
1357 return AssignPointerMap(Define(result, result_temp));
1358 } else {
1359 ASSERT(to.IsInteger32());
1360 bool needs_temp = instr->CanTruncateToInt32() &&
1361 !CpuFeatures::IsSupported(SSE3);
1362 LOperand* value = needs_temp ?
1363 UseTempRegister(instr->value()) : UseRegister(instr->value());
1364 LOperand* temp = needs_temp ? TempRegister() : NULL;
1365 return AssignEnvironment(DefineAsRegister(new LDoubleToI(value, temp)));
1366 }
1367 } else if (from.IsInteger32()) {
1368 if (to.IsTagged()) {
1369 HValue* val = instr->value();
1370 LOperand* value = UseRegister(val);
1371 if (val->HasRange() && val->range()->IsInSmiRange()) {
1372 return DefineSameAsFirst(new LSmiTag(value));
1373 } else {
1374 LNumberTagI* result = new LNumberTagI(value);
1375 return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result)));
1376 }
1377 } else {
1378 ASSERT(to.IsDouble());
1379 return DefineAsRegister(new LInteger32ToDouble(Use(instr->value())));
1380 }
1381 }
1382 UNREACHABLE();
1320 return NULL; 1383 return NULL;
1321 } 1384 }
1322 1385
1323 1386
1324 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) { 1387 LInstruction* LChunkBuilder::DoCheckNonSmi(HCheckNonSmi* instr) {
1325 Abort("Unimplemented: %s", "DoCheckNonSmi"); 1388 Abort("Unimplemented: %s", "DoCheckNonSmi");
1326 return NULL; 1389 return NULL;
1327 } 1390 }
1328 1391
1329 1392
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1657
1595 1658
1596 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 1659 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
1597 Abort("Unimplemented: %s", "DoLeaveInlined"); 1660 Abort("Unimplemented: %s", "DoLeaveInlined");
1598 return NULL; 1661 return NULL;
1599 } 1662 }
1600 1663
1601 } } // namespace v8::internal 1664 } } // namespace v8::internal
1602 1665
1603 #endif // V8_TARGET_ARCH_X64 1666 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698