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

Unified Diff: src/frames.cc

Issue 1186823003: Clean up JSConstructStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased 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 c031971d5aff69f4339783a3ac00b5e243a05505..c6b04f7081fc1f9bd6c81cadc7ffc8a8ac11e7b2 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -1120,6 +1120,24 @@ void StackFrame::PrintIndex(StringStream* accumulator,
}
+namespace {
+
+
+void PrintFunctionSource(StringStream* accumulator, 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());
+ }
+}
+
+
+} // namespace
+
+
void JavaScriptFrame::Print(StringStream* accumulator,
PrintMode mode,
int index) const {
@@ -1157,7 +1175,7 @@ void JavaScriptFrame::Print(StringStream* accumulator,
accumulator->Add(":~%d", line);
}
- accumulator->Add("] ");
+ accumulator->Add("] [pc=%p] ", pc);
}
accumulator->Add("(this=%o", receiver);
@@ -1182,7 +1200,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");
@@ -1249,15 +1269,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