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

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

Issue 9227007: Version 3.8.6 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 8 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
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 return result; 1026 return result;
1027 } 1027 }
1028 1028
1029 1029
1030 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) { 1030 LInstruction* LChunkBuilder::DoGoto(HGoto* instr) {
1031 return new LGoto(instr->FirstSuccessor()->block_id()); 1031 return new LGoto(instr->FirstSuccessor()->block_id());
1032 } 1032 }
1033 1033
1034 1034
1035 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) { 1035 LInstruction* LChunkBuilder::DoBranch(HBranch* instr) {
1036 HValue* v = instr->value(); 1036 HValue* value = instr->value();
1037 if (v->EmitAtUses()) { 1037 if (value->EmitAtUses()) {
1038 ASSERT(v->IsConstant()); 1038 ASSERT(value->IsConstant());
1039 ASSERT(!v->representation().IsDouble()); 1039 ASSERT(!value->representation().IsDouble());
1040 HBasicBlock* successor = HConstant::cast(v)->ToBoolean() 1040 HBasicBlock* successor = HConstant::cast(value)->ToBoolean()
1041 ? instr->FirstSuccessor() 1041 ? instr->FirstSuccessor()
1042 : instr->SecondSuccessor(); 1042 : instr->SecondSuccessor();
1043 return new LGoto(successor->block_id()); 1043 return new LGoto(successor->block_id());
1044 } 1044 }
1045 return AssignEnvironment(new LBranch(UseRegister(v))); 1045
1046 LBranch* result = new LBranch(UseRegister(value));
1047 // Tagged values that are not known smis or booleans require a
1048 // deoptimization environment.
1049 Representation rep = value->representation();
1050 HType type = value->type();
1051 if (rep.IsTagged() && !type.IsSmi() && !type.IsBoolean()) {
1052 return AssignEnvironment(result);
1053 }
1054 return result;
1046 } 1055 }
1047 1056
1048 1057
1049 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) { 1058 LInstruction* LChunkBuilder::DoCompareMap(HCompareMap* instr) {
1050 ASSERT(instr->value()->representation().IsTagged()); 1059 ASSERT(instr->value()->representation().IsTagged());
1051 LOperand* value = UseRegisterAtStart(instr->value()); 1060 LOperand* value = UseRegisterAtStart(instr->value());
1052 return new LCmpMapAndBranch(value); 1061 return new LCmpMapAndBranch(value);
1053 } 1062 }
1054 1063
1055 1064
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 } 1331 }
1323 1332
1324 1333
1325 LInstruction* LChunkBuilder::DoMul(HMul* instr) { 1334 LInstruction* LChunkBuilder::DoMul(HMul* instr) {
1326 if (instr->representation().IsInteger32()) { 1335 if (instr->representation().IsInteger32()) {
1327 ASSERT(instr->left()->representation().IsInteger32()); 1336 ASSERT(instr->left()->representation().IsInteger32());
1328 ASSERT(instr->right()->representation().IsInteger32()); 1337 ASSERT(instr->right()->representation().IsInteger32());
1329 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand()); 1338 LOperand* left = UseRegisterAtStart(instr->LeastConstantOperand());
1330 LOperand* right = UseOrConstant(instr->MostConstantOperand()); 1339 LOperand* right = UseOrConstant(instr->MostConstantOperand());
1331 LMulI* mul = new LMulI(left, right); 1340 LMulI* mul = new LMulI(left, right);
1332 return AssignEnvironment(DefineSameAsFirst(mul)); 1341 if (instr->CheckFlag(HValue::kCanOverflow) ||
1342 instr->CheckFlag(HValue::kBailoutOnMinusZero)) {
1343 AssignEnvironment(mul);
1344 }
1345 return DefineSameAsFirst(mul);
1333 } else if (instr->representation().IsDouble()) { 1346 } else if (instr->representation().IsDouble()) {
1334 return DoArithmeticD(Token::MUL, instr); 1347 return DoArithmeticD(Token::MUL, instr);
1335 } else { 1348 } else {
1336 ASSERT(instr->representation().IsTagged()); 1349 ASSERT(instr->representation().IsTagged());
1337 return DoArithmeticT(Token::MUL, instr); 1350 return DoArithmeticT(Token::MUL, instr);
1338 } 1351 }
1339 } 1352 }
1340 1353
1341 1354
1342 LInstruction* LChunkBuilder::DoSub(HSub* instr) { 1355 LInstruction* LChunkBuilder::DoSub(HSub* instr) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
1395 UseFixed(instr->right(), rdx); 1408 UseFixed(instr->right(), rdx);
1396 #else 1409 #else
1397 UseFixed(instr->right(), rdi); 1410 UseFixed(instr->right(), rdi);
1398 #endif 1411 #endif
1399 LPower* result = new LPower(left, right); 1412 LPower* result = new LPower(left, right);
1400 return MarkAsCall(DefineFixedDouble(result, xmm3), instr, 1413 return MarkAsCall(DefineFixedDouble(result, xmm3), instr,
1401 CAN_DEOPTIMIZE_EAGERLY); 1414 CAN_DEOPTIMIZE_EAGERLY);
1402 } 1415 }
1403 1416
1404 1417
1418 LInstruction* LChunkBuilder::DoRandom(HRandom* instr) {
1419 ASSERT(instr->representation().IsDouble());
1420 ASSERT(instr->global_object()->representation().IsTagged());
1421 #ifdef _WIN64
1422 LOperand* global_object = UseFixed(instr->global_object(), rcx);
1423 #else
1424 LOperand* global_object = UseFixed(instr->global_object(), rdi);
1425 #endif
1426 LRandom* result = new LRandom(global_object);
1427 return MarkAsCall(DefineFixedDouble(result, xmm1), instr);
1428 }
1429
1430
1405 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) { 1431 LInstruction* LChunkBuilder::DoCompareGeneric(HCompareGeneric* instr) {
1406 ASSERT(instr->left()->representation().IsTagged()); 1432 ASSERT(instr->left()->representation().IsTagged());
1407 ASSERT(instr->right()->representation().IsTagged()); 1433 ASSERT(instr->right()->representation().IsTagged());
1408 LOperand* left = UseFixed(instr->left(), rdx); 1434 LOperand* left = UseFixed(instr->left(), rdx);
1409 LOperand* right = UseFixed(instr->right(), rax); 1435 LOperand* right = UseFixed(instr->right(), rax);
1410 LCmpT* result = new LCmpT(left, right); 1436 LCmpT* result = new LCmpT(left, right);
1411 return MarkAsCall(DefineFixed(result, rax), instr); 1437 return MarkAsCall(DefineFixed(result, rax), instr);
1412 } 1438 }
1413 1439
1414 1440
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 1544
1519 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch( 1545 LInstruction* LChunkBuilder::DoHasCachedArrayIndexAndBranch(
1520 HHasCachedArrayIndexAndBranch* instr) { 1546 HHasCachedArrayIndexAndBranch* instr) {
1521 ASSERT(instr->value()->representation().IsTagged()); 1547 ASSERT(instr->value()->representation().IsTagged());
1522 return new LHasCachedArrayIndexAndBranch(UseRegisterAtStart(instr->value())); 1548 return new LHasCachedArrayIndexAndBranch(UseRegisterAtStart(instr->value()));
1523 } 1549 }
1524 1550
1525 1551
1526 LInstruction* LChunkBuilder::DoClassOfTestAndBranch( 1552 LInstruction* LChunkBuilder::DoClassOfTestAndBranch(
1527 HClassOfTestAndBranch* instr) { 1553 HClassOfTestAndBranch* instr) {
1528 return new LClassOfTestAndBranch(UseTempRegister(instr->value()), 1554 return new LClassOfTestAndBranch(UseRegister(instr->value()),
1529 TempRegister(), 1555 TempRegister(),
1530 TempRegister()); 1556 TempRegister());
1531 } 1557 }
1532 1558
1533 1559
1534 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) { 1560 LInstruction* LChunkBuilder::DoJSArrayLength(HJSArrayLength* instr) {
1535 LOperand* array = UseRegisterAtStart(instr->value()); 1561 LOperand* array = UseRegisterAtStart(instr->value());
1536 return DefineAsRegister(new LJSArrayLength(array)); 1562 return DefineAsRegister(new LJSArrayLength(array));
1537 } 1563 }
1538 1564
1539 1565
1540 LInstruction* LChunkBuilder::DoFixedArrayBaseLength( 1566 LInstruction* LChunkBuilder::DoFixedArrayBaseLength(
1541 HFixedArrayBaseLength* instr) { 1567 HFixedArrayBaseLength* instr) {
1542 LOperand* array = UseRegisterAtStart(instr->value()); 1568 LOperand* array = UseRegisterAtStart(instr->value());
1543 return DefineAsRegister(new LFixedArrayBaseLength(array)); 1569 return DefineAsRegister(new LFixedArrayBaseLength(array));
1544 } 1570 }
1545 1571
1546 1572
1547 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) { 1573 LInstruction* LChunkBuilder::DoElementsKind(HElementsKind* instr) {
1548 LOperand* object = UseRegisterAtStart(instr->value()); 1574 LOperand* object = UseRegisterAtStart(instr->value());
1549 return DefineAsRegister(new LElementsKind(object)); 1575 return DefineAsRegister(new LElementsKind(object));
1550 } 1576 }
1551 1577
1552 1578
1553 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) { 1579 LInstruction* LChunkBuilder::DoValueOf(HValueOf* instr) {
1554 LOperand* object = UseRegister(instr->value()); 1580 LOperand* object = UseRegister(instr->value());
1555 LValueOf* result = new LValueOf(object); 1581 LValueOf* result = new LValueOf(object);
1556 return AssignEnvironment(DefineSameAsFirst(result)); 1582 return DefineSameAsFirst(result);
1557 } 1583 }
1558 1584
1559 1585
1560 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { 1586 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) {
1561 return AssignEnvironment(new LBoundsCheck( 1587 return AssignEnvironment(new LBoundsCheck(
1562 UseRegisterOrConstantAtStart(instr->index()), 1588 UseRegisterOrConstantAtStart(instr->index()),
1563 Use(instr->length()))); 1589 Use(instr->length())));
1564 } 1590 }
1565 1591
1566 1592
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 } 1885 }
1860 1886
1861 1887
1862 LInstruction* LChunkBuilder::DoLoadKeyedFastElement( 1888 LInstruction* LChunkBuilder::DoLoadKeyedFastElement(
1863 HLoadKeyedFastElement* instr) { 1889 HLoadKeyedFastElement* instr) {
1864 ASSERT(instr->representation().IsTagged()); 1890 ASSERT(instr->representation().IsTagged());
1865 ASSERT(instr->key()->representation().IsInteger32()); 1891 ASSERT(instr->key()->representation().IsInteger32());
1866 LOperand* obj = UseRegisterAtStart(instr->object()); 1892 LOperand* obj = UseRegisterAtStart(instr->object());
1867 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 1893 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1868 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key); 1894 LLoadKeyedFastElement* result = new LLoadKeyedFastElement(obj, key);
1869 return AssignEnvironment(DefineAsRegister(result)); 1895 if (instr->RequiresHoleCheck()) AssignEnvironment(result);
1896 return DefineAsRegister(result);
1870 } 1897 }
1871 1898
1872 1899
1873 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( 1900 LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement(
1874 HLoadKeyedFastDoubleElement* instr) { 1901 HLoadKeyedFastDoubleElement* instr) {
1875 ASSERT(instr->representation().IsDouble()); 1902 ASSERT(instr->representation().IsDouble());
1876 ASSERT(instr->key()->representation().IsInteger32()); 1903 ASSERT(instr->key()->representation().IsInteger32());
1877 LOperand* elements = UseRegisterAtStart(instr->elements()); 1904 LOperand* elements = UseRegisterAtStart(instr->elements());
1878 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); 1905 LOperand* key = UseRegisterOrConstantAtStart(instr->key());
1879 LLoadKeyedFastDoubleElement* result = 1906 LLoadKeyedFastDoubleElement* result =
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 LOperand* key = UseOrConstantAtStart(instr->key()); 2265 LOperand* key = UseOrConstantAtStart(instr->key());
2239 LOperand* object = UseOrConstantAtStart(instr->object()); 2266 LOperand* object = UseOrConstantAtStart(instr->object());
2240 LIn* result = new LIn(key, object); 2267 LIn* result = new LIn(key, object);
2241 return MarkAsCall(DefineFixed(result, rax), instr); 2268 return MarkAsCall(DefineFixed(result, rax), instr);
2242 } 2269 }
2243 2270
2244 2271
2245 } } // namespace v8::internal 2272 } } // namespace v8::internal
2246 2273
2247 #endif // V8_TARGET_ARCH_X64 2274 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/lithium-x64.h ('k') | src/x64/macro-assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698