src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8067836 Sdiff src/share/vm/oops

src/share/vm/oops/method.cpp

Print this page
rev 7616 : 8067836: The Universe::flush_foo methods belong in CodeCache.
Summary: Move this code to CodeCache.
Reviewed-by: kbarrett, kvn
   1 /*
   2  * Copyright (c) 1997, 2014, 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 #include "precompiled.hpp"
  26 #include "classfile/metadataOnStackMark.hpp"
  27 #include "classfile/systemDictionary.hpp"

  28 #include "code/debugInfoRec.hpp"
  29 #include "gc_interface/collectedHeap.inline.hpp"
  30 #include "interpreter/bytecodeStream.hpp"
  31 #include "interpreter/bytecodeTracer.hpp"
  32 #include "interpreter/bytecodes.hpp"
  33 #include "interpreter/interpreter.hpp"
  34 #include "interpreter/oopMapCache.hpp"
  35 #include "memory/gcLocker.hpp"
  36 #include "memory/generation.hpp"
  37 #include "memory/heapInspection.hpp"
  38 #include "memory/metadataFactory.hpp"
  39 #include "memory/oopFactory.hpp"
  40 #include "oops/constMethod.hpp"
  41 #include "oops/methodData.hpp"
  42 #include "oops/method.hpp"
  43 #include "oops/oop.inline.hpp"
  44 #include "oops/symbol.hpp"
  45 #include "prims/jvmtiExport.hpp"
  46 #include "prims/methodHandles.hpp"
  47 #include "prims/nativeLookup.hpp"


1710   _next = NULL;
1711 }
1712 
1713 void BreakpointInfo::set(Method* method) {
1714 #ifdef ASSERT
1715   {
1716     Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
1717     if (code == Bytecodes::_breakpoint)
1718       code = method->orig_bytecode_at(_bci);
1719     assert(orig_bytecode() == code, "original bytecode must be the same");
1720   }
1721 #endif
1722   Thread *thread = Thread::current();
1723   *method->bcp_from(_bci) = Bytecodes::_breakpoint;
1724   method->incr_number_of_breakpoints(thread);
1725   SystemDictionary::notice_modification();
1726   {
1727     // Deoptimize all dependents on this method
1728     HandleMark hm(thread);
1729     methodHandle mh(thread, method);
1730     Universe::flush_dependents_on_method(mh);
1731   }
1732 }
1733 
1734 void BreakpointInfo::clear(Method* method) {
1735   *method->bcp_from(_bci) = orig_bytecode();
1736   assert(method->number_of_breakpoints() > 0, "must not go negative");
1737   method->decr_number_of_breakpoints(Thread::current());
1738 }
1739 
1740 // jmethodID handling
1741 
1742 // This is a block allocating object, sort of like JNIHandleBlock, only a
1743 // lot simpler.
1744 // It's allocated on the CHeap because once we allocate a jmethodID, we can
1745 // never get rid of it.
1746 
1747 static const int min_block_size = 8;
1748 
1749 class JNIMethodBlockNode : public CHeapObj<mtClass> {
1750   friend class JNIMethodBlock;


   1 /*
   2  * Copyright (c) 1997, 2015, 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 #include "precompiled.hpp"
  26 #include "classfile/metadataOnStackMark.hpp"
  27 #include "classfile/systemDictionary.hpp"
  28 #include "code/codeCache.hpp"
  29 #include "code/debugInfoRec.hpp"
  30 #include "gc_interface/collectedHeap.inline.hpp"
  31 #include "interpreter/bytecodeStream.hpp"
  32 #include "interpreter/bytecodeTracer.hpp"
  33 #include "interpreter/bytecodes.hpp"
  34 #include "interpreter/interpreter.hpp"
  35 #include "interpreter/oopMapCache.hpp"
  36 #include "memory/gcLocker.hpp"
  37 #include "memory/generation.hpp"
  38 #include "memory/heapInspection.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/oopFactory.hpp"
  41 #include "oops/constMethod.hpp"
  42 #include "oops/methodData.hpp"
  43 #include "oops/method.hpp"
  44 #include "oops/oop.inline.hpp"
  45 #include "oops/symbol.hpp"
  46 #include "prims/jvmtiExport.hpp"
  47 #include "prims/methodHandles.hpp"
  48 #include "prims/nativeLookup.hpp"


1711   _next = NULL;
1712 }
1713 
1714 void BreakpointInfo::set(Method* method) {
1715 #ifdef ASSERT
1716   {
1717     Bytecodes::Code code = (Bytecodes::Code) *method->bcp_from(_bci);
1718     if (code == Bytecodes::_breakpoint)
1719       code = method->orig_bytecode_at(_bci);
1720     assert(orig_bytecode() == code, "original bytecode must be the same");
1721   }
1722 #endif
1723   Thread *thread = Thread::current();
1724   *method->bcp_from(_bci) = Bytecodes::_breakpoint;
1725   method->incr_number_of_breakpoints(thread);
1726   SystemDictionary::notice_modification();
1727   {
1728     // Deoptimize all dependents on this method
1729     HandleMark hm(thread);
1730     methodHandle mh(thread, method);
1731     CodeCache::flush_dependents_on_method(mh);
1732   }
1733 }
1734 
1735 void BreakpointInfo::clear(Method* method) {
1736   *method->bcp_from(_bci) = orig_bytecode();
1737   assert(method->number_of_breakpoints() > 0, "must not go negative");
1738   method->decr_number_of_breakpoints(Thread::current());
1739 }
1740 
1741 // jmethodID handling
1742 
1743 // This is a block allocating object, sort of like JNIHandleBlock, only a
1744 // lot simpler.
1745 // It's allocated on the CHeap because once we allocate a jmethodID, we can
1746 // never get rid of it.
1747 
1748 static const int min_block_size = 8;
1749 
1750 class JNIMethodBlockNode : public CHeapObj<mtClass> {
1751   friend class JNIMethodBlock;


src/share/vm/oops/method.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File