Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/opto/idealGraphPrinter.hpp
32285 views
/*1* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP25#define SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP2627#include "libadt/dict.hpp"28#include "libadt/vectset.hpp"29#include "utilities/growableArray.hpp"30#include "utilities/ostream.hpp"31#include "utilities/xmlstream.hpp"3233#ifndef PRODUCT3435class Compile;36class PhaseIFG;37class PhaseChaitin;38class Matcher;39class Node;40class InlineTree;41class ciMethod;4243class IdealGraphPrinter : public CHeapObj<mtCompiler> {44private:4546static const char *INDENT;47static const char *TOP_ELEMENT;48static const char *GROUP_ELEMENT;49static const char *GRAPH_ELEMENT;50static const char *PROPERTIES_ELEMENT;51static const char *EDGES_ELEMENT;52static const char *PROPERTY_ELEMENT;53static const char *EDGE_ELEMENT;54static const char *NODE_ELEMENT;55static const char *NODES_ELEMENT;56static const char *CONTROL_FLOW_ELEMENT;57static const char *REMOVE_EDGE_ELEMENT;58static const char *REMOVE_NODE_ELEMENT;59static const char *METHOD_NAME_PROPERTY;60static const char *BLOCK_NAME_PROPERTY;61static const char *BLOCK_DOMINATOR_PROPERTY;62static const char *BLOCK_ELEMENT;63static const char *SUCCESSORS_ELEMENT;64static const char *SUCCESSOR_ELEMENT;65static const char *METHOD_IS_PUBLIC_PROPERTY;66static const char *METHOD_IS_STATIC_PROPERTY;67static const char *TRUE_VALUE;68static const char *NODE_NAME_PROPERTY;69static const char *EDGE_NAME_PROPERTY;70static const char *NODE_ID_PROPERTY;71static const char *FROM_PROPERTY;72static const char *TO_PROPERTY;73static const char *PROPERTY_NAME_PROPERTY;74static const char *GRAPH_NAME_PROPERTY;75static const char *INDEX_PROPERTY;76static const char *METHOD_ELEMENT;77static const char *INLINE_ELEMENT;78static const char *BYTECODES_ELEMENT;79static const char *METHOD_BCI_PROPERTY;80static const char *METHOD_SHORT_NAME_PROPERTY;81static const char *ASSEMBLY_ELEMENT;8283elapsedTimer _walk_time;84elapsedTimer _output_time;85elapsedTimer _build_blocks_time;8687static int _file_count;88networkStream *_stream;89xmlStream *_xml;90outputStream *_output;91ciMethod *_current_method;92int _depth;93char buffer[128];94bool _should_send_method;95PhaseChaitin* _chaitin;96bool _traverse_outs;97Compile *C;9899static void pre_node(Node* node, void *env);100static void post_node(Node* node, void *env);101102void print_indent();103void print_method(ciMethod *method, int bci, InlineTree *tree);104void print_inline_tree(InlineTree *tree);105void visit_node(Node *n, bool edges, VectorSet* temp_set);106void walk_nodes(Node *start, bool edges, VectorSet* temp_set);107void begin_elem(const char *s);108void end_elem();109void begin_head(const char *s);110void end_head();111void print_attr(const char *name, const char *val);112void print_attr(const char *name, intptr_t val);113void print_prop(const char *name, const char *val);114void print_prop(const char *name, int val);115void tail(const char *name);116void head(const char *name);117void text(const char *s);118intptr_t get_node_id(Node *n);119IdealGraphPrinter();120~IdealGraphPrinter();121122public:123124static void clean_up();125static IdealGraphPrinter *printer();126127bool traverse_outs();128void set_traverse_outs(bool b);129outputStream *output();130void print_inlining(Compile* compile);131void begin_method(Compile* compile);132void end_method();133void print_method(Compile* compile, const char *name, int level=1, bool clear_nodes = false);134void print(Compile* compile, const char *name, Node *root, int level=1, bool clear_nodes = false);135void print_xml(const char *name);136};137138#endif139140#endif // SHARE_VM_OPTO_IDEALGRAPHPRINTER_HPP141142143