< prev index next >

src/share/vm/oops/method.cpp

Print this page




  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/shared/collectedHeap.inline.hpp"
  31 #include "gc/shared/gcLocker.hpp"
  32 #include "gc/shared/generation.hpp"
  33 #include "interpreter/bytecodeStream.hpp"
  34 #include "interpreter/bytecodeTracer.hpp"
  35 #include "interpreter/bytecodes.hpp"
  36 #include "interpreter/interpreter.hpp"
  37 #include "interpreter/oopMapCache.hpp"
  38 #include "memory/heapInspection.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/metaspaceShared.hpp"
  41 #include "memory/oopFactory.hpp"
  42 #include "memory/resourceArea.hpp"

  43 #include "oops/constMethod.hpp"
  44 #include "oops/method.hpp"
  45 #include "oops/methodData.hpp"
  46 #include "oops/objArrayOop.inline.hpp"
  47 #include "oops/oop.inline.hpp"
  48 #include "oops/symbol.hpp"
  49 #include "oops/valueKlass.hpp"
  50 #include "prims/jvmtiExport.hpp"
  51 #include "prims/methodHandles.hpp"
  52 #include "prims/nativeLookup.hpp"
  53 #include "runtime/arguments.hpp"
  54 #include "runtime/compilationPolicy.hpp"
  55 #include "runtime/frame.inline.hpp"
  56 #include "runtime/handles.inline.hpp"
  57 #include "runtime/init.hpp"
  58 #include "runtime/orderAccess.inline.hpp"
  59 #include "runtime/relocator.hpp"
  60 #include "runtime/sharedRuntime.hpp"
  61 #include "runtime/signature.hpp"
  62 #include "utilities/quickSort.hpp"


  87   set_access_flags(access_flags);
  88   set_intrinsic_id(vmIntrinsics::_none);
  89   set_force_inline(false);
  90   set_hidden(false);
  91   set_dont_inline(false);
  92   set_has_injected_profile(false);
  93   set_method_data(NULL);
  94   clear_method_counters();
  95   set_vtable_index(Method::garbage_vtable_index);
  96 
  97   // Fix and bury in Method*
  98   set_interpreter_entry(NULL); // sets i2i entry and from_int
  99   set_adapter_entry(NULL);
 100   clear_code(false /* don't need a lock */); // from_c/from_i get set to c2i/i2i
 101 
 102   if (access_flags.is_native()) {
 103     clear_native_function();
 104     set_signature_handler(NULL);
 105   }
 106 


 107   NOT_PRODUCT(set_compiled_invocation_count(0);)
 108 }
 109 
 110 // Release Method*.  The nmethod will be gone when we get here because
 111 // we've walked the code cache.
 112 void Method::deallocate_contents(ClassLoaderData* loader_data) {
 113   MetadataFactory::free_metadata(loader_data, constMethod());
 114   set_constMethod(NULL);
 115   MetadataFactory::free_metadata(loader_data, method_data());
 116   set_method_data(NULL);
 117   MetadataFactory::free_metadata(loader_data, method_counters());
 118   clear_method_counters();
 119   // The nmethod will be gone when we get here.
 120   if (code() != NULL) _code = NULL;
 121 }
 122 
 123 address Method::get_i2c_entry() {
 124   assert(adapter() != NULL, "must have");
 125   return adapter()->get_i2c_entry();
 126 }


