hotspot/src/share/vm/opto/idealGraphPrinter.cpp
changeset 24424 2658d7834c6e
parent 22854 2787e48d6df9
child 27147 ed83dc5777e6
equal deleted inserted replaced
24358:8528b67f6562 24424:2658d7834c6e
     1 /*
     1 /*
     2  * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   153       }
   153       }
   154       _output = _stream;
   154       _output = _stream;
   155     } else {
   155     } else {
   156       // It would be nice if we could shut down cleanly but it should
   156       // It would be nice if we could shut down cleanly but it should
   157       // be an error if we can't connect to the visualizer.
   157       // be an error if we can't connect to the visualizer.
   158       fatal(err_msg_res("Couldn't connect to visualizer at %s:%d",
   158       fatal(err_msg_res("Couldn't connect to visualizer at %s:" INTX_FORMAT,
   159                         PrintIdealGraphAddress, PrintIdealGraphPort));
   159                         PrintIdealGraphAddress, PrintIdealGraphPort));
   160     }
   160     }
   161   }
   161   }
   162 
   162 
   163   _xml = new (ResourceObj::C_HEAP, mtCompiler) xmlStream(_output);
   163   _xml = new (ResourceObj::C_HEAP, mtCompiler) xmlStream(_output);
   193   }
   193   }
   194 }
   194 }
   195 
   195 
   196 
   196 
   197 void IdealGraphPrinter::begin_elem(const char *s) {
   197 void IdealGraphPrinter::begin_elem(const char *s) {
   198   _xml->begin_elem(s);
   198   _xml->begin_elem("%s", s);
   199 }
   199 }
   200 
   200 
   201 void IdealGraphPrinter::end_elem() {
   201 void IdealGraphPrinter::end_elem() {
   202   _xml->end_elem();
   202   _xml->end_elem();
   203 }
   203 }
   204 
   204 
   205 void IdealGraphPrinter::begin_head(const char *s) {
   205 void IdealGraphPrinter::begin_head(const char *s) {
   206   _xml->begin_head(s);
   206   _xml->begin_head("%s", s);
   207 }
   207 }
   208 
   208 
   209 void IdealGraphPrinter::end_head() {
   209 void IdealGraphPrinter::end_head() {
   210   _xml->end_head();
   210   _xml->end_head();
   211 }
   211 }
   221   text(val);
   221   text(val);
   222   _xml->print("'");
   222   _xml->print("'");
   223 }
   223 }
   224 
   224 
   225 void IdealGraphPrinter::head(const char *name) {
   225 void IdealGraphPrinter::head(const char *name) {
   226   _xml->head(name);
   226   _xml->head("%s", name);
   227 }
   227 }
   228 
   228 
   229 void IdealGraphPrinter::tail(const char *name) {
   229 void IdealGraphPrinter::tail(const char *name) {
   230   _xml->tail(name);
   230   _xml->tail(name);
   231 }
   231 }
   232 
   232 
   233 void IdealGraphPrinter::text(const char *s) {
   233 void IdealGraphPrinter::text(const char *s) {
   234   _xml->text(s);
   234   _xml->text("%s", s);
   235 }
   235 }
   236 
   236 
   237 void IdealGraphPrinter::print_prop(const char *name, int val) {
   237 void IdealGraphPrinter::print_prop(const char *name, int val) {
   238 
   238 
   239   stringStream stream;
   239   stringStream stream;
   357 
   357 
   358 // Print indent
   358 // Print indent
   359 void IdealGraphPrinter::print_indent() {
   359 void IdealGraphPrinter::print_indent() {
   360   tty->print_cr("printing ident %d", _depth);
   360   tty->print_cr("printing ident %d", _depth);
   361   for (int i = 0; i < _depth; i++) {
   361   for (int i = 0; i < _depth; i++) {
   362     _xml->print(INDENT);
   362     _xml->print("%s", INDENT);
   363   }
   363   }
   364 }
   364 }
   365 
   365 
   366 bool IdealGraphPrinter::traverse_outs() {
   366 bool IdealGraphPrinter::traverse_outs() {
   367   return _traverse_outs;
   367   return _traverse_outs;