comparison src/share/vm/opto/chaitin.hpp @ 3939:f6f3bb0ee072

7088955: add C2 IR support to the SA Reviewed-by: kvn
author never
date Sun, 11 Sep 2011 14:48:24 -0700
parents 8f47d8870d9a
children 5da7201222d5
comparison
equal deleted inserted replaced
3938:e6b1331a51d2 3939:f6f3bb0ee072
1 /* 1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
48 #define OPTO_LRG_HIGH_FREQ BLOCK_FREQUENCY(0.25) 48 #define OPTO_LRG_HIGH_FREQ BLOCK_FREQUENCY(0.25)
49 49
50 //------------------------------LRG-------------------------------------------- 50 //------------------------------LRG--------------------------------------------
51 // Live-RanGe structure. 51 // Live-RanGe structure.
52 class LRG : public ResourceObj { 52 class LRG : public ResourceObj {
53 friend class VMStructs;
53 public: 54 public:
54 enum { SPILL_REG=29999 }; // Register number of a spilled LRG 55 enum { SPILL_REG=29999 }; // Register number of a spilled LRG
55 56
56 double _cost; // 2 for loads/1 for stores times block freq 57 double _cost; // 2 for loads/1 for stores times block freq
57 double _area; // Sum of all simultaneously live values 58 double _area; // Sum of all simultaneously live values
179 180
180 //------------------------------LRG_List--------------------------------------- 181 //------------------------------LRG_List---------------------------------------
181 // Map Node indices to Live RanGe indices. 182 // Map Node indices to Live RanGe indices.
182 // Array lookup in the optimized case. 183 // Array lookup in the optimized case.
183 class LRG_List : public ResourceObj { 184 class LRG_List : public ResourceObj {
185 friend class VMStructs;
184 uint _cnt, _max; 186 uint _cnt, _max;
185 uint* _lidxs; 187 uint* _lidxs;
186 ReallocMark _nesting; // assertion check for reallocations 188 ReallocMark _nesting; // assertion check for reallocations
187 public: 189 public:
188 LRG_List( uint max ); 190 LRG_List( uint max );
209 // and a list of other vertices. Can union vertices (and their edges) 211 // and a list of other vertices. Can union vertices (and their edges)
210 // together. The IFG needs to be really really fast, and also fairly 212 // together. The IFG needs to be really really fast, and also fairly
211 // abstract! It needs abstraction so I can fiddle with the implementation to 213 // abstract! It needs abstraction so I can fiddle with the implementation to
212 // get even more speed. 214 // get even more speed.
213 class PhaseIFG : public Phase { 215 class PhaseIFG : public Phase {
216 friend class VMStructs;
214 // Current implementation: a triangular adjacency list. 217 // Current implementation: a triangular adjacency list.
215 218
216 // Array of adjacency-lists, indexed by live-range number 219 // Array of adjacency-lists, indexed by live-range number
217 IndexSet *_adjs; 220 IndexSet *_adjs;
218 221
292 #endif 295 #endif
293 296
294 //------------------------------Chaitin---------------------------------------- 297 //------------------------------Chaitin----------------------------------------
295 // Briggs-Chaitin style allocation, mostly. 298 // Briggs-Chaitin style allocation, mostly.
296 class PhaseChaitin : public PhaseRegAlloc { 299 class PhaseChaitin : public PhaseRegAlloc {
300 friend class VMStructs;
297 301
298 int _trip_cnt; 302 int _trip_cnt;
299 int _alternate; 303 int _alternate;
300 304
301 uint _maxlrg; // Max live range number 305 uint _maxlrg; // Max live range number