OLD | NEW |
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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 void HChange::PrintDataTo(StringStream* stream) const { | 715 void HChange::PrintDataTo(StringStream* stream) const { |
716 HUnaryOperation::PrintDataTo(stream); | 716 HUnaryOperation::PrintDataTo(stream); |
717 stream->Add(" %s to %s", from_.Mnemonic(), to_.Mnemonic()); | 717 stream->Add(" %s to %s", from_.Mnemonic(), to_.Mnemonic()); |
718 | 718 |
719 if (CanTruncateToInt32()) stream->Add(" truncating-int32"); | 719 if (CanTruncateToInt32()) stream->Add(" truncating-int32"); |
720 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); | 720 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); |
721 } | 721 } |
722 | 722 |
723 | 723 |
724 void HNeg::PrintDataTo(StringStream* stream) const { | |
725 HUnaryOperation::PrintDataTo(stream); | |
726 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); | |
727 } | |
728 | |
729 | |
730 HCheckInstanceType* HCheckInstanceType::NewIsJSObjectOrJSFunction( | 724 HCheckInstanceType* HCheckInstanceType::NewIsJSObjectOrJSFunction( |
731 HValue* value) { | 725 HValue* value) { |
732 STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE); | 726 STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE); |
733 return new HCheckInstanceType(value, FIRST_JS_OBJECT_TYPE, JS_FUNCTION_TYPE); | 727 return new HCheckInstanceType(value, FIRST_JS_OBJECT_TYPE, JS_FUNCTION_TYPE); |
734 } | 728 } |
735 | 729 |
736 | 730 |
737 void HCheckMap::PrintDataTo(StringStream* stream) const { | 731 void HCheckMap::PrintDataTo(StringStream* stream) const { |
738 value()->PrintNameTo(stream); | 732 value()->PrintNameTo(stream); |
739 stream->Add(" %p", *map()); | 733 stream->Add(" %p", *map()); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
891 if (!right()->range()->CanBeZero()) { | 885 if (!right()->range()->CanBeZero()) { |
892 ClearFlag(HValue::kCanBeDivByZero); | 886 ClearFlag(HValue::kCanBeDivByZero); |
893 } | 887 } |
894 return result; | 888 return result; |
895 } else { | 889 } else { |
896 return HArithmeticBinaryOperation::InferRange(); | 890 return HArithmeticBinaryOperation::InferRange(); |
897 } | 891 } |
898 } | 892 } |
899 | 893 |
900 | 894 |
901 Range* HNeg::InferRange() { | |
902 if (representation().IsInteger32()) { | |
903 Range* input_range = value()->range(); | |
904 Range* result = input_range->Copy(); | |
905 Range neg_one(-1, -1); | |
906 if (!result->MulAndCheckOverflow(&neg_one)) { | |
907 ClearFlag(HValue::kCanOverflow); | |
908 } | |
909 result->set_can_be_minus_zero(input_range->CanBeZero()); | |
910 return result; | |
911 } else { | |
912 return HValue::InferRange(); | |
913 } | |
914 } | |
915 | |
916 | |
917 void HPhi::PrintTo(StringStream* stream) const { | 895 void HPhi::PrintTo(StringStream* stream) const { |
918 stream->Add("["); | 896 stream->Add("["); |
919 for (int i = 0; i < OperandCount(); ++i) { | 897 for (int i = 0; i < OperandCount(); ++i) { |
920 HValue* value = OperandAt(i); | 898 HValue* value = OperandAt(i); |
921 stream->Add(" "); | 899 stream->Add(" "); |
922 value->PrintNameTo(stream); | 900 value->PrintNameTo(stream); |
923 stream->Add(" "); | 901 stream->Add(" "); |
924 } | 902 } |
925 stream->Add(" uses%d_%di_%dd_%dt]", | 903 stream->Add(" uses%d_%di_%dd_%dt]", |
926 uses()->length(), | 904 uses()->length(), |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1329 HType HBitOr::CalculateInferredType() const { | 1307 HType HBitOr::CalculateInferredType() const { |
1330 return HType::TaggedNumber(); | 1308 return HType::TaggedNumber(); |
1331 } | 1309 } |
1332 | 1310 |
1333 | 1311 |
1334 HType HBitNot::CalculateInferredType() const { | 1312 HType HBitNot::CalculateInferredType() const { |
1335 return HType::TaggedNumber(); | 1313 return HType::TaggedNumber(); |
1336 } | 1314 } |
1337 | 1315 |
1338 | 1316 |
1339 HType HNeg::CalculateInferredType() const { | |
1340 return HType::TaggedNumber(); | |
1341 } | |
1342 | |
1343 | |
1344 HType HUnaryMathOperation::CalculateInferredType() const { | 1317 HType HUnaryMathOperation::CalculateInferredType() const { |
1345 return HType::TaggedNumber(); | 1318 return HType::TaggedNumber(); |
1346 } | 1319 } |
1347 | 1320 |
1348 | 1321 |
1349 HType HShl::CalculateInferredType() const { | 1322 HType HShl::CalculateInferredType() const { |
1350 return HType::TaggedNumber(); | 1323 return HType::TaggedNumber(); |
1351 } | 1324 } |
1352 | 1325 |
1353 | 1326 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1412 | 1385 |
1413 HValue* HMul::EnsureAndPropagateNotMinusZero(BitVector* visited) { | 1386 HValue* HMul::EnsureAndPropagateNotMinusZero(BitVector* visited) { |
1414 visited->Add(id()); | 1387 visited->Add(id()); |
1415 if (range() == NULL || range()->CanBeMinusZero()) { | 1388 if (range() == NULL || range()->CanBeMinusZero()) { |
1416 SetFlag(kBailoutOnMinusZero); | 1389 SetFlag(kBailoutOnMinusZero); |
1417 } | 1390 } |
1418 return NULL; | 1391 return NULL; |
1419 } | 1392 } |
1420 | 1393 |
1421 | 1394 |
1422 HValue* HNeg::EnsureAndPropagateNotMinusZero(BitVector* visited) { | |
1423 visited->Add(id()); | |
1424 if (range() == NULL || range()->CanBeMinusZero()) { | |
1425 SetFlag(kBailoutOnMinusZero); | |
1426 } | |
1427 return NULL; | |
1428 } | |
1429 | |
1430 | |
1431 HValue* HSub::EnsureAndPropagateNotMinusZero(BitVector* visited) { | 1395 HValue* HSub::EnsureAndPropagateNotMinusZero(BitVector* visited) { |
1432 visited->Add(id()); | 1396 visited->Add(id()); |
1433 // Propagate to the left argument. If the left argument cannot be -0, then | 1397 // Propagate to the left argument. If the left argument cannot be -0, then |
1434 // the result of the add operation cannot be either. | 1398 // the result of the add operation cannot be either. |
1435 if (range() == NULL || range()->CanBeMinusZero()) { | 1399 if (range() == NULL || range()->CanBeMinusZero()) { |
1436 return left(); | 1400 return left(); |
1437 } | 1401 } |
1438 return NULL; | 1402 return NULL; |
1439 } | 1403 } |
1440 | 1404 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 | 1472 |
1509 | 1473 |
1510 void HCheckPrototypeMaps::Verify() { | 1474 void HCheckPrototypeMaps::Verify() { |
1511 HInstruction::Verify(); | 1475 HInstruction::Verify(); |
1512 ASSERT(HasNoUses()); | 1476 ASSERT(HasNoUses()); |
1513 } | 1477 } |
1514 | 1478 |
1515 #endif | 1479 #endif |
1516 | 1480 |
1517 } } // namespace v8::internal | 1481 } } // namespace v8::internal |
OLD | NEW |