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

Unified Diff: src/frames.cc

Issue 1186823003: Clean up JSConstructStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: improve JavaScriptFrame::Print() Created 5 years, 6 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/arm64/builtins-arm64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 53ae5079f0caff31d06750b518a5867c967c1bd0..8e256e3989faa5b27e14f8f29ac71b3482624deb 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1047,6 +1047,18 @@ void StackFrame::PrintIndex(StringStream* accumulator,
}
+static void PrintFunctionSource(StringStream* accumulator,
Benedikt Meurer 2015/06/17 03:21:39 Nit: Put into anonymous namespace instead of using
Jakob Kummerow 2015/06/17 11:23:45 Done.
+ SharedFunctionInfo* shared, Code* code) {
+ if (FLAG_max_stack_trace_source_length != 0 && code != NULL) {
+ std::ostringstream os;
+ os << "--------- s o u r c e c o d e ---------\n"
+ << SourceCodeOf(shared, FLAG_max_stack_trace_source_length)
+ << "\n-----------------------------------------\n";
+ accumulator->Add(os.str().c_str());
+ }
+}
+
+
void JavaScriptFrame::Print(StringStream* accumulator,
PrintMode mode,
int index) const {
@@ -1084,7 +1096,7 @@ void JavaScriptFrame::Print(StringStream* accumulator,
accumulator->Add(":~%d", line);
}
- accumulator->Add("] ");
+ accumulator->Add("] [pc=%p] ", pc);
}
accumulator->Add("(this=%o", receiver);
@@ -1109,7 +1121,9 @@ void JavaScriptFrame::Print(StringStream* accumulator,
return;
}
if (is_optimized()) {
- accumulator->Add(" {\n// optimized frame\n}\n");
+ accumulator->Add(" {\n// optimized frame\n");
+ PrintFunctionSource(accumulator, shared, code);
+ accumulator->Add("}\n");
return;
}
accumulator->Add(" {\n");
@@ -1176,15 +1190,7 @@ void JavaScriptFrame::Print(StringStream* accumulator,
accumulator->Add(" [%02d] : %o\n", i, GetExpression(i));
}
- // Print details about the function.
- if (FLAG_max_stack_trace_source_length != 0 && code != NULL) {
- std::ostringstream os;
- SharedFunctionInfo* shared = function->shared();
- os << "--------- s o u r c e c o d e ---------\n"
- << SourceCodeOf(shared, FLAG_max_stack_trace_source_length)
- << "\n-----------------------------------------\n";
- accumulator->Add(os.str().c_str());
- }
+ PrintFunctionSource(accumulator, shared, code);
accumulator->Add("}\n\n");
}
« no previous file with comments | « src/arm64/builtins-arm64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698