src/share/vm/ci/ciEnv.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/ci

src/share/vm/ci/ciEnv.cpp

Print this page




  36 #include "classfile/vmSymbols.hpp"
  37 #include "code/codeCache.hpp"
  38 #include "code/scopeDesc.hpp"
  39 #include "compiler/compileBroker.hpp"
  40 #include "compiler/compileLog.hpp"
  41 #include "compiler/compilerOracle.hpp"
  42 #include "gc_interface/collectedHeap.inline.hpp"
  43 #include "interpreter/linkResolver.hpp"
  44 #include "memory/allocation.inline.hpp"
  45 #include "memory/oopFactory.hpp"
  46 #include "memory/universe.inline.hpp"
  47 #include "oops/methodData.hpp"
  48 #include "oops/objArrayKlass.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "oops/oop.inline2.hpp"
  51 #include "prims/jvmtiExport.hpp"
  52 #include "runtime/init.hpp"
  53 #include "runtime/reflection.hpp"
  54 #include "runtime/sharedRuntime.hpp"
  55 #include "runtime/thread.inline.hpp"

  56 #include "utilities/dtrace.hpp"
  57 #include "utilities/macros.hpp"
  58 #ifdef COMPILER1
  59 #include "c1/c1_Runtime1.hpp"
  60 #endif
  61 #ifdef COMPILER2
  62 #include "opto/runtime.hpp"
  63 #endif
  64 
  65 // ciEnv
  66 //
  67 // This class is the top level broker for requests from the compiler
  68 // to the VM.
  69 
  70 ciObject*              ciEnv::_null_object_instance;
  71 
  72 #define WK_KLASS_DEFN(name, ignore_s, ignore_o) ciInstanceKlass* ciEnv::_##name = NULL;
  73 WK_KLASSES_DO(WK_KLASS_DEFN)
  74 #undef WK_KLASS_DEFN
  75 


1121 }
1122 
1123 // ------------------------------------------------------------------
1124 // ciEnv::notice_inlined_method()
1125 void ciEnv::notice_inlined_method(ciMethod* method) {
1126   _num_inlined_bytecodes += method->code_size_for_inlining();
1127 }
1128 
1129 // ------------------------------------------------------------------
1130 // ciEnv::num_inlined_bytecodes()
1131 int ciEnv::num_inlined_bytecodes() const {
1132   return _num_inlined_bytecodes;
1133 }
1134 
1135 // ------------------------------------------------------------------
1136 // ciEnv::record_failure()
1137 void ciEnv::record_failure(const char* reason) {
1138   if (_failure_reason == NULL) {
1139     // Record the first failure reason.
1140     _failure_reason = reason;










1141   }
1142 }
1143 
1144 // ------------------------------------------------------------------
1145 // ciEnv::record_method_not_compilable()
1146 void ciEnv::record_method_not_compilable(const char* reason, bool all_tiers) {
1147   int new_compilable =
1148     all_tiers ? MethodCompilable_never : MethodCompilable_not_at_tier ;
1149 
1150   // Only note transitions to a worse state
1151   if (new_compilable > _compilable) {
1152     if (log() != NULL) {
1153       if (all_tiers) {
1154         log()->elem("method_not_compilable");
1155       } else {
1156         log()->elem("method_not_compilable_at_tier level='%d'",
1157                     current()->task()->comp_level());
1158       }
1159     }
1160     _compilable = new_compilable;




  36 #include "classfile/vmSymbols.hpp"
  37 #include "code/codeCache.hpp"
  38 #include "code/scopeDesc.hpp"
  39 #include "compiler/compileBroker.hpp"
  40 #include "compiler/compileLog.hpp"
  41 #include "compiler/compilerOracle.hpp"
  42 #include "gc_interface/collectedHeap.inline.hpp"
  43 #include "interpreter/linkResolver.hpp"
  44 #include "memory/allocation.inline.hpp"
  45 #include "memory/oopFactory.hpp"
  46 #include "memory/universe.inline.hpp"
  47 #include "oops/methodData.hpp"
  48 #include "oops/objArrayKlass.hpp"
  49 #include "oops/oop.inline.hpp"
  50 #include "oops/oop.inline2.hpp"
  51 #include "prims/jvmtiExport.hpp"
  52 #include "runtime/init.hpp"
  53 #include "runtime/reflection.hpp"
  54 #include "runtime/sharedRuntime.hpp"
  55 #include "runtime/thread.inline.hpp"
  56 #include "trace/tracing.hpp"
  57 #include "utilities/dtrace.hpp"
  58 #include "utilities/macros.hpp"
  59 #ifdef COMPILER1
  60 #include "c1/c1_Runtime1.hpp"
  61 #endif
  62 #ifdef COMPILER2
  63 #include "opto/runtime.hpp"
  64 #endif
  65 
  66 // ciEnv
  67 //
  68 // This class is the top level broker for requests from the compiler
  69 // to the VM.
  70 
  71 ciObject*              ciEnv::_null_object_instance;
  72 
  73 #define WK_KLASS_DEFN(name, ignore_s, ignore_o) ciInstanceKlass* ciEnv::_##name = NULL;
  74 WK_KLASSES_DO(WK_KLASS_DEFN)
  75 #undef WK_KLASS_DEFN
  76 


1122 }
1123 
1124 // ------------------------------------------------------------------
1125 // ciEnv::notice_inlined_method()
1126 void ciEnv::notice_inlined_method(ciMethod* method) {
1127   _num_inlined_bytecodes += method->code_size_for_inlining();
1128 }
1129 
1130 // ------------------------------------------------------------------
1131 // ciEnv::num_inlined_bytecodes()
1132 int ciEnv::num_inlined_bytecodes() const {
1133   return _num_inlined_bytecodes;
1134 }
1135 
1136 // ------------------------------------------------------------------
1137 // ciEnv::record_failure()
1138 void ciEnv::record_failure(const char* reason) {
1139   if (_failure_reason == NULL) {
1140     // Record the first failure reason.
1141     _failure_reason = reason;
1142   }
1143 }
1144 
1145 void ciEnv::report_failure(const char* reason) {
1146   // Create and fire JFR event
1147   EventCompilerFailure event;
1148   if (event.should_commit()) {
1149     event.set_compileID(compile_id());
1150     event.set_failure(reason);
1151     event.commit();
1152   }
1153 }
1154 
1155 // ------------------------------------------------------------------
1156 // ciEnv::record_method_not_compilable()
1157 void ciEnv::record_method_not_compilable(const char* reason, bool all_tiers) {
1158   int new_compilable =
1159     all_tiers ? MethodCompilable_never : MethodCompilable_not_at_tier ;
1160 
1161   // Only note transitions to a worse state
1162   if (new_compilable > _compilable) {
1163     if (log() != NULL) {
1164       if (all_tiers) {
1165         log()->elem("method_not_compilable");
1166       } else {
1167         log()->elem("method_not_compilable_at_tier level='%d'",
1168                     current()->task()->comp_level());
1169       }
1170     }
1171     _compilable = new_compilable;


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