< prev index next >
src/hotspot/share/runtime/thread.hpp
Print this page
@@ -279,10 +279,18 @@
public:
void enter_signal_handler() { _num_nested_signal++; }
void leave_signal_handler() { _num_nested_signal--; }
bool is_inside_signal_handler() const { return _num_nested_signal > 0; }
+ // Determines if a heap allocation failure will be retried
+ // (e.g., by deoptimizing and re-executing in the interpreter).
+ // In this case, the failed allocation must raise
+ // Universe::out_of_memory_error_retry() and omit side effects
+ // such as JVMTI events and handling -XX:+HeapDumpOnOutOfMemoryError
+ // and -XX:OnOutOfMemoryError.
+ virtual bool in_retryable_allocation() const { return false; }
+
#ifdef ASSERT
void set_suspendible_thread() {
_suspendible_thread = true;
}
@@ -1046,10 +1054,14 @@
bool _pending_transfer_to_interpreter;
// Guard for re-entrant call to JVMCIRuntime::adjust_comp_level
bool _adjusting_comp_level;
+ // True if in a runtime call from compiled code that will deoptimize
+ // and re-execute a failed heap allocation in the interpreter.
+ bool _in_retryable_allocation;
+
// An id of a speculation that JVMCI compiled code can use to further describe and
// uniquely identify the speculative optimization guarded by the uncommon trap
long _pending_failed_speculation;
// These fields are mutually exclusive in terms of live ranges.
@@ -1466,10 +1478,13 @@
void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; }
void set_pending_failed_speculation(long failed_speculation) { _pending_failed_speculation = failed_speculation; }
void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; }
void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; }
void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; }
+
+ virtual bool in_retryable_allocation() const { return _in_retryable_allocation; }
+ void set_in_retryable_allocation(bool b) { _in_retryable_allocation = b; }
#endif // INCLUDE_JVMCI
// Exception handling for compiled methods
oop exception_oop() const { return _exception_oop; }
address exception_pc() const { return _exception_pc; }
< prev index next >