comparison src/share/vm/opto/compile.hpp @ 12190:edb5ab0f3fe5

8001107: @Stable annotation for constant folding of lazily evaluated variables Reviewed-by: rbackman, twisti, kvn Contributed-by: john.r.rose@oracle.com, vladimir.x.ivanov@oracle.com
author vlivanov
date Tue, 10 Sep 2013 14:51:48 -0700
parents f2110083203d
children 1b64d46620a3
comparison
equal deleted inserted replaced
12188:cd16d587b0fa 12190:edb5ab0f3fe5
70 class relocInfo; 70 class relocInfo;
71 class Scope; 71 class Scope;
72 class StartNode; 72 class StartNode;
73 class SafePointNode; 73 class SafePointNode;
74 class JVMState; 74 class JVMState;
75 class Type;
75 class TypeData; 76 class TypeData;
76 class TypePtr; 77 class TypePtr;
77 class TypeOopPtr; 78 class TypeOopPtr;
78 class TypeFunc; 79 class TypeFunc;
79 class Unique_Node_List; 80 class Unique_Node_List;
117 friend class Compile; 118 friend class Compile;
118 119
119 int _index; // unique index, used with MergeMemNode 120 int _index; // unique index, used with MergeMemNode
120 const TypePtr* _adr_type; // normalized address type 121 const TypePtr* _adr_type; // normalized address type
121 ciField* _field; // relevant instance field, or null if none 122 ciField* _field; // relevant instance field, or null if none
123 const Type* _element; // relevant array element type, or null if none
122 bool _is_rewritable; // false if the memory is write-once only 124 bool _is_rewritable; // false if the memory is write-once only
123 int _general_index; // if this is type is an instance, the general 125 int _general_index; // if this is type is an instance, the general
124 // type that this is an instance of 126 // type that this is an instance of
125 127
126 void Init(int i, const TypePtr* at); 128 void Init(int i, const TypePtr* at);
127 129
128 public: 130 public:
129 int index() const { return _index; } 131 int index() const { return _index; }
130 const TypePtr* adr_type() const { return _adr_type; } 132 const TypePtr* adr_type() const { return _adr_type; }
131 ciField* field() const { return _field; } 133 ciField* field() const { return _field; }
134 const Type* element() const { return _element; }
132 bool is_rewritable() const { return _is_rewritable; } 135 bool is_rewritable() const { return _is_rewritable; }
133 bool is_volatile() const { return (_field ? _field->is_volatile() : false); } 136 bool is_volatile() const { return (_field ? _field->is_volatile() : false); }
134 int general_index() const { return (_general_index != 0) ? _general_index : _index; } 137 int general_index() const { return (_general_index != 0) ? _general_index : _index; }
135 138
136 void set_rewritable(bool z) { _is_rewritable = z; } 139 void set_rewritable(bool z) { _is_rewritable = z; }
137 void set_field(ciField* f) { 140 void set_field(ciField* f) {
138 assert(!_field,""); 141 assert(!_field,"");
139 _field = f; 142 _field = f;
140 if (f->is_final()) _is_rewritable = false; 143 if (f->is_final() || f->is_stable()) {
144 // In the case of @Stable, multiple writes are possible but may be assumed to be no-ops.
145 _is_rewritable = false;
146 }
147 }
148 void set_element(const Type* e) {
149 assert(_element == NULL, "");
150 _element = e;
141 } 151 }
142 152
143 void print_on(outputStream* st) PRODUCT_RETURN; 153 void print_on(outputStream* st) PRODUCT_RETURN;
144 }; 154 };
145 155