File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -1690,6 +1690,23 @@ void JvmtiExport::post_vthread_unmount(jobject vthread) {
1690
1690
}
1691
1691
}
1692
1692
1693
+ bool JvmtiExport::has_frame_pops (JavaThread* thread) {
1694
+ if (!can_post_frame_pop ()) {
1695
+ return false ;
1696
+ }
1697
+ JvmtiThreadState *state = get_jvmti_thread_state (thread);
1698
+ if (state == nullptr ) {
1699
+ return false ;
1700
+ }
1701
+ JvmtiEnvThreadStateIterator it (state);
1702
+ for (JvmtiEnvThreadState* ets = it.first (); ets != nullptr ; ets = it.next (ets)) {
1703
+ if (ets->has_frame_pops ()) {
1704
+ return true ;
1705
+ }
1706
+ }
1707
+ return false ;
1708
+ }
1709
+
1693
1710
void JvmtiExport::continuation_yield_cleanup (JavaThread* thread, jint continuation_frame_count) {
1694
1711
if (JvmtiEnv::get_phase () < JVMTI_PHASE_PRIMORDIAL) {
1695
1712
return ;
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1998, 2024 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1998, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -373,6 +373,7 @@ class JvmtiExport : public AllStatic {
373
373
JVMTI_ONLY (return _should_post_class_file_load_hook);
374
374
NOT_JVMTI (return false ;)
375
375
}
376
+ static bool has_frame_pops (JavaThread* thread) NOT_JVMTI_RETURN_(false );
376
377
static bool is_early_phase () NOT_JVMTI_RETURN_(false );
377
378
static bool has_early_class_hook_env () NOT_JVMTI_RETURN_(false );
378
379
static bool has_early_vmstart_env () NOT_JVMTI_RETURN_(false );
Original file line number Diff line number Diff line change @@ -1619,15 +1619,14 @@ static int num_java_frames(ContinuationWrapper& cont) {
1619
1619
}
1620
1620
1621
1621
static void invalidate_jvmti_stack (JavaThread* thread) {
1622
- if (thread->is_interp_only_mode ()) {
1623
- JvmtiThreadState *state = thread->jvmti_thread_state ();
1624
- if (state != nullptr )
1625
- state->invalidate_cur_stack_depth ();
1622
+ JvmtiThreadState *state = thread->jvmti_thread_state ();
1623
+ if (state != nullptr ) {
1624
+ state->invalidate_cur_stack_depth ();
1626
1625
}
1627
1626
}
1628
1627
1629
1628
static void jvmti_yield_cleanup (JavaThread* thread, ContinuationWrapper& cont) {
1630
- if (JvmtiExport::can_post_frame_pop ( )) {
1629
+ if (JvmtiExport::has_frame_pops (thread )) {
1631
1630
int num_frames = num_java_frames (cont);
1632
1631
1633
1632
ContinuationWrapper::SafepointOp so (Thread::current (), cont);
You can’t perform that action at this time.
0 commit comments