示例#1
0
bool CompiledIC::is_call_to_interpreted() const {  
  assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
  // Call to interpreter if destination is either calling to a stub (if it
  // is optimized), or calling to an I2C
  bool is_call_to_interpreted = false;
#ifdef COMPILER1
  if (!is_optimized()) {
    is_call_to_interpreted =
      Runtime1::blob_for(Runtime1::interpreter_entries_id)->contains(ic_destination());
  } else {
    // Check if we are calling into our own codeblob (i.e., to a stub)
    CodeBlob* cb = CodeCache::find_blob(_ic_call->instruction_address());
    is_call_to_interpreted = cb->contains(ic_destination());
  }
#else
  if (!is_optimized()) {
    CodeBlob* cb = CodeCache::find_blob(ic_destination());  
    is_call_to_interpreted = (cb != NULL && cb->is_c2i_adapter());
  } else {
    // Check if we are calling into our own codeblob (i.e., to a stub)
    CodeBlob* cb = CodeCache::find_blob(_ic_call->instruction_address());
    is_call_to_interpreted = cb->contains(ic_destination());
  }
#endif // COMPILER1
  assert(!is_call_to_interpreted || is_optimized() || (cached_oop() != NULL && cached_oop()->is_compiledICHolder()), "sanity check");
  return is_call_to_interpreted;
}