Commit 2a7ab875 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[ast] Fix printing of CallRuntime nodes.

This fixes printing of {CallRuntime} nodes that are backed by JavaScript
functions. Issues with the printing that was in place:
 - Crash because it was accessing {context} instead of {native_context}
 - Printout was not comparable, raw heap pointer different between runs

R=bmeurer@chromium.org

Change-Id: I941944b46550bd908ec14a324bc255d6c8f96fbe
Reviewed-on: https://chromium-review.googlesource.com/464766Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44298}
parent da778675
...@@ -1142,14 +1142,8 @@ void AstPrinter::VisitCallNew(CallNew* node) { ...@@ -1142,14 +1142,8 @@ void AstPrinter::VisitCallNew(CallNew* node) {
void AstPrinter::VisitCallRuntime(CallRuntime* node) { void AstPrinter::VisitCallRuntime(CallRuntime* node) {
EmbeddedVector<char, 128> buf; EmbeddedVector<char, 128> buf;
if (node->is_jsruntime()) { SNPrintF(buf, "CALL RUNTIME %s%s", node->debug_name(),
SNPrintF( node->is_jsruntime() ? " (JS function)" : "");
buf, "CALL RUNTIME %s code = %p", node->debug_name(),
static_cast<void*>(isolate_->context()->get(node->context_index())));
} else {
SNPrintF(buf, "CALL RUNTIME %s", node->debug_name());
}
IndentedScope indent(this, buf.start(), node->position()); IndentedScope indent(this, buf.start(), node->position());
PrintArguments(node->arguments()); PrintArguments(node->arguments());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment