src/hotspot/share/runtime/deoptimization.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File open Sdiff src/hotspot/share/runtime

src/hotspot/share/runtime/deoptimization.cpp

Print this page




1915       if ((reason != Reason_rtm_state_change) && (trap_mdo != NULL) &&
1916           UseRTMDeopt && (nm->as_nmethod()->rtm_state() != ProfileRTM)) {
1917         trap_mdo->atomic_set_rtm_state(ProfileRTM);
1918       }
1919 #endif
1920       // For code aging we count traps separately here, using make_not_entrant()
1921       // as a guard against simultaneous deopts in multiple threads.
1922       if (reason == Reason_tenured && trap_mdo != NULL) {
1923         trap_mdo->inc_tenure_traps();
1924       }
1925     }
1926 
1927     if (inc_recompile_count) {
1928       trap_mdo->inc_overflow_recompile_count();
1929       if ((uint)trap_mdo->overflow_recompile_count() >
1930           (uint)PerBytecodeRecompilationCutoff) {
1931         // Give up on the method containing the bad BCI.
1932         if (trap_method() == nm->method()) {
1933           make_not_compilable = true;
1934         } else {
1935           trap_method->set_not_compilable(CompLevel_full_optimization, true, "overflow_recompile_count > PerBytecodeRecompilationCutoff");
1936           // But give grace to the enclosing nm->method().
1937         }
1938       }
1939     }
1940 
1941     // Reprofile
1942     if (reprofile) {
1943       CompilationPolicy::policy()->reprofile(trap_scope, nm->is_osr_method());
1944     }
1945 
1946     // Give up compiling
1947     if (make_not_compilable && !nm->method()->is_not_compilable(CompLevel_full_optimization)) {
1948       assert(make_not_entrant, "consistent");
1949       nm->method()->set_not_compilable(CompLevel_full_optimization);
1950     }
1951 
1952   } // Free marked resources
1953 
1954 }
1955 JRT_END
1956 
1957 ProfileData*
1958 Deoptimization::query_update_method_data(MethodData* trap_mdo,
1959                                          int trap_bci,
1960                                          Deoptimization::DeoptReason reason,
1961                                          bool update_total_trap_count,
1962 #if INCLUDE_JVMCI
1963                                          bool is_osr,
1964 #endif
1965                                          Method* compiled_method,
1966                                          //outputs:
1967                                          uint& ret_this_trap_count,
1968                                          bool& ret_maybe_prior_trap,
1969                                          bool& ret_maybe_prior_recompile) {




1915       if ((reason != Reason_rtm_state_change) && (trap_mdo != NULL) &&
1916           UseRTMDeopt && (nm->as_nmethod()->rtm_state() != ProfileRTM)) {
1917         trap_mdo->atomic_set_rtm_state(ProfileRTM);
1918       }
1919 #endif
1920       // For code aging we count traps separately here, using make_not_entrant()
1921       // as a guard against simultaneous deopts in multiple threads.
1922       if (reason == Reason_tenured && trap_mdo != NULL) {
1923         trap_mdo->inc_tenure_traps();
1924       }
1925     }
1926 
1927     if (inc_recompile_count) {
1928       trap_mdo->inc_overflow_recompile_count();
1929       if ((uint)trap_mdo->overflow_recompile_count() >
1930           (uint)PerBytecodeRecompilationCutoff) {
1931         // Give up on the method containing the bad BCI.
1932         if (trap_method() == nm->method()) {
1933           make_not_compilable = true;
1934         } else {
1935           trap_method->set_not_compilable("overflow_recompile_count > PerBytecodeRecompilationCutoff", CompLevel_full_optimization);
1936           // But give grace to the enclosing nm->method().
1937         }
1938       }
1939     }
1940 
1941     // Reprofile
1942     if (reprofile) {
1943       CompilationPolicy::policy()->reprofile(trap_scope, nm->is_osr_method());
1944     }
1945 
1946     // Give up compiling
1947     if (make_not_compilable && !nm->method()->is_not_compilable(CompLevel_full_optimization)) {
1948       assert(make_not_entrant, "consistent");
1949       nm->method()->set_not_compilable("give up compiling", CompLevel_full_optimization);
1950     }
1951 
1952   } // Free marked resources
1953 
1954 }
1955 JRT_END
1956 
1957 ProfileData*
1958 Deoptimization::query_update_method_data(MethodData* trap_mdo,
1959                                          int trap_bci,
1960                                          Deoptimization::DeoptReason reason,
1961                                          bool update_total_trap_count,
1962 #if INCLUDE_JVMCI
1963                                          bool is_osr,
1964 #endif
1965                                          Method* compiled_method,
1966                                          //outputs:
1967                                          uint& ret_this_trap_count,
1968                                          bool& ret_maybe_prior_trap,
1969                                          bool& ret_maybe_prior_recompile) {


src/hotspot/share/runtime/deoptimization.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File