comparison src/share/vm/opto/chaitin.hpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents f6f3bb0ee072
children 5da7201222d5
comparison
equal deleted inserted replaced
3737:9dc19b7d89a3 4137:04b9a2566eec
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
480 old->replace_by(v); 484 old->replace_by(v);
481 return yank_if_dead(old, current_block, &value, &regnd); 485 return yank_if_dead(old, current_block, &value, &regnd);
482 } 486 }
483 487
484 int yank_if_dead( Node *old, Block *current_block, Node_List *value, Node_List *regnd ); 488 int yank_if_dead( Node *old, Block *current_block, Node_List *value, Node_List *regnd );
489 int yank( Node *old, Block *current_block, Node_List *value, Node_List *regnd );
485 int elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List &regnd, bool can_change_regs ); 490 int elide_copy( Node *n, int k, Block *current_block, Node_List &value, Node_List &regnd, bool can_change_regs );
486 int use_prior_register( Node *copy, uint idx, Node *def, Block *current_block, Node_List &value, Node_List &regnd ); 491 int use_prior_register( Node *copy, uint idx, Node *def, Block *current_block, Node_List &value, Node_List &regnd );
487 bool may_be_copy_of_callee( Node *def ) const; 492 bool may_be_copy_of_callee( Node *def ) const;
488 493
489 // If nreg already contains the same constant as val then eliminate it 494 // If nreg already contains the same constant as val then eliminate it