src/share/vm/code/compiledIC.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2005, 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  *
  23  */
  24 

















  25 //-----------------------------------------------------------------------------
  26 // The CompiledIC represents a compiled inline cache.
  27 //
  28 // In order to make patching of the inline cache MT-safe, we only allow the following
  29 // transitions (when not at a safepoint):
  30 //
  31 //
  32 //         [1] --<--  Clean -->---  [1]
  33 //            /       (null)      \
  34 //           /                     \      /-<-\
  35 //          /          [2]          \    /     \
  36 //      Interpreted  ---------> Monomorphic     | [3]
  37 //  (compiledICHolderOop)        (klassOop)     |
  38 //          \                        /   \     /
  39 //       [4] \                      / [4] \->-/
  40 //            \->-  Megamorphic -<-/
  41 //                  (methodOop)
  42 //
  43 // The text in paranteses () refere to the value of the inline cache receiver (mov instruction)
  44 //


 222   void print()  PRODUCT_RETURN;
 223   void verify() PRODUCT_RETURN;
 224 };
 225 
 226 
 227 inline CompiledStaticCall* compiledStaticCall_before(address return_addr) {
 228   CompiledStaticCall* st = (CompiledStaticCall*)nativeCall_before(return_addr);
 229   st->verify();
 230   return st;
 231 }
 232 
 233 inline CompiledStaticCall* compiledStaticCall_at(address native_call) {
 234   CompiledStaticCall* st = (CompiledStaticCall*)native_call;
 235   st->verify();
 236   return st;
 237 }
 238 
 239 inline CompiledStaticCall* compiledStaticCall_at(Relocation* call_site) {
 240   return compiledStaticCall_at(call_site->addr());
 241 }


   1 /*
   2  * Copyright (c) 1997, 2010, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_CODE_COMPILEDIC_HPP
  26 #define SHARE_VM_CODE_COMPILEDIC_HPP
  27 
  28 #include "interpreter/linkResolver.hpp"
  29 #include "oops/compiledICHolderKlass.hpp"
  30 #include "oops/compiledICHolderOop.hpp"
  31 #include "oops/klassOop.hpp"
  32 #ifdef TARGET_ARCH_x86
  33 # include "nativeInst_x86.hpp"
  34 #endif
  35 #ifdef TARGET_ARCH_sparc
  36 # include "nativeInst_sparc.hpp"
  37 #endif
  38 #ifdef TARGET_ARCH_zero
  39 # include "nativeInst_zero.hpp"
  40 #endif
  41 
  42 //-----------------------------------------------------------------------------
  43 // The CompiledIC represents a compiled inline cache.
  44 //
  45 // In order to make patching of the inline cache MT-safe, we only allow the following
  46 // transitions (when not at a safepoint):
  47 //
  48 //
  49 //         [1] --<--  Clean -->---  [1]
  50 //            /       (null)      \
  51 //           /                     \      /-<-\
  52 //          /          [2]          \    /     \
  53 //      Interpreted  ---------> Monomorphic     | [3]
  54 //  (compiledICHolderOop)        (klassOop)     |
  55 //          \                        /   \     /
  56 //       [4] \                      / [4] \->-/
  57 //            \->-  Megamorphic -<-/
  58 //                  (methodOop)
  59 //
  60 // The text in paranteses () refere to the value of the inline cache receiver (mov instruction)
  61 //


 239   void print()  PRODUCT_RETURN;
 240   void verify() PRODUCT_RETURN;
 241 };
 242 
 243 
 244 inline CompiledStaticCall* compiledStaticCall_before(address return_addr) {
 245   CompiledStaticCall* st = (CompiledStaticCall*)nativeCall_before(return_addr);
 246   st->verify();
 247   return st;
 248 }
 249 
 250 inline CompiledStaticCall* compiledStaticCall_at(address native_call) {
 251   CompiledStaticCall* st = (CompiledStaticCall*)native_call;
 252   st->verify();
 253   return st;
 254 }
 255 
 256 inline CompiledStaticCall* compiledStaticCall_at(Relocation* call_site) {
 257   return compiledStaticCall_at(call_site->addr());
 258 }
 259 
 260 #endif // SHARE_VM_CODE_COMPILEDIC_HPP