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

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

Issue 928343003: CpuProfile: rename HSourcePosition to SourcePosition and move it to compiler.* (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: comments addressed Created 5 years, 10 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/isolate.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/double.h" 8 #include "src/double.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/hydrogen-infer-representation.h" 10 #include "src/hydrogen-infer-representation.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 } 615 }
616 616
617 617
618 void HValue::ComputeInitialRange(Zone* zone) { 618 void HValue::ComputeInitialRange(Zone* zone) {
619 DCHECK(!HasRange()); 619 DCHECK(!HasRange());
620 range_ = InferRange(zone); 620 range_ = InferRange(zone);
621 DCHECK(HasRange()); 621 DCHECK(HasRange());
622 } 622 }
623 623
624 624
625 std::ostream& operator<<(std::ostream& os, const HSourcePosition& p) {
626 if (p.IsUnknown()) {
627 return os << "<?>";
628 } else if (FLAG_hydrogen_track_positions) {
629 return os << "<" << p.inlining_id() << ":" << p.position() << ">";
630 } else {
631 return os << "<0:" << p.raw() << ">";
632 }
633 }
634
635
636 std::ostream& HInstruction::PrintTo(std::ostream& os) const { // NOLINT 625 std::ostream& HInstruction::PrintTo(std::ostream& os) const { // NOLINT
637 os << Mnemonic() << " "; 626 os << Mnemonic() << " ";
638 PrintDataTo(os) << ChangesOf(this) << TypeOf(this); 627 PrintDataTo(os) << ChangesOf(this) << TypeOf(this);
639 if (CheckFlag(HValue::kHasNoObservableSideEffects)) os << " [noOSE]"; 628 if (CheckFlag(HValue::kHasNoObservableSideEffects)) os << " [noOSE]";
640 if (CheckFlag(HValue::kIsDead)) os << " [dead]"; 629 if (CheckFlag(HValue::kIsDead)) os << " [dead]";
641 return os; 630 return os;
642 } 631 }
643 632
644 633
645 std::ostream& HInstruction::PrintDataTo(std::ostream& os) const { // NOLINT 634 std::ostream& HInstruction::PrintDataTo(std::ostream& os) const { // NOLINT
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 Range* HConstant::InferRange(Zone* zone) { 1798 Range* HConstant::InferRange(Zone* zone) {
1810 if (HasInteger32Value()) { 1799 if (HasInteger32Value()) {
1811 Range* result = new(zone) Range(int32_value_, int32_value_); 1800 Range* result = new(zone) Range(int32_value_, int32_value_);
1812 result->set_can_be_minus_zero(false); 1801 result->set_can_be_minus_zero(false);
1813 return result; 1802 return result;
1814 } 1803 }
1815 return HValue::InferRange(zone); 1804 return HValue::InferRange(zone);
1816 } 1805 }
1817 1806
1818 1807
1819 HSourcePosition HPhi::position() const { 1808 SourcePosition HPhi::position() const { return block()->first()->position(); }
1820 return block()->first()->position();
1821 }
1822 1809
1823 1810
1824 Range* HPhi::InferRange(Zone* zone) { 1811 Range* HPhi::InferRange(Zone* zone) {
1825 Representation r = representation(); 1812 Representation r = representation();
1826 if (r.IsSmiOrInteger32()) { 1813 if (r.IsSmiOrInteger32()) {
1827 if (block()->IsLoopHeader()) { 1814 if (block()->IsLoopHeader()) {
1828 Range* range = r.IsSmi() 1815 Range* range = r.IsSmi()
1829 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue) 1816 ? new(zone) Range(Smi::kMinValue, Smi::kMaxValue)
1830 : new(zone) Range(kMinInt, kMaxInt); 1817 : new(zone) Range(kMinInt, kMaxInt);
1831 return range; 1818 return range;
(...skipping 2984 matching lines...) Expand 10 before | Expand all | Expand 10 after
4816 break; 4803 break;
4817 case HObjectAccess::kExternalMemory: 4804 case HObjectAccess::kExternalMemory:
4818 os << "[external-memory]"; 4805 os << "[external-memory]";
4819 break; 4806 break;
4820 } 4807 }
4821 4808
4822 return os << "@" << access.offset(); 4809 return os << "@" << access.offset();
4823 } 4810 }
4824 4811
4825 } } // namespace v8::internal 4812 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698