< prev index next >

src/share/vm/c1/c1_ValueStack.hpp

Print this page
rev 10446 : 8151818: C1: LIRGenerator::move_to_phi can't deal with illegal phi
Reviewed-by:


  82 
  83   bool is_same(ValueStack* s);                   // returns true if this & s's types match (w/o checking locals)
  84 
  85   // accessors
  86   IRScope* scope() const                         { return _scope; }
  87   ValueStack* caller_state() const               { return _caller_state; }
  88   int bci() const                                { return _bci; }
  89   Kind kind() const                              { return _kind; }
  90 
  91   int locals_size() const                        { return _locals.length(); }
  92   int stack_size() const                         { return _stack.length(); }
  93   int locks_size() const                         { return _locks.length(); }
  94   bool stack_is_empty() const                    { return _stack.is_empty(); }
  95   bool no_active_locks() const                   { return _locks.is_empty(); }
  96   int total_locks_size() const;
  97 
  98   // locals access
  99   void clear_locals();                           // sets all locals to NULL;
 100 
 101   void invalidate_local(int i) {
 102     assert(_locals.at(i)->type()->is_single_word() ||
 103            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 104     _locals.at_put(i, NULL);
 105   }
 106 
 107   Value local_at(int i) const {
 108     Value x = _locals.at(i);
 109     assert(x == NULL || x->type()->is_single_word() ||
 110            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 111     return x;
 112   }
 113 
 114   void store_local(int i, Value x) {
 115     // When overwriting local i, check if i - 1 was the start of a
 116     // double word local and kill it.
 117     if (i > 0) {
 118       Value prev = _locals.at(i - 1);
 119       if (prev != NULL && prev->type()->is_double_word()) {
 120         _locals.at_put(i - 1, NULL);
 121       }
 122     }
 123 
 124     _locals.at_put(i, x);
 125     if (x->type()->is_double_word()) {
 126       // hi-word of doubleword value is always NULL
 127       _locals.at_put(i + 1, NULL);
 128     }
 129   }
 130 
 131   // stack access
 132   Value stack_at(int i) const {
 133     Value x = _stack.at(i);
 134     assert(x->type()->is_single_word() ||
 135            _stack.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 136     return x;
 137   }
 138 
 139   Value stack_at_inc(int& i) const {
 140     Value x = stack_at(i);
 141     i += x->type()->size();
 142     return x;
 143   }
 144 
 145   void stack_at_put(int i, Value x) {
 146     _stack.at_put(i, x);
 147   }
 148 
 149   // pinning support
 150   void pin_stack_for_linear_scan();
 151 
 152   // iteration
 153   void values_do(ValueVisitor* f);
 154 




  82 
  83   bool is_same(ValueStack* s);                   // returns true if this & s's types match (w/o checking locals)
  84 
  85   // accessors
  86   IRScope* scope() const                         { return _scope; }
  87   ValueStack* caller_state() const               { return _caller_state; }
  88   int bci() const                                { return _bci; }
  89   Kind kind() const                              { return _kind; }
  90 
  91   int locals_size() const                        { return _locals.length(); }
  92   int stack_size() const                         { return _stack.length(); }
  93   int locks_size() const                         { return _locks.length(); }
  94   bool stack_is_empty() const                    { return _stack.is_empty(); }
  95   bool no_active_locks() const                   { return _locks.is_empty(); }
  96   int total_locks_size() const;
  97 
  98   // locals access
  99   void clear_locals();                           // sets all locals to NULL;
 100 
 101   void invalidate_local(int i) {
 102     assert(!_locals.at(i)->type()->is_double_word() ||
 103            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 104     _locals.at_put(i, NULL);
 105   }
 106 
 107   Value local_at(int i) const {
 108     Value x = _locals.at(i);
 109     assert(x == NULL || !x->type()->is_double_word() ||
 110            _locals.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 111     return x;
 112   }
 113 
 114   void store_local(int i, Value x) {
 115     // When overwriting local i, check if i - 1 was the start of a
 116     // double word local and kill it.
 117     if (i > 0) {
 118       Value prev = _locals.at(i - 1);
 119       if (prev != NULL && prev->type()->is_double_word()) {
 120         _locals.at_put(i - 1, NULL);
 121       }
 122     }
 123 
 124     _locals.at_put(i, x);
 125     if (x->type()->is_double_word()) {
 126       // hi-word of doubleword value is always NULL
 127       _locals.at_put(i + 1, NULL);
 128     }
 129   }
 130 
 131   // stack access
 132   Value stack_at(int i) const {
 133     Value x = _stack.at(i);
 134     assert(!x->type()->is_double_word() ||
 135            _stack.at(i + 1) == NULL, "hi-word of doubleword value must be NULL");
 136     return x;
 137   }
 138 
 139   Value stack_at_inc(int& i) const {
 140     Value x = stack_at(i);
 141     i += x->type()->size();
 142     return x;
 143   }
 144 
 145   void stack_at_put(int i, Value x) {
 146     _stack.at_put(i, x);
 147   }
 148 
 149   // pinning support
 150   void pin_stack_for_linear_scan();
 151 
 152   // iteration
 153   void values_do(ValueVisitor* f);
 154 


< prev index next >