1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/vm/opto/phase.hpp Sat Dec 01 00:00:00 2007 +0000 1.3 @@ -0,0 +1,113 @@ 1.4 +/* 1.5 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. 1.11 + * 1.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 + * version 2 for more details (a copy is included in the LICENSE file that 1.16 + * accompanied this code). 1.17 + * 1.18 + * You should have received a copy of the GNU General Public License version 1.19 + * 2 along with this work; if not, write to the Free Software Foundation, 1.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 + * 1.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 1.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 1.24 + * have any questions. 1.25 + * 1.26 + */ 1.27 + 1.28 +class Compile; 1.29 + 1.30 +//------------------------------Phase------------------------------------------ 1.31 +// Most optimizations are done in Phases. Creating a phase does any long 1.32 +// running analysis required, and caches the analysis in internal data 1.33 +// structures. Later the analysis is queried using transform() calls to 1.34 +// guide transforming the program. When the Phase is deleted, so is any 1.35 +// cached analysis info. This basic Phase class mostly contains timing and 1.36 +// memory management code. 1.37 +class Phase : public StackObj { 1.38 +public: 1.39 + enum PhaseNumber { 1.40 + Compiler, // Top-level compiler phase 1.41 + Parser, // Parse bytecodes 1.42 + Remove_Useless, // Remove useless nodes 1.43 + Optimistic, // Optimistic analysis phase 1.44 + GVN, // Pessimistic global value numbering phase 1.45 + Ins_Select, // Instruction selection phase 1.46 + Copy_Elimination, // Copy Elimination 1.47 + Dead_Code_Elimination, // DCE and compress Nodes 1.48 + Conditional_Constant, // Conditional Constant Propagation 1.49 + CFG, // Build a CFG 1.50 + DefUse, // Build Def->Use chains 1.51 + Register_Allocation, // Register allocation, duh 1.52 + LIVE, // Dragon-book LIVE range problem 1.53 + Interference_Graph, // Building the IFG 1.54 + Coalesce, // Coalescing copies 1.55 + Conditional_CProp, // Conditional Constant Propagation 1.56 + Ideal_Loop, // Find idealized trip-counted loops 1.57 + Macro_Expand, // Expand macro nodes 1.58 + Peephole, // Apply peephole optimizations 1.59 + last_phase 1.60 + }; 1.61 +protected: 1.62 + enum PhaseNumber _pnum; // Phase number (for stat gathering) 1.63 + 1.64 +#ifndef PRODUCT 1.65 + static int _total_bytes_compiled; 1.66 + 1.67 + // accumulated timers 1.68 + static elapsedTimer _t_totalCompilation; 1.69 + static elapsedTimer _t_methodCompilation; 1.70 + static elapsedTimer _t_stubCompilation; 1.71 +#endif 1.72 + 1.73 +// The next timers used for LogCompilation 1.74 + static elapsedTimer _t_parser; 1.75 + static elapsedTimer _t_escapeAnalysis; 1.76 + static elapsedTimer _t_optimizer; 1.77 + static elapsedTimer _t_idealLoop; 1.78 + static elapsedTimer _t_ccp; 1.79 + static elapsedTimer _t_matcher; 1.80 + static elapsedTimer _t_registerAllocation; 1.81 + static elapsedTimer _t_output; 1.82 + 1.83 +#ifndef PRODUCT 1.84 + static elapsedTimer _t_graphReshaping; 1.85 + static elapsedTimer _t_scheduler; 1.86 + static elapsedTimer _t_removeEmptyBlocks; 1.87 + static elapsedTimer _t_macroExpand; 1.88 + static elapsedTimer _t_peephole; 1.89 + static elapsedTimer _t_codeGeneration; 1.90 + static elapsedTimer _t_registerMethod; 1.91 + static elapsedTimer _t_temporaryTimer1; 1.92 + static elapsedTimer _t_temporaryTimer2; 1.93 + 1.94 +// Subtimers for _t_optimizer 1.95 + static elapsedTimer _t_iterGVN; 1.96 + static elapsedTimer _t_iterGVN2; 1.97 + 1.98 +// Subtimers for _t_registerAllocation 1.99 + static elapsedTimer _t_ctorChaitin; 1.100 + static elapsedTimer _t_buildIFGphysical; 1.101 + static elapsedTimer _t_computeLive; 1.102 + static elapsedTimer _t_regAllocSplit; 1.103 + static elapsedTimer _t_postAllocCopyRemoval; 1.104 + static elapsedTimer _t_fixupSpills; 1.105 + 1.106 +// Subtimers for _t_output 1.107 + static elapsedTimer _t_instrSched; 1.108 + static elapsedTimer _t_buildOopMaps; 1.109 +#endif 1.110 +public: 1.111 + Compile * C; 1.112 + Phase( PhaseNumber pnum ); 1.113 +#ifndef PRODUCT 1.114 + static void print_timers(); 1.115 +#endif 1.116 +};