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

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

Issue 8139027: Version 3.6.5 (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: '' Created 9 years, 2 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/hydrogen-instructions.h ('k') | src/ia32/assembler-ia32.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 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 stream->Add(")"); 700 stream->Add(")");
701 } 701 }
702 702
703 703
704 void HUnaryControlInstruction::PrintDataTo(StringStream* stream) { 704 void HUnaryControlInstruction::PrintDataTo(StringStream* stream) {
705 value()->PrintNameTo(stream); 705 value()->PrintNameTo(stream);
706 HControlInstruction::PrintDataTo(stream); 706 HControlInstruction::PrintDataTo(stream);
707 } 707 }
708 708
709 709
710 void HIsNilAndBranch::PrintDataTo(StringStream* stream) {
711 value()->PrintNameTo(stream);
712 stream->Add(kind() == kStrictEquality ? " === " : " == ");
713 stream->Add(nil() == kNullValue ? "null" : "undefined");
714 HControlInstruction::PrintDataTo(stream);
715 }
716
717
710 void HReturn::PrintDataTo(StringStream* stream) { 718 void HReturn::PrintDataTo(StringStream* stream) {
711 value()->PrintNameTo(stream); 719 value()->PrintNameTo(stream);
712 } 720 }
713 721
714 722
715 void HCompareMap::PrintDataTo(StringStream* stream) { 723 void HCompareMap::PrintDataTo(StringStream* stream) {
716 value()->PrintNameTo(stream); 724 value()->PrintNameTo(stream);
717 stream->Add(" (%p)", *map()); 725 stream->Add(" (%p)", *map());
718 HControlInstruction::PrintDataTo(stream); 726 HControlInstruction::PrintDataTo(stream);
719 } 727 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 default: 778 default:
771 break; 779 break;
772 } 780 }
773 } 781 }
774 782
775 783
776 void HTypeofIsAndBranch::PrintDataTo(StringStream* stream) { 784 void HTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
777 value()->PrintNameTo(stream); 785 value()->PrintNameTo(stream);
778 stream->Add(" == "); 786 stream->Add(" == ");
779 stream->Add(type_literal_->GetFlatContent().ToAsciiVector()); 787 stream->Add(type_literal_->GetFlatContent().ToAsciiVector());
788 HControlInstruction::PrintDataTo(stream);
789 }
790
791
792 void HTypeof::PrintDataTo(StringStream* stream) {
793 value()->PrintNameTo(stream);
780 } 794 }
781 795
782 796
783 void HChange::PrintDataTo(StringStream* stream) { 797 void HChange::PrintDataTo(StringStream* stream) {
784 HUnaryOperation::PrintDataTo(stream); 798 HUnaryOperation::PrintDataTo(stream);
785 stream->Add(" %s to %s", from_.Mnemonic(), to().Mnemonic()); 799 stream->Add(" %s to %s", from().Mnemonic(), to().Mnemonic());
786 800
787 if (CanTruncateToInt32()) stream->Add(" truncating-int32"); 801 if (CanTruncateToInt32()) stream->Add(" truncating-int32");
788 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); 802 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
803 if (CheckFlag(kDeoptimizeOnUndefined)) stream->Add(" deopt-on-undefined");
789 } 804 }
790 805
791 806
792 void HJSArrayLength::PrintDataTo(StringStream* stream) { 807 void HJSArrayLength::PrintDataTo(StringStream* stream) {
793 value()->PrintNameTo(stream); 808 value()->PrintNameTo(stream);
794 stream->Add(" "); 809 stream->Add(" ");
795 typecheck()->PrintNameTo(stream); 810 typecheck()->PrintNameTo(stream);
796 } 811 }
797 812
798 813
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 stream->Add(" %p", *map()); 865 stream->Add(" %p", *map());
851 } 866 }
852 867
853 868
854 void HCheckFunction::PrintDataTo(StringStream* stream) { 869 void HCheckFunction::PrintDataTo(StringStream* stream) {
855 value()->PrintNameTo(stream); 870 value()->PrintNameTo(stream);
856 stream->Add(" %p", *target()); 871 stream->Add(" %p", *target());
857 } 872 }
858 873
859 874
875 const char* HCheckInstanceType::GetCheckName() {
876 switch (check_) {
877 case IS_SPEC_OBJECT: return "object";
878 case IS_JS_ARRAY: return "array";
879 case IS_STRING: return "string";
880 case IS_SYMBOL: return "symbol";
881 }
882 UNREACHABLE();
883 return "";
884 }
885
886 void HCheckInstanceType::PrintDataTo(StringStream* stream) {
887 stream->Add("%s ", GetCheckName());
888 HUnaryOperation::PrintDataTo(stream);
889 }
890
891
860 void HCallStub::PrintDataTo(StringStream* stream) { 892 void HCallStub::PrintDataTo(StringStream* stream) {
861 stream->Add("%s ", 893 stream->Add("%s ",
862 CodeStub::MajorName(major_key_, false)); 894 CodeStub::MajorName(major_key_, false));
863 HUnaryCall::PrintDataTo(stream); 895 HUnaryCall::PrintDataTo(stream);
864 } 896 }
865 897
866 898
867 void HInstanceOf::PrintDataTo(StringStream* stream) { 899 void HInstanceOf::PrintDataTo(StringStream* stream) {
868 left()->PrintNameTo(stream); 900 left()->PrintNameTo(stream);
869 stream->Add(" "); 901 stream->Add(" ");
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 void HCompareIDAndBranch::PrintDataTo(StringStream* stream) { 1336 void HCompareIDAndBranch::PrintDataTo(StringStream* stream) {
1305 stream->Add(Token::Name(token())); 1337 stream->Add(Token::Name(token()));
1306 stream->Add(" "); 1338 stream->Add(" ");
1307 left()->PrintNameTo(stream); 1339 left()->PrintNameTo(stream);
1308 stream->Add(" "); 1340 stream->Add(" ");
1309 right()->PrintNameTo(stream); 1341 right()->PrintNameTo(stream);
1310 HControlInstruction::PrintDataTo(stream); 1342 HControlInstruction::PrintDataTo(stream);
1311 } 1343 }
1312 1344
1313 1345
1346 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) {
1347 left()->PrintNameTo(stream);
1348 stream->Add(" ");
1349 right()->PrintNameTo(stream);
1350 HControlInstruction::PrintDataTo(stream);
1351 }
1352
1353
1314 void HGoto::PrintDataTo(StringStream* stream) { 1354 void HGoto::PrintDataTo(StringStream* stream) {
1315 stream->Add("B%d", SuccessorAt(0)->block_id()); 1355 stream->Add("B%d", SuccessorAt(0)->block_id());
1316 } 1356 }
1317 1357
1318 1358
1319 void HCompareIDAndBranch::SetInputRepresentation(Representation r) { 1359 void HCompareIDAndBranch::SetInputRepresentation(Representation r) {
1320 input_representation_ = r; 1360 input_representation_ = r;
1321 if (r.IsDouble()) { 1361 if (r.IsDouble()) {
1322 SetFlag(kDeoptimizeOnUndefined); 1362 SetFlag(kDeoptimizeOnUndefined);
1323 } else { 1363 } else {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
1418 1458
1419 1459
1420 void HLoadKeyedFastElement::PrintDataTo(StringStream* stream) { 1460 void HLoadKeyedFastElement::PrintDataTo(StringStream* stream) {
1421 object()->PrintNameTo(stream); 1461 object()->PrintNameTo(stream);
1422 stream->Add("["); 1462 stream->Add("[");
1423 key()->PrintNameTo(stream); 1463 key()->PrintNameTo(stream);
1424 stream->Add("]"); 1464 stream->Add("]");
1425 } 1465 }
1426 1466
1427 1467
1428 bool HLoadKeyedFastElement::RequiresHoleCheck() const { 1468 bool HLoadKeyedFastElement::RequiresHoleCheck() {
1429 for (HUseIterator it(uses()); !it.Done(); it.Advance()) { 1469 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
1430 HValue* use = it.value(); 1470 HValue* use = it.value();
1431 if (!use->IsChange()) return true; 1471 if (!use->IsChange()) return true;
1432 } 1472 }
1433 return false; 1473 return false;
1434 } 1474 }
1435 1475
1436 1476
1437 void HLoadKeyedFastDoubleElement::PrintDataTo(StringStream* stream) { 1477 void HLoadKeyedFastDoubleElement::PrintDataTo(StringStream* stream) {
1438 elements()->PrintNameTo(stream); 1478 elements()->PrintNameTo(stream);
1439 stream->Add("["); 1479 stream->Add("[");
1440 key()->PrintNameTo(stream); 1480 key()->PrintNameTo(stream);
1441 stream->Add("]"); 1481 stream->Add("]");
1442 } 1482 }
1443 1483
1444 1484
1445 bool HLoadKeyedFastDoubleElement::RequiresHoleCheck() const {
1446 return true;
1447 }
1448
1449
1450 void HLoadKeyedGeneric::PrintDataTo(StringStream* stream) { 1485 void HLoadKeyedGeneric::PrintDataTo(StringStream* stream) {
1451 object()->PrintNameTo(stream); 1486 object()->PrintNameTo(stream);
1452 stream->Add("["); 1487 stream->Add("[");
1453 key()->PrintNameTo(stream); 1488 key()->PrintNameTo(stream);
1454 stream->Add("]"); 1489 stream->Add("]");
1455 } 1490 }
1456 1491
1457 1492
1458 void HLoadKeyedSpecializedArrayElement::PrintDataTo( 1493 void HLoadKeyedSpecializedArrayElement::PrintDataTo(
1459 StringStream* stream) { 1494 StringStream* stream) {
(...skipping 21 matching lines...) Expand all
1481 case EXTERNAL_FLOAT_ELEMENTS: 1516 case EXTERNAL_FLOAT_ELEMENTS:
1482 stream->Add("float"); 1517 stream->Add("float");
1483 break; 1518 break;
1484 case EXTERNAL_DOUBLE_ELEMENTS: 1519 case EXTERNAL_DOUBLE_ELEMENTS:
1485 stream->Add("double"); 1520 stream->Add("double");
1486 break; 1521 break;
1487 case EXTERNAL_PIXEL_ELEMENTS: 1522 case EXTERNAL_PIXEL_ELEMENTS:
1488 stream->Add("pixel"); 1523 stream->Add("pixel");
1489 break; 1524 break;
1490 case FAST_ELEMENTS: 1525 case FAST_ELEMENTS:
1526 case FAST_SMI_ONLY_ELEMENTS:
1491 case FAST_DOUBLE_ELEMENTS: 1527 case FAST_DOUBLE_ELEMENTS:
1492 case DICTIONARY_ELEMENTS: 1528 case DICTIONARY_ELEMENTS:
1493 case NON_STRICT_ARGUMENTS_ELEMENTS: 1529 case NON_STRICT_ARGUMENTS_ELEMENTS:
1494 UNREACHABLE(); 1530 UNREACHABLE();
1495 break; 1531 break;
1496 } 1532 }
1497 stream->Add("["); 1533 stream->Add("[");
1498 key()->PrintNameTo(stream); 1534 key()->PrintNameTo(stream);
1499 stream->Add("]"); 1535 stream->Add("]");
1500 } 1536 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 break; 1611 break;
1576 case EXTERNAL_FLOAT_ELEMENTS: 1612 case EXTERNAL_FLOAT_ELEMENTS:
1577 stream->Add("float"); 1613 stream->Add("float");
1578 break; 1614 break;
1579 case EXTERNAL_DOUBLE_ELEMENTS: 1615 case EXTERNAL_DOUBLE_ELEMENTS:
1580 stream->Add("double"); 1616 stream->Add("double");
1581 break; 1617 break;
1582 case EXTERNAL_PIXEL_ELEMENTS: 1618 case EXTERNAL_PIXEL_ELEMENTS:
1583 stream->Add("pixel"); 1619 stream->Add("pixel");
1584 break; 1620 break;
1621 case FAST_SMI_ONLY_ELEMENTS:
1585 case FAST_ELEMENTS: 1622 case FAST_ELEMENTS:
1586 case FAST_DOUBLE_ELEMENTS: 1623 case FAST_DOUBLE_ELEMENTS:
1587 case DICTIONARY_ELEMENTS: 1624 case DICTIONARY_ELEMENTS:
1588 case NON_STRICT_ARGUMENTS_ELEMENTS: 1625 case NON_STRICT_ARGUMENTS_ELEMENTS:
1589 UNREACHABLE(); 1626 UNREACHABLE();
1590 break; 1627 break;
1591 } 1628 }
1592 stream->Add("["); 1629 stream->Add("[");
1593 key()->PrintNameTo(stream); 1630 key()->PrintNameTo(stream);
1594 stream->Add("] = "); 1631 stream->Add("] = ");
1595 value()->PrintNameTo(stream); 1632 value()->PrintNameTo(stream);
1596 } 1633 }
1597 1634
1598 1635
1599 void HLoadGlobalCell::PrintDataTo(StringStream* stream) { 1636 void HLoadGlobalCell::PrintDataTo(StringStream* stream) {
1600 stream->Add("[%p]", *cell()); 1637 stream->Add("[%p]", *cell());
1601 if (check_hole_value()) stream->Add(" (deleteable/read-only)"); 1638 if (!details_.IsDontDelete()) stream->Add(" (deleteable)");
1639 if (details_.IsReadOnly()) stream->Add(" (read-only)");
1640 }
1641
1642
1643 bool HLoadGlobalCell::RequiresHoleCheck() {
1644 if (details_.IsDontDelete() && !details_.IsReadOnly()) return false;
1645 for (HUseIterator it(uses()); !it.Done(); it.Advance()) {
1646 HValue* use = it.value();
1647 if (!use->IsChange()) return true;
1648 }
1649 return false;
1602 } 1650 }
1603 1651
1604 1652
1605 void HLoadGlobalGeneric::PrintDataTo(StringStream* stream) { 1653 void HLoadGlobalGeneric::PrintDataTo(StringStream* stream) {
1606 stream->Add("%o ", *name()); 1654 stream->Add("%o ", *name());
1607 } 1655 }
1608 1656
1609 1657
1610 void HStoreGlobalCell::PrintDataTo(StringStream* stream) { 1658 void HStoreGlobalCell::PrintDataTo(StringStream* stream) {
1611 stream->Add("[%p] = ", *cell()); 1659 stream->Add("[%p] = ", *cell());
1612 value()->PrintNameTo(stream); 1660 value()->PrintNameTo(stream);
1661 if (!details_.IsDontDelete()) stream->Add(" (deleteable)");
1662 if (details_.IsReadOnly()) stream->Add(" (read-only)");
1613 } 1663 }
1614 1664
1615 1665
1616 void HStoreGlobalGeneric::PrintDataTo(StringStream* stream) { 1666 void HStoreGlobalGeneric::PrintDataTo(StringStream* stream) {
1617 stream->Add("%o = ", *name()); 1667 stream->Add("%o = ", *name());
1618 value()->PrintNameTo(stream); 1668 value()->PrintNameTo(stream);
1619 } 1669 }
1620 1670
1621 1671
1622 void HLoadContextSlot::PrintDataTo(StringStream* stream) { 1672 void HLoadContextSlot::PrintDataTo(StringStream* stream) {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1885 1935
1886 1936
1887 void HCheckPrototypeMaps::Verify() { 1937 void HCheckPrototypeMaps::Verify() {
1888 HInstruction::Verify(); 1938 HInstruction::Verify();
1889 ASSERT(HasNoUses()); 1939 ASSERT(HasNoUses());
1890 } 1940 }
1891 1941
1892 #endif 1942 #endif
1893 1943
1894 } } // namespace v8::internal 1944 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698