383 if (is_static != this->is_static()) {
384 return false;
385 }
386
387 // Get and put can have different accessibility rules
388 bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic);
389 if (is_put) {
390 if (_known_to_link_with_put == accessing_method) {
391 return true;
392 }
393 } else {
394 if (_known_to_link_with_get == accessing_method->holder()) {
395 return true;
396 }
397 }
398
399 LinkInfo link_info(_holder->get_instanceKlass(),
400 _name->get_symbol(), _signature->get_symbol(),
401 methodHandle(THREAD, accessing_method->get_Method()));
402 fieldDescriptor result;
403 LinkResolver::resolve_field(result, link_info, bc, false, CHECK_AND_CLEAR_(false));
404
405 // update the hit-cache, unless there is a problem with memory scoping:
406 if (accessing_method->holder()->is_shared() || !is_shared()) {
407 if (is_put) {
408 _known_to_link_with_put = accessing_method;
409 } else {
410 _known_to_link_with_get = accessing_method->holder();
411 }
412 }
413
414 return true;
415 }
416
417 bool ciField::is_call_site_target() {
418 ciInstanceKlass* callsite_klass = CURRENT_ENV->CallSite_klass();
419 if (callsite_klass == nullptr)
420 return false;
421 return (holder()->is_subclass_of(callsite_klass) && (name() == ciSymbols::target_name()));
422 }
423
|
383 if (is_static != this->is_static()) {
384 return false;
385 }
386
387 // Get and put can have different accessibility rules
388 bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic);
389 if (is_put) {
390 if (_known_to_link_with_put == accessing_method) {
391 return true;
392 }
393 } else {
394 if (_known_to_link_with_get == accessing_method->holder()) {
395 return true;
396 }
397 }
398
399 LinkInfo link_info(_holder->get_instanceKlass(),
400 _name->get_symbol(), _signature->get_symbol(),
401 methodHandle(THREAD, accessing_method->get_Method()));
402 fieldDescriptor result;
403 LinkResolver::resolve_field(result, link_info, bc, StaticMode::dont_initialize_klass, CHECK_AND_CLEAR_(false));
404
405 // update the hit-cache, unless there is a problem with memory scoping:
406 if (accessing_method->holder()->is_shared() || !is_shared()) {
407 if (is_put) {
408 _known_to_link_with_put = accessing_method;
409 } else {
410 _known_to_link_with_get = accessing_method->holder();
411 }
412 }
413
414 return true;
415 }
416
417 bool ciField::is_call_site_target() {
418 ciInstanceKlass* callsite_klass = CURRENT_ENV->CallSite_klass();
419 if (callsite_klass == nullptr)
420 return false;
421 return (holder()->is_subclass_of(callsite_klass) && (name() == ciSymbols::target_name()));
422 }
423
|