Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/opto/live.hpp
32285 views
/*1* Copyright (c) 1997, 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_LIVE_HPP25#define SHARE_VM_OPTO_LIVE_HPP2627#include "libadt/port.hpp"28#include "libadt/vectset.hpp"29#include "opto/block.hpp"30#include "opto/indexSet.hpp"31#include "opto/phase.hpp"32#include "opto/regmask.hpp"3334class Block;35class PhaseCFG;36class VectorSet;37class IndexSet;3839//------------------------------LRG_List---------------------------------------40// Map Node indices to Live RanGe indices.41// Array lookup in the optimized case.42typedef GrowableArray<uint> LRG_List;4344//------------------------------PhaseLive--------------------------------------45// Compute live-in/live-out46class PhaseLive : public Phase {47// Array of Sets of values live at the start of a block.48// Indexed by block pre-order number.49IndexSet *_live;5051// Array of Sets of values defined locally in the block52// Indexed by block pre-order number.53IndexSet *_defs;5455// Array of delta-set pointers, indexed by block pre-order number56IndexSet **_deltas;57IndexSet *_free_IndexSet; // Free list of same5859Block_List *_worklist; // Worklist for iterative solution6061const PhaseCFG &_cfg; // Basic blocks62const LRG_List &_names; // Mapping from Nodes to live ranges63uint _maxlrg; // Largest live-range number64Arena *_arena;6566IndexSet *getset( Block *p );67IndexSet *getfreeset( );68void freeset( const Block *p );69void add_liveout( Block *p, uint r, VectorSet &first_pass );70void add_liveout( Block *p, IndexSet *lo, VectorSet &first_pass );7172public:73PhaseLive(const PhaseCFG &cfg, const LRG_List &names, Arena *arena);74~PhaseLive() {}75// Compute liveness info76void compute(uint maxlrg);77// Reset arena storage78void reset() { _live = NULL; }7980// Return the live-out set for this block81IndexSet *live( const Block * b ) { return &_live[b->_pre_order-1]; }8283#ifndef PRODUCT84void dump( const Block *b ) const;85void stats(uint iters) const;86#endif87};8889#endif // SHARE_VM_OPTO_LIVE_HPP909192