351 type_is_also_shared = !ciObjectFactory::is_initialized();
352 }
353 if (!type_is_also_shared)
354 return type; // Bummer.
355 }
356 _type = type;
357 return type;
358 }
359
360
361 // ------------------------------------------------------------------
362 // ciField::will_link
363 //
364 // Can a specific access to this field be made without causing
365 // link errors?
366 bool ciField::will_link(ciMethod* accessing_method,
367 Bytecodes::Code bc) {
368 VM_ENTRY_MARK;
369 assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
370 bc == Bytecodes::_getfield || bc == Bytecodes::_putfield ||
371 bc == Bytecodes::_vgetfield || bc == Bytecodes::_vwithfield,
372 "unexpected bytecode");
373
374 if (_offset == -1) {
375 // at creation we couldn't link to our holder so we need to
376 // maintain that stance, otherwise there's no safe way to use this
377 // ciField.
378 return false;
379 }
380
381 // Check for static/nonstatic mismatch
382 bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
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 }
|
351 type_is_also_shared = !ciObjectFactory::is_initialized();
352 }
353 if (!type_is_also_shared)
354 return type; // Bummer.
355 }
356 _type = type;
357 return type;
358 }
359
360
361 // ------------------------------------------------------------------
362 // ciField::will_link
363 //
364 // Can a specific access to this field be made without causing
365 // link errors?
366 bool ciField::will_link(ciMethod* accessing_method,
367 Bytecodes::Code bc) {
368 VM_ENTRY_MARK;
369 assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic ||
370 bc == Bytecodes::_getfield || bc == Bytecodes::_putfield ||
371 bc == Bytecodes::_vwithfield, "unexpected bytecode");
372
373 if (_offset == -1) {
374 // at creation we couldn't link to our holder so we need to
375 // maintain that stance, otherwise there's no safe way to use this
376 // ciField.
377 return false;
378 }
379
380 // Check for static/nonstatic mismatch
381 bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic);
382 if (is_static != this->is_static()) {
383 return false;
384 }
385
386 // Get and put can have different accessibility rules
387 bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic);
388 if (is_put) {
389 if (_known_to_link_with_put == accessing_method) {
390 return true;
391 }
|