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

Unified Diff: src/messages.cc

Issue 2164903004: Eagerly format traces in captureStackTrace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 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/messages.h ('k') | test/mjsunit/stack-traces.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.cc
diff --git a/src/messages.cc b/src/messages.cc
index 3213d2cbb93b0160fb174609840fe7efae656f89..02c42eaa66c9b15a4b923a492fd9190683b258c3 100644
--- a/src/messages.cc
+++ b/src/messages.cc
@@ -364,6 +364,23 @@ bool CallSite::IsConstructor() {
return constructor.is_identical_to(fun_);
}
+MaybeHandle<Object> FormatStackTrace(Isolate* isolate, Handle<JSObject> error,
+ Handle<Object> stack_trace) {
+ // TODO(jgruber): Port FormatStackTrace from JS.
+ Handle<JSFunction> fun = isolate->error_format_stack_trace();
+
+ int argc = 2;
+ ScopedVector<Handle<Object>> argv(argc);
+ argv[0] = error;
+ argv[1] = stack_trace;
+
+ Handle<Object> formatted_stack_trace;
+ ASSIGN_RETURN_ON_EXCEPTION(
+ isolate, formatted_stack_trace,
+ Execution::Call(isolate, fun, error, argc, argv.start()), Object);
+
+ return formatted_stack_trace;
+}
Handle<String> MessageTemplate::FormatMessage(Isolate* isolate,
int template_index,
« no previous file with comments | « src/messages.h ('k') | test/mjsunit/stack-traces.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698