1846     }
1847   } else {
1848     return (mcs == NULL) ? 0 : mcs->invocation_counter()->count();
1849   }
1850 }
1851 
1852 int Method::backedge_count() {
1853   MethodCounters *mcs = method_counters();
1854   if (TieredCompilation) {
1855     MethodData* const mdo = method_data();
1856     if (((mcs != NULL) ? mcs->backedge_counter()->carry() : false) ||
1857         ((mdo != NULL) ? mdo->backedge_counter()->carry() : false)) {
1858       return InvocationCounter::count_limit;
1859     } else {
1860       return ((mcs != NULL) ? mcs->backedge_counter()->count() : 0) +
1861              ((mdo != NULL) ? mdo->backedge_counter()->count() : 0);
1862     }
1863   } else {
1864     return (mcs == NULL) ? 0 : mcs->backedge_counter()->count();
1865   }








1866 }
1867 
1868 int Method::highest_comp_level() const {
1869   const MethodCounters* mcs = method_counters();
1870   if (mcs != NULL) {
1871     return mcs->highest_comp_level();
1872   } else {
1873     return CompLevel_none;
1874   }
1875 }
1876 
1877 int Method::highest_osr_comp_level() const {
1878   const MethodCounters* mcs = method_counters();
1879   if (mcs != NULL) {
1880     return mcs->highest_osr_comp_level();
1881   } else {
1882     return CompLevel_none;
1883   }
1884 }
1885 




  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/shared/collectedHeap.inline.hpp"
  31 #include "gc/shared/gcLocker.hpp"
  32 #include "gc/shared/generation.hpp"
  33 #include "interpreter/bytecodeStream.hpp"
  34 #include "interpreter/bytecodeTracer.hpp"
  35 #include "interpreter/bytecodes.hpp"
  36 #include "interpreter/interpreter.hpp"
  37 #include "interpreter/oopMapCache.hpp"
  38 #include "memory/heapInspection.hpp"
  39 #include "memory/metadataFactory.hpp"
  40 #include "memory/metaspaceShared.hpp"
  41 #include "memory/oopFactory.hpp"
  42 #include "memory/resourceArea.hpp"
  43 #include "memory/vtBuffer.hpp"
  44 #include "oops/constMethod.hpp"
  45 #include "oops/method.hpp"
  46 #include "oops/methodData.hpp"
  47 #include "oops/objArrayOop.inline.hpp"
  48 #include "oops/oop.inline.hpp"
  49 #include "oops/symbol.hpp"
  50 #include "oops/valueKlass.hpp"
  51 #include "prims/jvmtiExport.hpp"
  52 #include "prims/methodHandles.hpp"
  53 #include "prims/nativeLookup.hpp"
  54 #include "runtime/arguments.hpp"
  55 #include "runtime/compilationPolicy.hpp"
  56 #include "runtime/frame.inline.hpp"
  57 #include "runtime/handles.inline.hpp"
  58 #include "runtime/init.hpp"
  59 #include "runtime/orderAccess.inline.hpp"
  60 #include "runtime/relocator.hpp"
  61 #include "runtime/sharedRuntime.hpp"
  62 #include "runtime/signature.hpp"
  63 #include "utilities/quickSort.hpp"


  88   set_access_flags(access_flags);
  89   set_intrinsic_id(vmIntrinsics::_none);
  90   set_force_inline(false);
  91   set_hidden(false);
  92   set_dont_inline(false);
  93   set_has_injected_profile(false);
  94   set_method_data(NULL);
  95   clear_method_counters();
  96   set_vtable_index(Method::garbage_vtable_index);
  97 
  98   // Fix and bury in Method*
  99   set_interpreter_entry(NULL); // sets i2i entry and from_int
 100   set_adapter_entry(NULL);
 101   clear_code(false /* don't need a lock */); // from_c/from_i get set to c2i/i2i
 102 
 103   if (access_flags.is_native()) {
 104     clear_native_function();
 105     set_signature_handler(NULL);
 106   }
 107 
 108   initialize_max_vt_buffer();
 109 
 110   NOT_PRODUCT(set_compiled_invocation_count(0);)
 111 }
 112 
 113 // Release Method*.  The nmethod will be gone when we get here because
 114 // we've walked the code cache.
 115 void Method::deallocate_contents(ClassLoaderData* loader_data) {
 116   MetadataFactory::free_metadata(loader_data, constMethod());
 117   set_constMethod(NULL);
 118   MetadataFactory::free_metadata(loader_data, method_data());
 119   set_method_data(NULL);
 120   MetadataFactory::free_metadata(loader_data, method_counters());
 121   clear_method_counters();
 122   // The nmethod will be gone when we get here.
 123   if (code() != NULL) _code = NULL;
 124 }
 125 
 126 address Method::get_i2c_entry() {
 127   assert(adapter() != NULL, "must have");
 128   return adapter()->get_i2c_entry();
 129 }


1849     }
1850   } else {
1851     return (mcs == NULL) ? 0 : mcs->invocation_counter()->count();
1852   }
1853 }
1854 
1855 int Method::backedge_count() {
1856   MethodCounters *mcs = method_counters();
1857   if (TieredCompilation) {
1858     MethodData* const mdo = method_data();
1859     if (((mcs != NULL) ? mcs->backedge_counter()->carry() : false) ||
1860         ((mdo != NULL) ? mdo->backedge_counter()->carry() : false)) {
1861       return InvocationCounter::count_limit;
1862     } else {
1863       return ((mcs != NULL) ? mcs->backedge_counter()->count() : 0) +
1864              ((mdo != NULL) ? mdo->backedge_counter()->count() : 0);
1865     }
1866   } else {
1867     return (mcs == NULL) ? 0 : mcs->backedge_counter()->count();
1868   }
1869 }
1870 
1871 void Method::initialize_max_vt_buffer() {
1872   long long max_entries = constMethod()->max_locals() + constMethod()->max_stack();
1873   max_entries *= 2; // Add margin for loops
1874   long long max_size = max_entries * (BigValueTypeThreshold + 8); // 8 -> header size
1875   int max_chunks = (int)(max_size / VTBufferChunk::max_alloc_size()) + 1;
1876   set_max_vt_buffer(MAX2(MinimumVTBufferChunkPerFrame, max_chunks));
1877 }
1878 
1879 int Method::highest_comp_level() const {
1880   const MethodCounters* mcs = method_counters();
1881   if (mcs != NULL) {
1882     return mcs->highest_comp_level();
1883   } else {
1884     return CompLevel_none;
1885   }
1886 }
1887 
1888 int Method::highest_osr_comp_level() const {
1889   const MethodCounters* mcs = method_counters();
1890   if (mcs != NULL) {
1891     return mcs->highest_osr_comp_level();
1892   } else {
1893     return CompLevel_none;
1894   }
1895 }
1896 


< prev index next >