< prev index next >

src/hotspot/share/runtime/deoptimization.hpp

Print this page
rev 60137 : 8227745: Enable Escape Analysis for Better Performance in the Presence of JVMTI Agents
Reviewed-by: mdoerr, goetz
rev 60138 : 8227745: delta webrev.5 -> webrev.6

*** 472,486 **** static juint _deoptimization_hist[Reason_LIMIT][1+Action_LIMIT][BC_CASE_LIMIT]; // Note: Histogram array size is 1-2 Kb. public: static void update_method_data_from_interpreter(MethodData* trap_mdo, int trap_bci, int reason); - - #if defined(ASSERT) && COMPILER2_OR_JVMCI - // Revert optimizations based on escape analysis for all compiled frames of all Java threads. - static void deoptimize_objects_alot_loop(); - #endif // defined(ASSERT) && COMPILER2_OR_JVMCI }; // EscapeBarriers should be put on execution paths, where JVMTI agents can access object // references held by java threads. // They provide means to revert optimizations based on escape analysis in a well synchronized manner --- 472,481 ----
*** 503,543 **** bool deoptimize_objects_internal(JavaThread* deoptee, intptr_t* fr_id); public: // Revert ea based optimizations for given deoptee thread EscapeBarrier(JavaThread* calling_thread, JavaThread* deoptee_thread, bool barrier_active) ! : _calling_thread(calling_thread), _deoptee_thread(deoptee_thread), _barrier_active(barrier_active) { if (_barrier_active) sync_and_suspend_one(); } // Revert ea based optimizations for all java threads EscapeBarrier(JavaThread* calling_thread, bool barrier_active) ! : _calling_thread(calling_thread), _deoptee_thread(NULL), _barrier_active(barrier_active) { if (_barrier_active) sync_and_suspend_all(); } #else public: EscapeBarrier(JavaThread* calling_thread, JavaThread* deoptee_thread, bool barrier_active) { } EscapeBarrier(JavaThread* calling_thread, bool barrier_active) { } #endif // COMPILER2_OR_JVMCI // Deoptimize objects, i.e. reallocate and relock them. The target frames are deoptimized. // The methods return false iff at least one reallocation failed. ! bool deoptimize_objects(intptr_t* fr_id) { return deoptimize_objects_internal(deoptee_thread(), fr_id); } bool deoptimize_objects(int depth) NOT_COMPILER2_OR_JVMCI_RETURN_(true); // Find and deoptimize non escaping objects and the holding frames on all stacks. bool deoptimize_objects_all_threads() NOT_COMPILER2_OR_JVMCI_RETURN_(true); // A java thread was added to the list of threads static void thread_added(JavaThread* jt) NOT_COMPILER2_OR_JVMCI_RETURN; #if COMPILER2_OR_JVMCI // Returns true iff objects were reallocated and relocked because of access through JVMTI static bool objs_are_deoptimized(JavaThread* thread, intptr_t* fr_id); ~EscapeBarrier() { if (!barrier_active()) return; if (all_threads()) { resume_all(); } else { --- 498,549 ---- bool deoptimize_objects_internal(JavaThread* deoptee, intptr_t* fr_id); public: // Revert ea based optimizations for given deoptee thread EscapeBarrier(JavaThread* calling_thread, JavaThread* deoptee_thread, bool barrier_active) ! : _calling_thread(calling_thread), _deoptee_thread(deoptee_thread), ! _barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false) ! COMPILER2_PRESENT(|| DoEscapeAnalysis))) { if (_barrier_active) sync_and_suspend_one(); } // Revert ea based optimizations for all java threads EscapeBarrier(JavaThread* calling_thread, bool barrier_active) ! : _calling_thread(calling_thread), _deoptee_thread(NULL), ! _barrier_active(barrier_active && (JVMCI_ONLY(UseJVMCICompiler) NOT_JVMCI(false) ! COMPILER2_PRESENT(|| DoEscapeAnalysis))) { if (_barrier_active) sync_and_suspend_all(); } #else public: EscapeBarrier(JavaThread* calling_thread, JavaThread* deoptee_thread, bool barrier_active) { } EscapeBarrier(JavaThread* calling_thread, bool barrier_active) { } + static bool deoptimizing_objects_for_all_threads() { return false; } #endif // COMPILER2_OR_JVMCI // Deoptimize objects, i.e. reallocate and relock them. The target frames are deoptimized. // The methods return false iff at least one reallocation failed. ! bool deoptimize_objects(intptr_t* fr_id) { ! return true COMPILER2_OR_JVMCI_PRESENT(&& deoptimize_objects_internal(deoptee_thread(), fr_id)); ! } bool deoptimize_objects(int depth) NOT_COMPILER2_OR_JVMCI_RETURN_(true); // Find and deoptimize non escaping objects and the holding frames on all stacks. bool deoptimize_objects_all_threads() NOT_COMPILER2_OR_JVMCI_RETURN_(true); // A java thread was added to the list of threads static void thread_added(JavaThread* jt) NOT_COMPILER2_OR_JVMCI_RETURN; + // A java thread was removed from the list of threads + static void thread_removed(JavaThread* jt) NOT_COMPILER2_OR_JVMCI_RETURN; #if COMPILER2_OR_JVMCI // Returns true iff objects were reallocated and relocked because of access through JVMTI static bool objs_are_deoptimized(JavaThread* thread, intptr_t* fr_id); + static bool deoptimizing_objects_for_all_threads() { return _deoptimizing_objects_for_all_threads; } + ~EscapeBarrier() { if (!barrier_active()) return; if (all_threads()) { resume_all(); } else {
< prev index next >