src/share/vm/code/compiledIC.cpp

Print this page




   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  *
  23  */
  24 
  25 #include "incls/_precompiled.incl"
  26 #include "incls/_compiledIC.cpp.incl"















  27 
  28 
  29 // Every time a compiled IC is changed or its type is being accessed,
  30 // either the CompiledIC_lock must be set or we must be at a safe point.
  31 
  32 //-----------------------------------------------------------------------------
  33 // Low-level access to an inline cache. Private, since they might not be
  34 // MT-safe to use.
  35 
  36 void CompiledIC::set_cached_oop(oop cache) {
  37   assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
  38   assert (!is_optimized(), "an optimized virtual call does not have a cached oop");
  39   assert (cache == NULL || cache != badOop, "invalid oop");
  40 
  41   if (TraceCompiledIC) {
  42     tty->print("  ");
  43     print_compiled_ic();
  44     tty->print_cr(" changing oop to " INTPTR_FORMAT, (address)cache);
  45   }
  46 




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/systemDictionary.hpp"
  27 #include "code/codeCache.hpp"
  28 #include "code/compiledIC.hpp"
  29 #include "code/icBuffer.hpp"
  30 #include "code/nmethod.hpp"
  31 #include "code/vtableStubs.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "interpreter/linkResolver.hpp"
  34 #include "memory/oopFactory.hpp"
  35 #include "oops/methodOop.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "oops/symbolOop.hpp"
  38 #include "runtime/icache.hpp"
  39 #include "runtime/sharedRuntime.hpp"
  40 #include "runtime/stubRoutines.hpp"
  41 #include "utilities/events.hpp"
  42 
  43 
  44 // Every time a compiled IC is changed or its type is being accessed,
  45 // either the CompiledIC_lock must be set or we must be at a safe point.
  46 
  47 //-----------------------------------------------------------------------------
  48 // Low-level access to an inline cache. Private, since they might not be
  49 // MT-safe to use.
  50 
  51 void CompiledIC::set_cached_oop(oop cache) {
  52   assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "");
  53   assert (!is_optimized(), "an optimized virtual call does not have a cached oop");
  54   assert (cache == NULL || cache != badOop, "invalid oop");
  55 
  56   if (TraceCompiledIC) {
  57     tty->print("  ");
  58     print_compiled_ic();
  59     tty->print_cr(" changing oop to " INTPTR_FORMAT, (address)cache);
  60   }
  61