155 // Field lookup failed. Will be detected by will_link. 156 _holder = declared_holder; 157 _offset = -1; 158 _is_constant = false; 159 return; 160 } 161 162 // Access check based on declared_holder. canonical_holder should not be used 163 // to check access because it can erroneously succeed. If this check fails, 164 // propagate the declared holder to will_link() which in turn will bail out 165 // compilation for this field access. 166 bool can_access = Reflection::verify_member_access(klass->get_Klass(), 167 declared_holder->get_Klass(), 168 canonical_holder, 169 field_desc.access_flags(), 170 true, false, THREAD); 171 if (!can_access) { 172 _holder = declared_holder; 173 _offset = -1; 174 _is_constant = false; 175 // It's possible the access check failed due to a nestmate access check 176 // encountering an exception. We can't propagate the exception from here 177 // so we have to clear it. If the access check happens again in a different 178 // context then the exception will be thrown there. 179 if (HAS_PENDING_EXCEPTION) { 180 CLEAR_PENDING_EXCEPTION; 181 } 182 return; 183 } 184 185 assert(canonical_holder == field_desc.field_holder(), "just checking"); 186 initialize_from(&field_desc); 187 } 188 189 ciField::ciField(fieldDescriptor *fd) : 190 _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) { 191 ASSERT_IN_VM; 192 193 // Get the field's name, signature, and type. 194 ciEnv* env = CURRENT_ENV; 195 _name = env->get_symbol(fd->name()); 196 _signature = env->get_symbol(fd->signature()); 197 198 BasicType field_type = fd->field_type(); 199 200 // If the field is a pointer type, get the klass of the 201 // field. | 155 // Field lookup failed. Will be detected by will_link. 156 _holder = declared_holder; 157 _offset = -1; 158 _is_constant = false; 159 return; 160 } 161 162 // Access check based on declared_holder. canonical_holder should not be used 163 // to check access because it can erroneously succeed. If this check fails, 164 // propagate the declared holder to will_link() which in turn will bail out 165 // compilation for this field access. 166 bool can_access = Reflection::verify_member_access(klass->get_Klass(), 167 declared_holder->get_Klass(), 168 canonical_holder, 169 field_desc.access_flags(), 170 true, false, THREAD); 171 if (!can_access) { 172 _holder = declared_holder; 173 _offset = -1; 174 _is_constant = false; 175 return; 176 } 177 178 assert(canonical_holder == field_desc.field_holder(), "just checking"); 179 initialize_from(&field_desc); 180 } 181 182 ciField::ciField(fieldDescriptor *fd) : 183 _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) { 184 ASSERT_IN_VM; 185 186 // Get the field's name, signature, and type. 187 ciEnv* env = CURRENT_ENV; 188 _name = env->get_symbol(fd->name()); 189 _signature = env->get_symbol(fd->signature()); 190 191 BasicType field_type = fd->field_type(); 192 193 // If the field is a pointer type, get the klass of the 194 // field. |