138 }
139 _file_count++;
140 } else {
141 _stream = new (ResourceObj::C_HEAP, mtCompiler) networkStream();
142
143 // Try to connect to visualizer
144 if (_stream->connect(PrintIdealGraphAddress, PrintIdealGraphPort)) {
145 char c = 0;
146 _stream->read(&c, 1);
147 if (c != 'y') {
148 tty->print_cr("Client available, but does not want to receive data!");
149 _stream->close();
150 delete _stream;
151 _stream = NULL;
152 return;
153 }
154 _output = _stream;
155 } else {
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.
158 fatal(err_msg("Couldn't connect to visualizer at %s:%d",
159 PrintIdealGraphAddress, PrintIdealGraphPort));
160 }
161 }
162
163 _xml = new (ResourceObj::C_HEAP, mtCompiler) xmlStream(_output);
164
165 head(TOP_ELEMENT);
166 }
167
168 // Destructor, close file or network stream
169 IdealGraphPrinter::~IdealGraphPrinter() {
170
171 tail(TOP_ELEMENT);
172
173 // tty->print_cr("Walk time: %d", (int)_walk_time.milliseconds());
174 // tty->print_cr("Output time: %d", (int)_output_time.milliseconds());
175 // tty->print_cr("Build blocks time: %d", (int)_build_blocks_time.milliseconds());
176
177 if(_xml) {
178 delete _xml;
|
138 }
139 _file_count++;
140 } else {
141 _stream = new (ResourceObj::C_HEAP, mtCompiler) networkStream();
142
143 // Try to connect to visualizer
144 if (_stream->connect(PrintIdealGraphAddress, PrintIdealGraphPort)) {
145 char c = 0;
146 _stream->read(&c, 1);
147 if (c != 'y') {
148 tty->print_cr("Client available, but does not want to receive data!");
149 _stream->close();
150 delete _stream;
151 _stream = NULL;
152 return;
153 }
154 _output = _stream;
155 } else {
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.
158 fatal(err_msg_res("Couldn't connect to visualizer at %s:%d",
159 PrintIdealGraphAddress, PrintIdealGraphPort));
160 }
161 }
162
163 _xml = new (ResourceObj::C_HEAP, mtCompiler) xmlStream(_output);
164
165 head(TOP_ELEMENT);
166 }
167
168 // Destructor, close file or network stream
169 IdealGraphPrinter::~IdealGraphPrinter() {
170
171 tail(TOP_ELEMENT);
172
173 // tty->print_cr("Walk time: %d", (int)_walk_time.milliseconds());
174 // tty->print_cr("Output time: %d", (int)_output_time.milliseconds());
175 // tty->print_cr("Build blocks time: %d", (int)_build_blocks_time.milliseconds());
176
177 if(_xml) {
178 delete _xml;
|