changeset 5603:dd2cf1d1248b

Merge
author adlertz
date Sat, 12 Oct 2013 01:29:27 +0000
parents 8b80b262e501 (current diff) 2348b2726e1d (diff)
children ed2c74787eb5
files
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/chaitin.hpp	Fri Oct 11 10:14:02 2013 -0700
+++ b/src/share/vm/opto/chaitin.hpp	Sat Oct 12 01:29:27 2013 +0000
@@ -52,6 +52,7 @@
 class LRG : public ResourceObj {
   friend class VMStructs;
 public:
+  static const uint AllStack_size = 0xFFFFF; // This mask size is used to tell that the mask of this LRG supports stack positions
   enum { SPILL_REG=29999 };     // Register number of a spilled LRG
 
   double _cost;                 // 2 for loads/1 for stores times block freq
@@ -80,14 +81,21 @@
 private:
   uint _eff_degree;             // Effective degree: Sum of neighbors _num_regs
 public:
-  int degree() const { assert( _degree_valid, "" ); return _eff_degree; }
+  int degree() const { assert( _degree_valid , "" ); return _eff_degree; }
   // Degree starts not valid and any change to the IFG neighbor
   // set makes it not valid.
-  void set_degree( uint degree ) { _eff_degree = degree; debug_only(_degree_valid = 1;) }
+  void set_degree( uint degree ) {
+    _eff_degree = degree;
+    debug_only(_degree_valid = 1;)
+    assert(!_mask.is_AllStack() || (_mask.is_AllStack() && lo_degree()), "_eff_degree can't be bigger than AllStack_size - _num_regs if the mask supports stack registers");
+  }
   // Made a change that hammered degree
   void invalid_degree() { debug_only(_degree_valid=0;) }
   // Incrementally modify degree.  If it was correct, it should remain correct
-  void inc_degree( uint mod ) { _eff_degree += mod; }
+  void inc_degree( uint mod ) {
+    _eff_degree += mod;
+    assert(!_mask.is_AllStack() || (_mask.is_AllStack() && lo_degree()), "_eff_degree can't be bigger than AllStack_size - _num_regs if the mask supports stack registers");
+  }
   // Compute the degree between 2 live ranges
   int compute_degree( LRG &l ) const;
 
@@ -95,9 +103,9 @@
   RegMask _mask;                // Allowed registers for this LRG
   uint _mask_size;              // cache of _mask.Size();
 public:
-  int compute_mask_size() const { return _mask.is_AllStack() ? 65535 : _mask.Size(); }
+  int compute_mask_size() const { return _mask.is_AllStack() ? AllStack_size : _mask.Size(); }
   void set_mask_size( int size ) {
-    assert((size == 65535) || (size == (int)_mask.Size()), "");
+    assert((size == (int)AllStack_size) || (size == (int)_mask.Size()), "");
     _mask_size = size;
 #ifdef ASSERT
     _msize_valid=1;
--- a/src/share/vm/opto/ifg.cpp	Fri Oct 11 10:14:02 2013 -0700
+++ b/src/share/vm/opto/ifg.cpp	Sat Oct 12 01:29:27 2013 +0000
@@ -677,7 +677,7 @@
             } else {            // Common case: size 1 bound removal
               if( lrg.mask().Member(r_reg) ) {
                 lrg.Remove(r_reg);
-                lrg.set_mask_size(lrg.mask().is_AllStack() ? 65535:old_size-1);
+                lrg.set_mask_size(lrg.mask().is_AllStack() ? LRG::AllStack_size : old_size - 1);
               }
             }
             // If 'l' goes completely dry, it must spill.