< prev index next >

src/hotspot/share/code/compiledIC.cpp

Print this page
rev 48535 : [mq]: 8194990
   1 /*
   2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 397       if (TraceICs) {
 398          ResourceMark rm(thread);
 399          tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to %s: %s",
 400            p2i(instruction_address()),
 401            (info.to_aot() ? "aot" : "interpreter"),
 402            method->print_value_string());
 403       }
 404     } else {
 405       // Call via method-klass-holder
 406       InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
 407       if (TraceICs) {
 408          ResourceMark rm(thread);
 409          tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
 410       }
 411     }
 412   } else {
 413     // Call to compiled code
 414     bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL);
 415 #ifdef ASSERT
 416     CodeBlob* cb = CodeCache::find_blob_unsafe(info.entry());
 417     assert (cb->is_compiled(), "must be compiled!");
 418 #endif /* ASSERT */
 419 
 420     // This is MT safe if we come from a clean-cache and go through a
 421     // non-verified entry point
 422     bool safe = SafepointSynchronize::is_at_safepoint() ||
 423                 (!is_in_transition_state() && (info.is_optimized() || static_bound || is_clean()));
 424 
 425     if (!safe) {
 426       InlineCacheBuffer::create_transition_stub(this, info.cached_metadata(), info.entry());
 427     } else {
 428       if (is_optimized()) {
 429         set_ic_destination(info.entry());
 430       } else {
 431         set_ic_destination_and_value(info.entry(), info.cached_metadata());
 432       }
 433     }
 434 
 435     if (TraceICs) {
 436       ResourceMark rm(thread);
 437       assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");


   1 /*
   2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 397       if (TraceICs) {
 398          ResourceMark rm(thread);
 399          tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to %s: %s",
 400            p2i(instruction_address()),
 401            (info.to_aot() ? "aot" : "interpreter"),
 402            method->print_value_string());
 403       }
 404     } else {
 405       // Call via method-klass-holder
 406       InlineCacheBuffer::create_transition_stub(this, info.claim_cached_icholder(), info.entry());
 407       if (TraceICs) {
 408          ResourceMark rm(thread);
 409          tty->print_cr ("IC@" INTPTR_FORMAT ": monomorphic to interpreter via icholder ", p2i(instruction_address()));
 410       }
 411     }
 412   } else {
 413     // Call to compiled code
 414     bool static_bound = info.is_optimized() || (info.cached_metadata() == NULL);
 415 #ifdef ASSERT
 416     CodeBlob* cb = CodeCache::find_blob_unsafe(info.entry());
 417     assert (cb != NULL && cb->is_compiled(), "must be compiled!");
 418 #endif /* ASSERT */
 419 
 420     // This is MT safe if we come from a clean-cache and go through a
 421     // non-verified entry point
 422     bool safe = SafepointSynchronize::is_at_safepoint() ||
 423                 (!is_in_transition_state() && (info.is_optimized() || static_bound || is_clean()));
 424 
 425     if (!safe) {
 426       InlineCacheBuffer::create_transition_stub(this, info.cached_metadata(), info.entry());
 427     } else {
 428       if (is_optimized()) {
 429         set_ic_destination(info.entry());
 430       } else {
 431         set_ic_destination_and_value(info.entry(), info.cached_metadata());
 432       }
 433     }
 434 
 435     if (TraceICs) {
 436       ResourceMark rm(thread);
 437       assert(info.cached_metadata() == NULL || info.cached_metadata()->is_klass(), "must be");


< prev index next >