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

Unified Diff: src/prettyprinter.cc

Issue 1264823003: VectorICs: --print-ast now prints allocated vector slots (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/prettyprinter.cc
diff --git a/src/prettyprinter.cc b/src/prettyprinter.cc
index 6a7718a3233260223350f1e07b577f63b339ab78..9bc4e6a562866d6293cbaf4e76595c2bf9c0970d 100644
--- a/src/prettyprinter.cc
+++ b/src/prettyprinter.cc
@@ -419,6 +419,18 @@ void CallPrinter::PrintLiteral(const AstRawString* value, bool quote) {
#ifdef DEBUG
+// A helper for ast nodes that use FeedbackVectorICSlots.
+static int FormatICSlotNode(Vector<char>* buf, Expression* node,
+ const char* node_name, FeedbackVectorICSlot slot) {
+ int pos = SNPrintF(*buf, "%s", node_name);
+ if (!slot.IsInvalid()) {
+ const char* str = Code::Kind2String(node->FeedbackICSlotKind(0));
+ pos = SNPrintF(*buf + pos, " ICSlot(%d, %s)", slot.ToInt(), str);
+ }
+ return pos;
+}
+
+
PrettyPrinter::PrettyPrinter(Isolate* isolate, Zone* zone) {
output_ = NULL;
size_ = 0;
@@ -1430,11 +1442,12 @@ void AstPrinter::VisitArrayLiteral(ArrayLiteral* node) {
}
-// TODO(svenpanne) Start with IndentedScope.
void AstPrinter::VisitVariableProxy(VariableProxy* node) {
Variable* var = node->var();
EmbeddedVector<char, 128> buf;
- int pos = SNPrintF(buf, "VAR PROXY");
+ int pos =
+ FormatICSlotNode(&buf, node, "VAR PROXY", node->VariableFeedbackSlot());
+
switch (var->location()) {
case VariableLocation::UNALLOCATED:
break;
@@ -1478,7 +1491,10 @@ void AstPrinter::VisitThrow(Throw* node) {
void AstPrinter::VisitProperty(Property* node) {
- IndentedScope indent(this, "PROPERTY");
+ EmbeddedVector<char, 128> buf;
+ FormatICSlotNode(&buf, node, "PROPERTY", node->PropertyFeedbackSlot());
+ IndentedScope indent(this, buf.start());
+
Visit(node->obj());
Literal* literal = node->key()->AsLiteral();
if (literal != NULL && literal->value()->IsInternalizedString()) {
@@ -1490,7 +1506,10 @@ void AstPrinter::VisitProperty(Property* node) {
void AstPrinter::VisitCall(Call* node) {
- IndentedScope indent(this, "CALL");
+ EmbeddedVector<char, 128> buf;
+ FormatICSlotNode(&buf, node, "CALL", node->CallFeedbackICSlot());
+ IndentedScope indent(this, buf.start());
+
Visit(node->expression());
PrintArguments(node->arguments());
}
@@ -1504,7 +1523,9 @@ void AstPrinter::VisitCallNew(CallNew* node) {
void AstPrinter::VisitCallRuntime(CallRuntime* node) {
- IndentedScope indent(this, "CALL RUNTIME");
+ EmbeddedVector<char, 128> buf;
+ FormatICSlotNode(&buf, node, "CALL RUNTIME", node->CallRuntimeFeedbackSlot());
+ IndentedScope indent(this, buf.start());
PrintLiteralIndented("NAME", node->name(), false);
PrintArguments(node->arguments());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698