src/share/vm/opto/coalesce.hpp

Mon, 27 May 2013 12:56:34 +0200

author
stefank
date
Mon, 27 May 2013 12:56:34 +0200
changeset 5195
95c00927be11
parent 4949
8373c19be854
child 5722
8c83625e3a53
permissions
-rw-r--r--

8015428: Remove unused CDS support from StringTable
Summary: The string in StringTable is not used by CDS anymore. Remove the unnecessary code in preparation for 8015422: Large performance hit when the StringTable is walked twice in Parallel Scavenge
Reviewed-by: pliden, tschatzl, coleenp

duke@435 1 /*
stefank@2314 2 * Copyright (c) 1997, 2010, 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_COALESCE_HPP
stefank@2314 26 #define SHARE_VM_OPTO_COALESCE_HPP
stefank@2314 27
stefank@2314 28 #include "opto/phase.hpp"
stefank@2314 29
duke@435 30 class LoopTree;
duke@435 31 class LRG;
duke@435 32 class LRG_List;
duke@435 33 class Matcher;
duke@435 34 class PhaseIFG;
duke@435 35 class PhaseCFG;
duke@435 36
duke@435 37 //------------------------------PhaseCoalesce----------------------------------
duke@435 38 class PhaseCoalesce : public Phase {
duke@435 39 protected:
duke@435 40 PhaseChaitin &_phc;
duke@435 41
duke@435 42 public:
duke@435 43 // Coalesce copies
neliasso@4949 44 PhaseCoalesce(PhaseChaitin &phc)
neliasso@4949 45 : Phase(Coalesce)
neliasso@4949 46 , _phc(phc) {}
duke@435 47
duke@435 48 virtual void verify() = 0;
duke@435 49
duke@435 50 // Coalesce copies
neliasso@4949 51 void coalesce_driver();
duke@435 52
duke@435 53 // Coalesce copies in this block
neliasso@4949 54 virtual void coalesce(Block *b) = 0;
duke@435 55
duke@435 56 // Attempt to coalesce live ranges defined by these 2
neliasso@4949 57 void combine_these_two(Node *n1, Node *n2);
duke@435 58
neliasso@4949 59 LRG &lrgs(uint lidx) { return _phc.lrgs(lidx); }
duke@435 60 #ifndef PRODUCT
duke@435 61 // Dump internally name
neliasso@4949 62 void dump(Node *n) const;
duke@435 63 // Dump whole shebang
duke@435 64 void dump() const;
duke@435 65 #endif
duke@435 66 };
duke@435 67
duke@435 68 //------------------------------PhaseAggressiveCoalesce------------------------
duke@435 69 // Aggressively, pessimistic coalesce copies. Aggressive means ignore graph
duke@435 70 // colorability; perhaps coalescing to the point of forcing a spill.
duke@435 71 // Pessimistic means we cannot coalesce if 2 live ranges interfere. This
duke@435 72 // implies we do not hit a fixed point right away.
duke@435 73 class PhaseAggressiveCoalesce : public PhaseCoalesce {
duke@435 74 uint _unique;
duke@435 75 public:
duke@435 76 // Coalesce copies
duke@435 77 PhaseAggressiveCoalesce( PhaseChaitin &chaitin ) : PhaseCoalesce(chaitin) {}
duke@435 78
duke@435 79 virtual void verify() { };
duke@435 80
duke@435 81 // Aggressively coalesce copies in this block
duke@435 82 virtual void coalesce( Block *b );
duke@435 83
duke@435 84 // Where I fail to coalesce, manifest virtual copies as the Real Thing
duke@435 85 void insert_copies( Matcher &matcher );
duke@435 86
duke@435 87 // Copy insertion needs some smarts in case live ranges overlap
duke@435 88 void insert_copy_with_overlap( Block *b, Node *copy, uint dst_name, uint src_name );
duke@435 89 };
duke@435 90
duke@435 91
duke@435 92 //------------------------------PhaseConservativeCoalesce----------------------
duke@435 93 // Conservatively, pessimistic coalesce copies. Conservative means do not
duke@435 94 // coalesce if the resultant live range will be uncolorable. Pessimistic
duke@435 95 // means we cannot coalesce if 2 live ranges interfere. This implies we do
duke@435 96 // not hit a fixed point right away.
duke@435 97 class PhaseConservativeCoalesce : public PhaseCoalesce {
duke@435 98 IndexSet _ulr; // Union live range interferences
duke@435 99 public:
duke@435 100 // Coalesce copies
duke@435 101 PhaseConservativeCoalesce( PhaseChaitin &chaitin );
duke@435 102
duke@435 103 virtual void verify();
duke@435 104
duke@435 105 // Conservatively coalesce copies in this block
duke@435 106 virtual void coalesce( Block *b );
duke@435 107
duke@435 108 // Coalesce this chain of copies away
duke@435 109 bool copy_copy( Node *dst_copy, Node *src_copy, Block *b, uint bindex );
duke@435 110
duke@435 111 void union_helper( Node *lr1_node, Node *lr2_node, uint lr1, uint lr2, Node *src_def, Node *dst_copy, Node *src_copy, Block *b, uint bindex );
duke@435 112
duke@435 113 uint compute_separating_interferences(Node *dst_copy, Node *src_copy, Block *b, uint bindex, RegMask &rm, uint rm_size, uint reg_degree, uint lr1, uint lr2);
duke@435 114
duke@435 115 void update_ifg(uint lr1, uint lr2, IndexSet *n_lr1, IndexSet *n_lr2);
duke@435 116 };
stefank@2314 117
stefank@2314 118 #endif // SHARE_VM_OPTO_COALESCE_HPP

mercurial