@@ -2073,6 +2073,14 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
20732073 __ z_lg (Z_fp, _z_abi (callers_sp), Z_SP); // Frame accessors use Z_fp.
20742074 // Z_ARG1 (==Z_tos): exception
20752075 // Z_ARG2 : Return address/pc that threw exception.
2076+ {
2077+ Register top_frame_sp = Z_R1_scratch; // anyway going to load it with correct value
2078+ __ z_lg (top_frame_sp, Address (Z_fp, _z_ijava_state_neg (top_frame_sp)));
2079+ __ z_slag (top_frame_sp, top_frame_sp, Interpreter::logStackElementSize);
2080+ __ z_agr (top_frame_sp, Z_fp);
2081+
2082+ __ resize_frame_absolute (top_frame_sp, /* temp = */ Z_R0, /* load_fp = */ true );
2083+ }
20762084 __ restore_bcp (); // R13 points to call/send.
20772085 __ restore_locals ();
20782086
@@ -2180,6 +2188,14 @@ void TemplateInterpreterGenerator::generate_throw_exception() {
21802188 false , // install_monitor_exception
21812189 false ); // notify_jvmdi
21822190 __ z_lg (Z_fp, _z_abi (callers_sp), Z_SP); // Restore frame pointer.
2191+ {
2192+ Register top_frame_sp = Z_R1_scratch;
2193+ __ z_lg (top_frame_sp, Address (Z_fp, _z_ijava_state_neg (top_frame_sp)));
2194+ __ z_slag (top_frame_sp, top_frame_sp, Interpreter::logStackElementSize);
2195+ __ z_agr (top_frame_sp, Z_fp);
2196+
2197+ __ resize_frame_absolute (top_frame_sp, /* temp = */ Z_R0, /* load_fp = */ true );
2198+ }
21832199 __ restore_bcp ();
21842200 __ restore_locals ();
21852201 __ restore_esp ();
0 commit comments