File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -131,9 +131,19 @@ void LIR_Assembler::osr_entry() {
131131 // copied into place by code emitted in the IR.
132132
133133 Register OSR_buf = osrBufferPointer ()->as_register ();
134- { assert (frame::interpreter_frame_monitor_size () == BasicObjectLock::size (), " adjust code below" );
135- int monitor_offset = BytesPerWord * method ()->max_locals () +
136- (2 * BytesPerWord) * (number_of_locks - 1 );
134+ {
135+ assert (frame::interpreter_frame_monitor_size () == BasicObjectLock::size (), " adjust code below" );
136+
137+ const int locals_space = BytesPerWord * method () -> max_locals ();
138+ int monitor_offset = locals_space + (2 * BytesPerWord) * (number_of_locks - 1 );
139+ bool large_offset = !Immediate::is_simm20 (monitor_offset + BytesPerWord) && number_of_locks > 0 ;
140+
141+ if (large_offset) {
142+ // z_lg can only handle displacement upto 20bit signed binary integer
143+ __ z_algfi (OSR_buf, locals_space);
144+ monitor_offset -= locals_space;
145+ }
146+
137147 // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
138148 // the OSR buffer using 2 word entries: first the lock and then
139149 // the oop.
@@ -147,6 +157,10 @@ void LIR_Assembler::osr_entry() {
147157 __ z_lg (Z_R1_scratch, slot_offset + 1 *BytesPerWord, OSR_buf);
148158 __ z_stg (Z_R1_scratch, frame_map ()->address_for_monitor_object (i));
149159 }
160+
161+ if (large_offset) {
162+ __ z_slgfi (OSR_buf, locals_space);
163+ }
150164 }
151165}
152166
You can’t perform that action at this time.
0 commit comments