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

Unified Diff: src/runtime/runtime-debug.cc

Issue 861623002: Add a pretty printer to improve the error message non-function calls (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update test expectations Created 5 years, 11 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
Index: src/runtime/runtime-debug.cc
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc
index 12c5a0d84f3567a2690bdd0fb1e6bee107f6e81d..5663a58f356a308bf347b188a8e492926c9b55ec 100644
--- a/src/runtime/runtime-debug.cc
+++ b/src/runtime/runtime-debug.cc
@@ -9,7 +9,9 @@
#include "src/debug.h"
#include "src/deoptimizer.h"
#include "src/isolate-inl.h"
+#include "src/messages.h"
#include "src/parser.h"
+#include "src/prettyprinter.h"
#include "src/runtime/runtime.h"
#include "src/runtime/runtime-utils.h"
@@ -2727,6 +2729,21 @@ RUNTIME_FUNCTION(Runtime_GetScript) {
}
+RUNTIME_FUNCTION(Runtime_RenderCallSite) {
Yang 2015/01/20 08:19:07 Nit: runtime-debug.cc is used for debugger related
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 0);
+ MessageLocation location;
+ isolate->ComputeLocation(&location);
+ if (location.start_pos() == -1) return isolate->heap()->empty_string();
+ CompilationInfoWithZone info(location.script());
Yang 2015/01/20 08:19:07 If you could get the JSFunction from within Comput
+ if (!Parser::Parse(&info)) return isolate->heap()->empty_string();
+ Zone zone(isolate);
+ CallPrinter printer(&zone);
+ const char* string = printer.Print(info.function(), location.start_pos());
+ return *isolate->factory()->NewStringFromAsciiChecked(string);
+}
+
+
// Check whether debugger and is about to step into the callback that is passed
// to a built-in function such as Array.forEach.
RUNTIME_FUNCTION(Runtime_DebugCallbackSupportsStepping) {

Powered by Google App Engine
This is Rietveld 408576698