src/share/vm/opto/phase.hpp

Tue, 08 Aug 2017 15:57:29 +0800

author
aoqi
date
Tue, 08 Aug 2017 15:57:29 +0800
changeset 6876
710a3c8b516e
parent 6503
a9becfeecd1b
parent 0
f90c822e73f8
child 7994
04ff2f6cd0eb
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 #ifndef SHARE_VM_OPTO_PHASE_HPP
aoqi@0 26 #define SHARE_VM_OPTO_PHASE_HPP
aoqi@0 27
aoqi@0 28 #include "libadt/port.hpp"
aoqi@0 29 #include "runtime/timer.hpp"
aoqi@0 30
aoqi@0 31 class Compile;
aoqi@0 32
aoqi@0 33 //------------------------------Phase------------------------------------------
aoqi@0 34 // Most optimizations are done in Phases. Creating a phase does any long
aoqi@0 35 // running analysis required, and caches the analysis in internal data
aoqi@0 36 // structures. Later the analysis is queried using transform() calls to
aoqi@0 37 // guide transforming the program. When the Phase is deleted, so is any
aoqi@0 38 // cached analysis info. This basic Phase class mostly contains timing and
aoqi@0 39 // memory management code.
aoqi@0 40 class Phase : public StackObj {
aoqi@0 41 public:
aoqi@0 42 enum PhaseNumber {
aoqi@0 43 Compiler, // Top-level compiler phase
aoqi@0 44 Parser, // Parse bytecodes
aoqi@0 45 Remove_Useless, // Remove useless nodes
aoqi@0 46 Optimistic, // Optimistic analysis phase
aoqi@0 47 GVN, // Pessimistic global value numbering phase
aoqi@0 48 Ins_Select, // Instruction selection phase
aoqi@0 49 CFG, // Build a CFG
aoqi@0 50 BlockLayout, // Linear ordering of blocks
aoqi@0 51 Register_Allocation, // Register allocation, duh
aoqi@0 52 LIVE, // Dragon-book LIVE range problem
aoqi@0 53 StringOpts, // StringBuilder related optimizations
aoqi@0 54 Interference_Graph, // Building the IFG
aoqi@0 55 Coalesce, // Coalescing copies
aoqi@0 56 Ideal_Loop, // Find idealized trip-counted loops
aoqi@0 57 Macro_Expand, // Expand macro nodes
aoqi@0 58 Peephole, // Apply peephole optimizations
aoqi@0 59 last_phase
aoqi@0 60 };
aoqi@0 61 protected:
aoqi@0 62 enum PhaseNumber _pnum; // Phase number (for stat gathering)
aoqi@0 63
aoqi@0 64 #ifndef PRODUCT
aoqi@0 65 static int _total_bytes_compiled;
aoqi@0 66
aoqi@0 67 // accumulated timers
aoqi@0 68 static elapsedTimer _t_totalCompilation;
aoqi@0 69 static elapsedTimer _t_methodCompilation;
aoqi@0 70 static elapsedTimer _t_stubCompilation;
aoqi@0 71 #endif
aoqi@0 72
aoqi@0 73 // The next timers used for LogCompilation
aoqi@0 74 static elapsedTimer _t_parser;
aoqi@0 75 static elapsedTimer _t_optimizer;
aoqi@0 76 public:
aoqi@0 77 // ConnectionGraph can't be Phase since it is used after EA done.
aoqi@0 78 static elapsedTimer _t_escapeAnalysis;
aoqi@0 79 static elapsedTimer _t_connectionGraph;
aoqi@0 80 protected:
aoqi@0 81 static elapsedTimer _t_idealLoop;
aoqi@0 82 static elapsedTimer _t_ccp;
aoqi@0 83 static elapsedTimer _t_matcher;
aoqi@0 84 static elapsedTimer _t_registerAllocation;
aoqi@0 85 static elapsedTimer _t_output;
aoqi@0 86
aoqi@0 87 #ifndef PRODUCT
aoqi@0 88 static elapsedTimer _t_graphReshaping;
aoqi@0 89 static elapsedTimer _t_scheduler;
aoqi@0 90 static elapsedTimer _t_blockOrdering;
aoqi@0 91 static elapsedTimer _t_macroEliminate;
aoqi@0 92 static elapsedTimer _t_macroExpand;
aoqi@0 93 static elapsedTimer _t_peephole;
aoqi@0 94 static elapsedTimer _t_postalloc_expand;
aoqi@0 95 static elapsedTimer _t_codeGeneration;
aoqi@0 96 static elapsedTimer _t_registerMethod;
aoqi@0 97 static elapsedTimer _t_temporaryTimer1;
aoqi@0 98 static elapsedTimer _t_temporaryTimer2;
aoqi@0 99 static elapsedTimer _t_idealLoopVerify;
aoqi@0 100
aoqi@0 101 // Subtimers for _t_optimizer
aoqi@0 102 static elapsedTimer _t_iterGVN;
aoqi@0 103 static elapsedTimer _t_iterGVN2;
aoqi@0 104 static elapsedTimer _t_incrInline;
aoqi@0 105
aoqi@0 106 // Subtimers for _t_registerAllocation
aoqi@0 107 static elapsedTimer _t_ctorChaitin;
aoqi@0 108 static elapsedTimer _t_buildIFGphysical;
aoqi@0 109 static elapsedTimer _t_computeLive;
aoqi@0 110 static elapsedTimer _t_regAllocSplit;
aoqi@0 111 static elapsedTimer _t_postAllocCopyRemoval;
aoqi@0 112 static elapsedTimer _t_fixupSpills;
aoqi@0 113
aoqi@0 114 // Subtimers for _t_output
aoqi@0 115 static elapsedTimer _t_instrSched;
aoqi@0 116 static elapsedTimer _t_buildOopMaps;
aoqi@0 117 #endif
aoqi@0 118 public:
aoqi@0 119 Compile * C;
aoqi@0 120 Phase( PhaseNumber pnum );
aoqi@0 121 #ifndef PRODUCT
aoqi@0 122 static void print_timers();
aoqi@0 123 #endif
aoqi@0 124 };
aoqi@0 125
aoqi@0 126 #endif // SHARE_VM_OPTO_PHASE_HPP

mercurial