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