OLD | NEW |
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 lower_ = Min(Min(v1, v2), Min(v3, v4)); | 419 lower_ = Min(Min(v1, v2), Min(v3, v4)); |
420 upper_ = Max(Max(v1, v2), Max(v3, v4)); | 420 upper_ = Max(Max(v1, v2), Max(v3, v4)); |
421 #ifdef DEBUG | 421 #ifdef DEBUG |
422 Verify(); | 422 Verify(); |
423 #endif | 423 #endif |
424 return may_overflow; | 424 return may_overflow; |
425 } | 425 } |
426 | 426 |
427 | 427 |
428 const char* HType::ToString() { | 428 const char* HType::ToString() { |
| 429 // Note: The c1visualizer syntax for locals allows only a sequence of the |
| 430 // following characters: A-Za-z0-9_-|: |
429 switch (type_) { | 431 switch (type_) { |
430 case kTagged: return "tagged"; | 432 case kTagged: return "tagged"; |
431 case kTaggedPrimitive: return "primitive"; | 433 case kTaggedPrimitive: return "primitive"; |
432 case kTaggedNumber: return "number"; | 434 case kTaggedNumber: return "number"; |
433 case kSmi: return "smi"; | 435 case kSmi: return "smi"; |
434 case kHeapNumber: return "heap-number"; | 436 case kHeapNumber: return "heap-number"; |
435 case kString: return "string"; | 437 case kString: return "string"; |
436 case kBoolean: return "boolean"; | 438 case kBoolean: return "boolean"; |
437 case kNonPrimitive: return "non-primitive"; | 439 case kNonPrimitive: return "non-primitive"; |
438 case kJSArray: return "array"; | 440 case kJSArray: return "array"; |
439 case kJSObject: return "object"; | 441 case kJSObject: return "object"; |
440 case kUninitialized: return "uninitialized"; | 442 case kUninitialized: return "uninitialized"; |
441 } | 443 } |
442 UNREACHABLE(); | 444 UNREACHABLE(); |
443 return "Unreachable code"; | 445 return "unreachable"; |
444 } | 446 } |
445 | 447 |
446 | 448 |
447 HType HType::TypeFromValue(Handle<Object> value) { | 449 HType HType::TypeFromValue(Handle<Object> value) { |
448 HType result = HType::Tagged(); | 450 HType result = HType::Tagged(); |
449 if (value->IsSmi()) { | 451 if (value->IsSmi()) { |
450 result = HType::Smi(); | 452 result = HType::Smi(); |
451 } else if (value->IsHeapNumber()) { | 453 } else if (value->IsHeapNumber()) { |
452 result = HType::HeapNumber(); | 454 result = HType::HeapNumber(); |
453 } else if (value->IsString()) { | 455 } else if (value->IsString()) { |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 ASSERT(block_ == NULL || block == NULL); | 689 ASSERT(block_ == NULL || block == NULL); |
688 block_ = block; | 690 block_ = block; |
689 if (id_ == kNoNumber && block != NULL) { | 691 if (id_ == kNoNumber && block != NULL) { |
690 id_ = block->graph()->GetNextValueID(this); | 692 id_ = block->graph()->GetNextValueID(this); |
691 } | 693 } |
692 } | 694 } |
693 | 695 |
694 | 696 |
695 void HValue::PrintTypeTo(StringStream* stream) { | 697 void HValue::PrintTypeTo(StringStream* stream) { |
696 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return; | 698 if (!representation().IsTagged() || type().Equals(HType::Tagged())) return; |
697 stream->Add(" type[%s]", type().ToString()); | 699 stream->Add(" type:%s", type().ToString()); |
698 } | 700 } |
699 | 701 |
700 | 702 |
701 void HValue::PrintRangeTo(StringStream* stream) { | 703 void HValue::PrintRangeTo(StringStream* stream) { |
702 if (range() == NULL || range()->IsMostGeneric()) return; | 704 if (range() == NULL || range()->IsMostGeneric()) return; |
703 stream->Add(" range[%d,%d,m0=%d]", | 705 // Note: The c1visualizer syntax for locals allows only a sequence of the |
| 706 // following characters: A-Za-z0-9_-|: |
| 707 stream->Add(" range:%d_%d%s", |
704 range()->lower(), | 708 range()->lower(), |
705 range()->upper(), | 709 range()->upper(), |
706 static_cast<int>(range()->CanBeMinusZero())); | 710 range()->CanBeMinusZero() ? "_m0" : ""); |
707 } | 711 } |
708 | 712 |
709 | 713 |
710 void HValue::PrintChangesTo(StringStream* stream) { | 714 void HValue::PrintChangesTo(StringStream* stream) { |
711 GVNFlagSet changes_flags = ChangesFlags(); | 715 GVNFlagSet changes_flags = ChangesFlags(); |
712 if (changes_flags.IsEmpty()) return; | 716 if (changes_flags.IsEmpty()) return; |
713 stream->Add(" changes["); | 717 stream->Add(" changes["); |
714 if (changes_flags == AllSideEffectsFlagSet()) { | 718 if (changes_flags == AllSideEffectsFlagSet()) { |
715 stream->Add("*"); | 719 stream->Add("*"); |
716 } else { | 720 } else { |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 | 1891 |
1888 | 1892 |
1889 void HPhi::PrintTo(StringStream* stream) { | 1893 void HPhi::PrintTo(StringStream* stream) { |
1890 stream->Add("["); | 1894 stream->Add("["); |
1891 for (int i = 0; i < OperandCount(); ++i) { | 1895 for (int i = 0; i < OperandCount(); ++i) { |
1892 HValue* value = OperandAt(i); | 1896 HValue* value = OperandAt(i); |
1893 stream->Add(" "); | 1897 stream->Add(" "); |
1894 value->PrintNameTo(stream); | 1898 value->PrintNameTo(stream); |
1895 stream->Add(" "); | 1899 stream->Add(" "); |
1896 } | 1900 } |
1897 stream->Add(" uses%d_%di_%dd_%dt", | 1901 stream->Add(" uses:%d_%di_%dd_%dt", |
1898 UseCount(), | 1902 UseCount(), |
1899 int32_non_phi_uses() + int32_indirect_uses(), | 1903 int32_non_phi_uses() + int32_indirect_uses(), |
1900 double_non_phi_uses() + double_indirect_uses(), | 1904 double_non_phi_uses() + double_indirect_uses(), |
1901 tagged_non_phi_uses() + tagged_indirect_uses()); | 1905 tagged_non_phi_uses() + tagged_indirect_uses()); |
1902 stream->Add("%s%s]", | 1906 stream->Add("%s%s", |
1903 is_live() ? "_live" : "", | 1907 is_live() ? "_live" : "", |
1904 IsConvertibleToInteger() ? "" : "_ncti"); | 1908 IsConvertibleToInteger() ? "" : "_ncti"); |
| 1909 PrintRangeTo(stream); |
| 1910 PrintTypeTo(stream); |
| 1911 stream->Add("]"); |
1905 } | 1912 } |
1906 | 1913 |
1907 | 1914 |
1908 void HPhi::AddInput(HValue* value) { | 1915 void HPhi::AddInput(HValue* value) { |
1909 inputs_.Add(NULL, value->block()->zone()); | 1916 inputs_.Add(NULL, value->block()->zone()); |
1910 SetOperandAt(OperandCount() - 1, value); | 1917 SetOperandAt(OperandCount() - 1, value); |
1911 // Mark phis that may have 'arguments' directly or indirectly as an operand. | 1918 // Mark phis that may have 'arguments' directly or indirectly as an operand. |
1912 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { | 1919 if (!CheckFlag(kIsArguments) && value->CheckFlag(kIsArguments)) { |
1913 SetFlag(kIsArguments); | 1920 SetFlag(kIsArguments); |
1914 } | 1921 } |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3645 | 3652 |
3646 | 3653 |
3647 void HCheckFunction::Verify() { | 3654 void HCheckFunction::Verify() { |
3648 HInstruction::Verify(); | 3655 HInstruction::Verify(); |
3649 ASSERT(HasNoUses()); | 3656 ASSERT(HasNoUses()); |
3650 } | 3657 } |
3651 | 3658 |
3652 #endif | 3659 #endif |
3653 | 3660 |
3654 } } // namespace v8::internal | 3661 } } // namespace v8::internal |
OLD | NEW |