0N/A/*
2250N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
1879N/A#define SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP
1879N/A
1879N/A#include "libadt/dict.hpp"
1879N/A#include "libadt/vectset.hpp"
1879N/A#include "utilities/growableArray.hpp"
1879N/A#include "utilities/ostream.hpp"
1879N/A#include "utilities/xmlstream.hpp"
1879N/A
0N/A#ifndef PRODUCT
0N/A
0N/Aclass Compile;
0N/Aclass PhaseIFG;
0N/Aclass PhaseChaitin;
0N/Aclass Matcher;
0N/Aclass Node;
0N/Aclass InlineTree;
0N/Aclass ciMethod;
0N/A
0N/Aclass IdealGraphPrinter
0N/A{
0N/Aprivate:
0N/A
0N/A static const char *INDENT;
0N/A static const char *TOP_ELEMENT;
0N/A static const char *GROUP_ELEMENT;
0N/A static const char *GRAPH_ELEMENT;
0N/A static const char *PROPERTIES_ELEMENT;
0N/A static const char *EDGES_ELEMENT;
0N/A static const char *PROPERTY_ELEMENT;
0N/A static const char *EDGE_ELEMENT;
0N/A static const char *NODE_ELEMENT;
0N/A static const char *NODES_ELEMENT;
0N/A static const char *CONTROL_FLOW_ELEMENT;
0N/A static const char *REMOVE_EDGE_ELEMENT;
0N/A static const char *REMOVE_NODE_ELEMENT;
0N/A static const char *METHOD_NAME_PROPERTY;
0N/A static const char *BLOCK_NAME_PROPERTY;
0N/A static const char *BLOCK_DOMINATOR_PROPERTY;
0N/A static const char *BLOCK_ELEMENT;
0N/A static const char *SUCCESSORS_ELEMENT;
0N/A static const char *SUCCESSOR_ELEMENT;
0N/A static const char *METHOD_IS_PUBLIC_PROPERTY;
0N/A static const char *METHOD_IS_STATIC_PROPERTY;
0N/A static const char *TRUE_VALUE;
0N/A static const char *NODE_NAME_PROPERTY;
0N/A static const char *EDGE_NAME_PROPERTY;
0N/A static const char *NODE_ID_PROPERTY;
0N/A static const char *FROM_PROPERTY;
0N/A static const char *TO_PROPERTY;
0N/A static const char *PROPERTY_NAME_PROPERTY;
0N/A static const char *GRAPH_NAME_PROPERTY;
0N/A static const char *INDEX_PROPERTY;
0N/A static const char *METHOD_ELEMENT;
0N/A static const char *INLINE_ELEMENT;
0N/A static const char *BYTECODES_ELEMENT;
0N/A static const char *METHOD_BCI_PROPERTY;
0N/A static const char *METHOD_SHORT_NAME_PROPERTY;
0N/A static const char *ASSEMBLY_ELEMENT;
0N/A
222N/A elapsedTimer _walk_time;
222N/A elapsedTimer _output_time;
222N/A elapsedTimer _build_blocks_time;
0N/A
0N/A static int _file_count;
0N/A networkStream *_stream;
222N/A xmlStream *_xml;
0N/A outputStream *_output;
0N/A ciMethod *_current_method;
0N/A int _depth;
0N/A char buffer[128];
0N/A bool _should_send_method;
0N/A PhaseChaitin* _chaitin;
0N/A bool _traverse_outs;
222N/A Compile *C;
0N/A
0N/A static void pre_node(Node* node, void *env);
0N/A static void post_node(Node* node, void *env);
0N/A
0N/A void print_indent();
0N/A void print_method(ciMethod *method, int bci, InlineTree *tree);
0N/A void print_inline_tree(InlineTree *tree);
2739N/A void visit_node(Node *n, bool edges, VectorSet* temp_set);
2739N/A void walk_nodes(Node *start, bool edges, VectorSet* temp_set);
222N/A void begin_elem(const char *s);
222N/A void end_elem();
222N/A void begin_head(const char *s);
222N/A void end_head();
222N/A void print_attr(const char *name, const char *val);
222N/A void print_attr(const char *name, intptr_t val);
222N/A void print_prop(const char *name, const char *val);
222N/A void print_prop(const char *name, int val);
222N/A void tail(const char *name);
222N/A void head(const char *name);
222N/A void text(const char *s);
222N/A intptr_t get_node_id(Node *n);
0N/A IdealGraphPrinter();
0N/A ~IdealGraphPrinter();
0N/A
0N/Apublic:
0N/A
0N/A static void clean_up();
0N/A static IdealGraphPrinter *printer();
0N/A
0N/A bool traverse_outs();
0N/A void set_traverse_outs(bool b);
0N/A outputStream *output();
0N/A void print_inlining(Compile* compile);
0N/A void begin_method(Compile* compile);
0N/A void end_method();
0N/A void print_method(Compile* compile, const char *name, int level=1, bool clear_nodes = false);
0N/A void print(Compile* compile, const char *name, Node *root, int level=1, bool clear_nodes = false);
0N/A void print_xml(const char *name);
0N/A
0N/A
0N/A};
0N/A
0N/A#endif
1879N/A
1879N/A#endif // SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP