8252685: APIs that require JavaThread should take JavaThread arguments

Reviewed-by: coleenp, sspitsyn, kvn, iklam
This commit is contained in:
David Holmes 2021-05-17 04:05:44 +00:00
parent 2066f497b9
commit 02f895c5f6
120 changed files with 507 additions and 521 deletions

View file

@ -218,7 +218,7 @@ static bool rematerialize_objects(JavaThread* thread, int exec_mode, CompiledMet
if (objects != NULL) {
if (exec_mode == Deoptimization::Unpack_none) {
assert(thread->thread_state() == _thread_in_vm, "assumption");
Thread* THREAD = thread;
JavaThread* THREAD = thread; // For exception macros.
// Clear pending OOM if reallocation fails and return true indicating allocation failure
realloc_failures = Deoptimization::realloc_objects(thread, &deoptee, &map, objects, CHECK_AND_CLEAR_(true));
deoptimized_objects = true;
@ -1802,7 +1802,7 @@ JRT_END
MethodData*
Deoptimization::get_method_data(JavaThread* thread, const methodHandle& m,
bool create_if_missing) {
Thread* THREAD = thread;
JavaThread* THREAD = thread; // For exception macros.
MethodData* mdo = m()->method_data();
if (mdo == NULL && create_if_missing && !HAS_PENDING_EXCEPTION) {
// Build an MDO. Ignore errors like OutOfMemory;
@ -1840,7 +1840,7 @@ void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool
// to the runtime the stack is no longer guarded. Reguard the
// stack otherwise if we return to the uncommon trap blob and the
// stack bang causes a stack overflow we crash.
JavaThread* jt = THREAD->as_Java_thread();
JavaThread* jt = THREAD;
bool guard_pages_enabled = jt->stack_overflow_state()->reguard_stack_if_needed();
assert(guard_pages_enabled, "stack banging in uncommon trap blob may cause crash");
}