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

Unified Diff: runtime/vm/ast_printer.cc

Issue 1314673008: Migrate logging infrastructure Isolate->Thread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix test. Created 5 years, 3 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 | runtime/vm/class_finalizer.cc » ('j') | runtime/vm/thread.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/ast_printer.cc
diff --git a/runtime/vm/ast_printer.cc b/runtime/vm/ast_printer.cc
index aa5c29f510c60af0979cf3de0b26a149aabb9d80..7cc69d4596a90ca00f053a3f8f30dda3b2046b34 100644
--- a/runtime/vm/ast_printer.cc
+++ b/runtime/vm/ast_printer.cc
@@ -19,38 +19,38 @@ AstPrinter::~AstPrinter() { }
void AstPrinter::VisitGenericAstNode(AstNode* node) {
- ISL_Print("(%s ", node->PrettyName());
+ THR_Print("(%s ", node->PrettyName());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitSequenceNode(SequenceNode* node) {
indent_++;
LocalScope* scope = node->scope();
- ISL_Print("(%s (scope \"%p\"", node->PrettyName(), scope);
+ THR_Print("(%s (scope \"%p\"", node->PrettyName(), scope);
if (scope != NULL) {
- ISL_Print(" (%" Pd "-%" Pd ") loop %d",
+ THR_Print(" (%" Pd "-%" Pd ") loop %d",
scope->begin_token_pos(),
scope->end_token_pos(),
scope->loop_level());
if (scope->HasContextLevel()) {
- ISL_Print(" context %d captures %d",
+ THR_Print(" context %d captures %d",
scope->context_level(),
scope->num_context_variables());
} else {
ASSERT(scope->num_context_variables() == 0);
}
}
- ISL_Print(")");
+ THR_Print(")");
for (int i = 0; i < node->length(); ++i) {
- ISL_Print("\n");
+ THR_Print("\n");
for (intptr_t p = 0; p < indent_; p++) {
- ISL_Print(" ");
+ THR_Print(" ");
}
node->NodeAt(i)->Visit(this);
}
- ISL_Print(")");
+ THR_Print(")");
indent_--;
}
@@ -81,29 +81,29 @@ void AstPrinter::VisitReturnNode(ReturnNode* node) {
kind = "";
UNREACHABLE();
}
- ISL_Print("(%s %s", node->PrettyName(), kind);
+ THR_Print("(%s %s", node->PrettyName(), kind);
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitGenericLocalNode(AstNode* node,
const LocalVariable& var) {
- ISL_Print("(%s %s%s \"%s\"",
+ THR_Print("(%s %s%s \"%s\"",
node->PrettyName(),
var.is_final() ? "final " : "",
String::Handle(var.type().Name()).ToCString(),
var.name().ToCString());
if (var.HasIndex()) {
if (var.is_captured()) {
- ISL_Print(" (context %d %d)", var.owner()->context_level(), var.index());
+ THR_Print(" (context %d %d)", var.owner()->context_level(), var.index());
} else {
- ISL_Print(" (stack %d)", var.index());
+ THR_Print(" (stack %d)", var.index());
}
}
- ISL_Print(" ");
+ THR_Print(" ");
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
@@ -118,14 +118,14 @@ void AstPrinter::VisitStoreLocalNode(StoreLocalNode* node) {
void AstPrinter::VisitGenericFieldNode(AstNode* node, const Field& field) {
- ISL_Print("(%s %s%s \"%s\" ",
+ THR_Print("(%s %s%s \"%s\" ",
node->PrettyName(),
field.is_final() ? "final " : "",
String::Handle(AbstractType::Handle(field.type()).Name()).
ToCString(),
String::Handle(field.name()).ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
@@ -166,13 +166,13 @@ void AstPrinter::VisitStringInterpolateNode(StringInterpolateNode* node) {
void AstPrinter::VisitLiteralNode(LiteralNode* node) {
const Instance& literal = node->literal();
- ISL_Print("(%s \"%s\")", node->PrettyName(), literal.ToCString());
+ THR_Print("(%s \"%s\")", node->PrettyName(), literal.ToCString());
}
void AstPrinter::VisitTypeNode(TypeNode* node) {
const AbstractType& type = node->type();
- ISL_Print("(%s \"%s\")",
+ THR_Print("(%s \"%s\")",
node->PrettyName(),
String::Handle(type.Name()).ToCString());
}
@@ -181,24 +181,24 @@ void AstPrinter::VisitTypeNode(TypeNode* node) {
void AstPrinter::VisitAssignableNode(AssignableNode* node) {
const AbstractType& type = node->type();
const String& dst_name = node->dst_name();
- ISL_Print("(%s (type \"%s\") (of \"%s\") ",
+ THR_Print("(%s (type \"%s\") (of \"%s\") ",
node->PrettyName(),
String::Handle(type.Name()).ToCString(),
dst_name.ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitAwaitNode(AwaitNode* node) {
- ISL_Print("(*****%s***** (scope \"%p\") ", node->PrettyName(), node->scope());
+ THR_Print("(*****%s***** (scope \"%p\") ", node->PrettyName(), node->scope());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitAwaitMarkerNode(AwaitMarkerNode* node) {
- ISL_Print("(%s (async_scope \"%p\" await_scope \"%p\"))",
+ THR_Print("(%s (async_scope \"%p\" await_scope \"%p\"))",
node->PrettyName(),
node->async_scope(),
node->await_scope());
@@ -206,38 +206,38 @@ void AstPrinter::VisitAwaitMarkerNode(AwaitMarkerNode* node) {
void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
- ISL_Print("(*****%s***** \"%s\")",
+ THR_Print("(*****%s***** \"%s\")",
node->PrettyName(),
node->primary().ToCString());
}
void AstPrinter::VisitComparisonNode(ComparisonNode* node) {
- ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+ THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitBinaryOpNode(BinaryOpNode* node) {
- ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+ THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitBinaryOpWithMask32Node(BinaryOpWithMask32Node* node) {
- ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+ THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
node->VisitChildren(this);
- ISL_Print(" & \"0x%" Px64 "", node->mask32());
- ISL_Print("\")");
+ THR_Print(" & \"0x%" Px64 "", node->mask32());
+ THR_Print("\")");
}
void AstPrinter::VisitUnaryOpNode(UnaryOpNode* node) {
- ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+ THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
@@ -252,16 +252,16 @@ void AstPrinter::VisitIfNode(IfNode* node) {
void AstPrinter::VisitCaseNode(CaseNode* node) {
- ISL_Print("(%s (", node->PrettyName());
+ THR_Print("(%s (", node->PrettyName());
for (int i = 0; i < node->case_expressions()->length(); i++) {
node->case_expressions()->NodeAt(i)->Visit(this);
}
if (node->contains_default()) {
- ISL_Print(" default");
+ THR_Print(" default");
}
- ISL_Print(")");
+ THR_Print(")");
node->statements()->Visit(this);
- ISL_Print(")");
+ THR_Print(")");
}
@@ -278,17 +278,17 @@ void AstPrinter::VisitWhileNode(WhileNode* node) {
void AstPrinter::VisitForNode(ForNode* node) {
// Complicated because the condition is optional and so we clearly want to
// indicate the subparts.
- ISL_Print("(%s (init ", node->PrettyName());
+ THR_Print("(%s (init ", node->PrettyName());
node->initializer()->Visit(this);
if (node->condition() != NULL) {
- ISL_Print(") (cond ");
+ THR_Print(") (cond ");
node->condition()->Visit(this);
}
- ISL_Print(") (update ");
+ THR_Print(") (update ");
node->increment()->Visit(this);
- ISL_Print(") ");
+ THR_Print(") ");
node->body()->Visit(this);
- ISL_Print(")");
+ THR_Print(")");
}
@@ -298,7 +298,7 @@ void AstPrinter::VisitDoWhileNode(DoWhileNode* node) {
void AstPrinter::VisitJumpNode(JumpNode* node) {
- ISL_Print("(%s %s %s (scope \"%p\"))",
+ THR_Print("(%s %s %s (scope \"%p\"))",
node->PrettyName(),
node->TokenName(),
node->label()->name().ToCString(),
@@ -307,25 +307,25 @@ void AstPrinter::VisitJumpNode(JumpNode* node) {
void AstPrinter::VisitInstanceCallNode(InstanceCallNode* node) {
- ISL_Print("(%s \"%s\" ",
+ THR_Print("(%s \"%s\" ",
node->PrettyName(),
node->function_name().ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitStaticCallNode(StaticCallNode* node) {
const char* function_fullname = node->function().ToFullyQualifiedCString();
- ISL_Print("(%s \"%s\" ", node->PrettyName(), function_fullname);
+ THR_Print("(%s \"%s\" ", node->PrettyName(), function_fullname);
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitClosureNode(ClosureNode* node) {
const char* function_fullname = node->function().ToFullyQualifiedCString();
- ISL_Print("(%s \"%s\")", node->PrettyName(), function_fullname);
+ THR_Print("(%s \"%s\")", node->PrettyName(), function_fullname);
}
@@ -337,39 +337,39 @@ void AstPrinter::VisitClosureCallNode(ClosureCallNode* node) {
void AstPrinter::VisitConstructorCallNode(ConstructorCallNode* node) {
const char* kind = node->constructor().IsFactory() ? "factory " : "";
const char* constructor_name = node->constructor().ToFullyQualifiedCString();
- ISL_Print("(%s %s \"%s\" ", node->PrettyName(), kind, constructor_name);
+ THR_Print("(%s %s \"%s\" ", node->PrettyName(), kind, constructor_name);
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitInstanceGetterNode(InstanceGetterNode* node) {
- ISL_Print("(%s \"%s\" ",
+ THR_Print("(%s \"%s\" ",
node->PrettyName(),
node->field_name().ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitInstanceSetterNode(InstanceSetterNode* node) {
- ISL_Print("(%s \"%s\" ",
+ THR_Print("(%s \"%s\" ",
node->PrettyName(),
node->field_name().ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitInitStaticFieldNode(InitStaticFieldNode* node) {
- ISL_Print("(%s \"%s\")", node->PrettyName(),
+ THR_Print("(%s \"%s\")", node->PrettyName(),
String::Handle(node->field().name()).ToCString());
}
void AstPrinter::VisitStaticGetterNode(StaticGetterNode* node) {
String& class_name = String::Handle(node->cls().Name());
- ISL_Print("(%s \"%s.%s\")",
+ THR_Print("(%s \"%s.%s\")",
node->PrettyName(),
class_name.ToCString(),
node->field_name().ToCString());
@@ -378,31 +378,31 @@ void AstPrinter::VisitStaticGetterNode(StaticGetterNode* node) {
void AstPrinter::VisitStaticSetterNode(StaticSetterNode* node) {
String& class_name = String::Handle(node->cls().Name());
- ISL_Print("(%s \"%s.%s\" ",
+ THR_Print("(%s \"%s.%s\" ",
node->PrettyName(),
class_name.ToCString(),
node->field_name().ToCString());
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitLoadIndexedNode(LoadIndexedNode* node) {
- ISL_Print("(%s%s ", node->PrettyName(), node->IsSuperLoad() ? " super" : "");
+ THR_Print("(%s%s ", node->PrettyName(), node->IsSuperLoad() ? " super" : "");
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitStoreIndexedNode(StoreIndexedNode* node) {
- ISL_Print("(%s%s ", node->PrettyName(), node->IsSuperStore() ? " super" : "");
+ THR_Print("(%s%s ", node->PrettyName(), node->IsSuperStore() ? " super" : "");
node->VisitChildren(this);
- ISL_Print(")");
+ THR_Print(")");
}
void AstPrinter::VisitNativeBodyNode(NativeBodyNode* node) {
- ISL_Print("(%s \"%s\" (%" Pd " args))",
+ THR_Print("(%s \"%s\" (%" Pd " args))",
node->PrettyName(),
node->native_c_function_name().ToCString(),
NativeArguments::ParameterCountForResolution(node->function()));
@@ -415,15 +415,15 @@ void AstPrinter::VisitCatchClauseNode(CatchClauseNode* node) {
void AstPrinter::VisitTryCatchNode(TryCatchNode* node) {
- ISL_Print("(%s ", node->PrettyName());
+ THR_Print("(%s ", node->PrettyName());
node->try_block()->Visit(this);
node->catch_block()->Visit(this);
if (node->finally_block() != NULL) {
- ISL_Print("(finally ");
+ THR_Print("(finally ");
node->finally_block()->Visit(this);
- ISL_Print(")");
+ THR_Print(")");
}
- ISL_Print(")");
+ THR_Print(")");
}
@@ -433,7 +433,7 @@ void AstPrinter::VisitThrowNode(ThrowNode* node) {
void AstPrinter::VisitStopNode(StopNode* node) {
- ISL_Print("(%s %s)", node->PrettyName(), node->message());
+ THR_Print("(%s %s)", node->PrettyName(), node->message());
}
@@ -446,13 +446,13 @@ void AstPrinter::PrintNode(AstNode* node) {
ASSERT(node != NULL);
AstPrinter ast_printer;
node->Visit(&ast_printer);
- ISL_Print("\n");
+ THR_Print("\n");
}
static void IndentN(int count) {
for (int i = 0; i < count; i++) {
- ISL_Print(" ");
+ THR_Print(" ");
}
}
@@ -463,22 +463,22 @@ void AstPrinter::PrintLocalScopeVariable(const LocalScope* scope,
ASSERT(scope != NULL);
ASSERT(var != NULL);
IndentN(indent);
- ISL_Print("(%s%s '%s'",
+ THR_Print("(%s%s '%s'",
var->is_final() ? "final " : "",
String::Handle(var->type().Name()).ToCString(),
var->name().ToCString());
if (var->owner() != scope) {
- ISL_Print(" alias");
+ THR_Print(" alias");
}
if (var->HasIndex()) {
- ISL_Print(" @%d", var->index());
+ THR_Print(" @%d", var->index());
if (var->is_captured()) {
- ISL_Print(" ctx %d", var->owner()->context_level());
+ THR_Print(" ctx %d", var->owner()->context_level());
}
} else if (var->owner()->function_level() != 0) {
- ISL_Print(" lev %d", var->owner()->function_level());
+ THR_Print(" lev %d", var->owner()->function_level());
}
- ISL_Print(" valid %" Pd "-%" Pd ")\n",
+ THR_Print(" valid %" Pd "-%" Pd ")\n",
var->token_pos(),
scope->end_token_pos());
}
@@ -495,16 +495,16 @@ void AstPrinter::PrintLocalScope(const LocalScope* scope,
const LocalScope* child = scope->child();
while (child != NULL) {
IndentN(indent);
- ISL_Print("{scope %p ", child);
+ THR_Print("{scope %p ", child);
if (child->HasContextLevel()) {
- ISL_Print("ctx %d numctxvar %d ",
+ THR_Print("ctx %d numctxvar %d ",
child->context_level(),
child->num_context_variables());
}
- ISL_Print("llev %d\n", child->loop_level());
+ THR_Print("llev %d\n", child->loop_level());
PrintLocalScope(child, 0, indent + kScopeIndent);
IndentN(indent);
- ISL_Print("}\n");
+ THR_Print("}\n");
child = child->sibling();
}
}
@@ -518,13 +518,13 @@ void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) {
const LocalScope* scope = node_sequence->scope();
ASSERT(scope != NULL);
const char* function_name = function.ToFullyQualifiedCString();
- ISL_Print("Scope for function '%s'\n{scope %p ", function_name, scope);
+ THR_Print("Scope for function '%s'\n{scope %p ", function_name, scope);
if (scope->HasContextLevel()) {
- ISL_Print("ctx %d numctxvar %d ",
+ THR_Print("ctx %d numctxvar %d ",
scope->context_level(),
scope->num_context_variables());
}
- ISL_Print("llev %d\n", scope->loop_level());
+ THR_Print("llev %d\n", scope->loop_level());
const int num_fixed_params = function.num_fixed_parameters();
const int num_params = num_fixed_params + function.NumOptionalParameters();
// Parameters must be listed first and must all appear in the top scope.
@@ -535,7 +535,7 @@ void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) {
LocalVariable* param = scope->VariableAt(pos);
ASSERT(param->owner() == scope); // No aliases should precede parameters.
IndentN(indent);
- ISL_Print("(param %s%s '%s'",
+ THR_Print("(param %s%s '%s'",
param->is_final() ? "final " : "",
String::Handle(param->type().Name()).ToCString(),
param->name().ToCString());
@@ -543,22 +543,22 @@ void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) {
if (pos >= num_fixed_params && pos < num_params) {
const Instance& default_parameter_value =
parsed_function.DefaultParameterValueAt(pos - num_fixed_params);
- ISL_Print(" =%s", default_parameter_value.ToCString());
+ THR_Print(" =%s", default_parameter_value.ToCString());
}
if (param->HasIndex()) {
- ISL_Print(" @%d", param->index());
+ THR_Print(" @%d", param->index());
if (param->is_captured()) {
- ISL_Print(" ctx %d", param->owner()->context_level());
+ THR_Print(" ctx %d", param->owner()->context_level());
}
}
- ISL_Print(" valid %" Pd "-%" Pd ")\n",
+ THR_Print(" valid %" Pd "-%" Pd ")\n",
param->token_pos(),
scope->end_token_pos());
pos++;
}
// Visit remaining non-parameter variables and children scopes.
PrintLocalScope(scope, pos, indent);
- ISL_Print("}\n");
+ THR_Print("}\n");
}
@@ -569,9 +569,9 @@ void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) {
AstPrinter ast_printer;
const char* function_name =
parsed_function.function().ToFullyQualifiedCString();
- ISL_Print("Ast for function '%s' {\n", function_name);
+ THR_Print("Ast for function '%s' {\n", function_name);
node_sequence->Visit(&ast_printer);
- ISL_Print("}\n");
+ THR_Print("}\n");
}
} // namespace dart
« no previous file with comments | « no previous file | runtime/vm/class_finalizer.cc » ('j') | runtime/vm/thread.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698