113 return _offset;
114 }
115
116 // Same question, explicit units. (Fields are aligned to the byte level.)
117 int offset_in_bytes() {
118 return offset();
119 }
120
121 // Is this field shared?
122 bool is_shared() {
123 // non-static fields of shared holders are cached
124 return _holder->is_shared() && !is_static();
125 }
126
127 // Is this field a constant?
128 //
129 // Clarification: A field is considered constant if:
130 // 1. The field is both static and final
131 // 2. The canonical holder of the field has undergone
132 // static initialization.
133 // 3. If the field is an object or array, then the oop
134 // in question is allocated in perm space.
135 // 4. The field is not one of the special static/final
136 // non-constant fields. These are java.lang.System.in
137 // and java.lang.System.out. Abomination.
138 //
139 // A field is also considered constant if it is marked @Stable
140 // and is non-null (or non-zero, if a primitive).
141 // For non-static fields, the null/zero check must be
142 // arranged by the user, as constant_value().is_null_or_zero().
143 bool is_constant() { return _is_constant; }
144
145 // Get the constant value of this field.
146 ciConstant constant_value() {
147 assert(is_static() && is_constant(), "illegal call to constant_value()");
148 return _constant_value;
149 }
150
151 // Get the constant value of non-static final field in the given
152 // object.
153 ciConstant constant_value_of(ciObject* object) {
154 assert(!is_static() && is_constant(), "only if field is non-static constant");
155 assert(object->is_instance(), "must be instance");
|
113 return _offset;
114 }
115
116 // Same question, explicit units. (Fields are aligned to the byte level.)
117 int offset_in_bytes() {
118 return offset();
119 }
120
121 // Is this field shared?
122 bool is_shared() {
123 // non-static fields of shared holders are cached
124 return _holder->is_shared() && !is_static();
125 }
126
127 // Is this field a constant?
128 //
129 // Clarification: A field is considered constant if:
130 // 1. The field is both static and final
131 // 2. The canonical holder of the field has undergone
132 // static initialization.
133 // 3. The field is not one of the special static/final
134 // non-constant fields. These are java.lang.System.in
135 // and java.lang.System.out. Abomination.
136 //
137 // A field is also considered constant if it is marked @Stable
138 // and is non-null (or non-zero, if a primitive).
139 // For non-static fields, the null/zero check must be
140 // arranged by the user, as constant_value().is_null_or_zero().
141 bool is_constant() { return _is_constant; }
142
143 // Get the constant value of this field.
144 ciConstant constant_value() {
145 assert(is_static() && is_constant(), "illegal call to constant_value()");
146 return _constant_value;
147 }
148
149 // Get the constant value of non-static final field in the given
150 // object.
151 ciConstant constant_value_of(ciObject* object) {
152 assert(!is_static() && is_constant(), "only if field is non-static constant");
153 assert(object->is_instance(), "must be instance");
|