Chromium Code Reviews| Index: src/runtime/runtime-internal.cc |
| diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
| index 79dfaced96ca90c502deb46ae23c7d1afb42745e..bd1aedaacfa45481629188398e857b1f4728af69 100644 |
| --- a/src/runtime/runtime-internal.cc |
| +++ b/src/runtime/runtime-internal.cc |
| @@ -7,6 +7,9 @@ |
| #include "src/arguments.h" |
| #include "src/bootstrapper.h" |
| #include "src/debug.h" |
| +#include "src/messages.h" |
| +#include "src/parser.h" |
| +#include "src/prettyprinter.h" |
| #include "src/runtime/runtime-utils.h" |
| namespace v8 { |
| @@ -153,6 +156,30 @@ RUNTIME_FUNCTION(Runtime_CollectStackTrace) { |
| } |
| +RUNTIME_FUNCTION(Runtime_RenderCallSite) { |
| + HandleScope scope(isolate); |
| + DCHECK(args.length() == 0); |
| + MessageLocation location; |
| + isolate->ComputeLocation(&location); |
| + if (location.start_pos() == -1) return isolate->heap()->empty_string(); |
| + |
| + Zone zone(isolate); |
| + if (location.function()->shared()->is_function()) { |
| + CompilationInfo info(location.function(), &zone); |
| + if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); |
| + CallPrinter printer(&zone); |
| + const char* string = printer.Print(info.function(), location.start_pos()); |
| + return *isolate->factory()->NewStringFromAsciiChecked(string); |
| + } |
| + |
| + CompilationInfoWithZone info(location.script()); |
|
Yang
2015/01/20 11:18:23
I guess you could also pass the zone into the Comp
|
| + if (!Parser::Parse(&info)) return isolate->heap()->empty_string(); |
| + CallPrinter printer(&zone); |
| + const char* string = printer.Print(info.function(), location.start_pos()); |
| + return *isolate->factory()->NewStringFromAsciiChecked(string); |
| +} |
| + |
| + |
| RUNTIME_FUNCTION(Runtime_GetFromCache) { |
| SealHandleScope shs(isolate); |
| // This is only called from codegen, so checks might be more lax. |