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

Unified Diff: src/compiler.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler.h ('k') | src/hydrogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9dd3ca7c0cc659de18012c4de435bc1531d922ce..4b8157bee6a274ce3594391ec9e7244e03fd9d6c 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -35,6 +35,17 @@ namespace v8 {
namespace internal {
+std::ostream& operator<<(std::ostream& os, const SourcePosition& p) {
+ if (p.IsUnknown()) {
+ return os << "<?>";
+ } else if (FLAG_hydrogen_track_positions) {
+ return os << "<" << p.inlining_id() << ":" << p.position() << ">";
+ } else {
+ return os << "<0:" << p.raw() << ">";
+ }
+}
+
+
ScriptData::ScriptData(const byte* data, int length)
: owns_data_(false), rejected_(false), data_(data), length_(length) {
if (!IsAligned(reinterpret_cast<intptr_t>(data), kPointerAlignment)) {
@@ -324,7 +335,7 @@ bool CompilationInfo::is_simple_parameter_list() {
int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
- int raw_position) {
+ SourcePosition position) {
if (!FLAG_hydrogen_track_positions) {
return 0;
}
@@ -369,7 +380,6 @@ int CompilationInfo::TraceInlinedFunction(Handle<SharedFunctionInfo> shared,
if (inline_id != 0) {
CodeTracer::Scope tracing_scope(isolate()->GetCodeTracer());
OFStream os(tracing_scope.file());
- HSourcePosition position = HSourcePosition::FromRaw(raw_position);
os << "INLINE (" << shared->DebugName()->ToCString().get() << ") id{"
<< optimization_id() << "," << id << "} AS " << inline_id << " AT "
<< position << std::endl;
« no previous file with comments | « src/compiler.h ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698