Chromium Code Reviews| 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) { |