src/share/vm/opto/live.hpp

Thu, 31 Jul 2014 19:59:36 +0200

author
roland
date
Thu, 31 Jul 2014 19:59:36 +0200
changeset 7003
69ea58782b1a
parent 6198
55fb97c4c58d
child 6876
710a3c8b516e
permissions
-rw-r--r--

8054054: 8040121 is broken
Summary: C++ code pattern from 8040121 is incorrect
Reviewed-by: kvn

duke@435 1 /*
mikael@6198 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
stefank@2314 25 #ifndef SHARE_VM_OPTO_LIVE_HPP
stefank@2314 26 #define SHARE_VM_OPTO_LIVE_HPP
stefank@2314 27
stefank@2314 28 #include "libadt/port.hpp"
stefank@2314 29 #include "libadt/vectset.hpp"
stefank@2314 30 #include "opto/block.hpp"
stefank@2314 31 #include "opto/indexSet.hpp"
stefank@2314 32 #include "opto/phase.hpp"
stefank@2314 33 #include "opto/regmask.hpp"
stefank@2314 34
duke@435 35 class Block;
duke@435 36 class PhaseCFG;
duke@435 37 class VectorSet;
duke@435 38 class IndexSet;
duke@435 39
neliasso@4728 40 //------------------------------LRG_List---------------------------------------
neliasso@4728 41 // Map Node indices to Live RanGe indices.
neliasso@4728 42 // Array lookup in the optimized case.
adlertz@5722 43 typedef GrowableArray<uint> LRG_List;
neliasso@4728 44
duke@435 45 //------------------------------PhaseLive--------------------------------------
duke@435 46 // Compute live-in/live-out
duke@435 47 class PhaseLive : public Phase {
duke@435 48 // Array of Sets of values live at the start of a block.
duke@435 49 // Indexed by block pre-order number.
duke@435 50 IndexSet *_live;
duke@435 51
duke@435 52 // Array of Sets of values defined locally in the block
duke@435 53 // Indexed by block pre-order number.
duke@435 54 IndexSet *_defs;
duke@435 55
duke@435 56 // Array of delta-set pointers, indexed by block pre-order number
duke@435 57 IndexSet **_deltas;
duke@435 58 IndexSet *_free_IndexSet; // Free list of same
duke@435 59
duke@435 60 Block_List *_worklist; // Worklist for iterative solution
duke@435 61
duke@435 62 const PhaseCFG &_cfg; // Basic blocks
neliasso@4949 63 const LRG_List &_names; // Mapping from Nodes to live ranges
duke@435 64 uint _maxlrg; // Largest live-range number
duke@435 65 Arena *_arena;
duke@435 66
duke@435 67 IndexSet *getset( Block *p );
duke@435 68 IndexSet *getfreeset( );
duke@435 69 void freeset( const Block *p );
duke@435 70 void add_liveout( Block *p, uint r, VectorSet &first_pass );
duke@435 71 void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );
duke@435 72
duke@435 73 public:
neliasso@4949 74 PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena);
duke@435 75 ~PhaseLive() {}
duke@435 76 // Compute liveness info
duke@435 77 void compute(uint maxlrg);
duke@435 78 // Reset arena storage
duke@435 79 void reset() { _live = NULL; }
duke@435 80
duke@435 81 // Return the live-out set for this block
duke@435 82 IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; }
duke@435 83
duke@435 84 #ifndef PRODUCT
duke@435 85 void dump( const Block *b ) const;
duke@435 86 void stats(uint iters) const;
duke@435 87 #endif
duke@435 88 };
stefank@2314 89
stefank@2314 90 #endif // SHARE_VM_OPTO_LIVE_HPP

mercurial