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 @@ -134,9 +134,19 @@ void LIR_Assembler::osr_entry() {
134134 // copied into place by code emitted in the IR.
135135
136136 Register OSR_buf = osrBufferPointer ()->as_register ();
137- { assert (frame::interpreter_frame_monitor_size () == BasicObjectLock::size (), " adjust code below" );
138- int monitor_offset = BytesPerWord * method ()->max_locals () +
139- (2 * BytesPerWord) * (number_of_locks - 1 );
137+ {
138+ assert (frame::interpreter_frame_monitor_size () == BasicObjectLock::size (), " adjust code below" );
139+
140+ const int locals_space = BytesPerWord * method () -> max_locals ();
141+ int monitor_offset = locals_space + (2 * BytesPerWord) * (number_of_locks - 1 );
142+ bool large_offset = !Immediate::is_simm20 (monitor_offset + BytesPerWord) && number_of_locks > 0 ;
143+
144+ if (large_offset) {
145+ // z_lg can only handle displacement upto 20bit signed binary integer
146+ __ z_algfi (OSR_buf, locals_space);
147+ monitor_offset -= locals_space;
148+ }
149+
140150 // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
141151 // the OSR buffer using 2 word entries: first the lock and then
142152 // the oop.
@@ -150,6 +160,10 @@ void LIR_Assembler::osr_entry() {
150160 __ z_lg (Z_R1_scratch, slot_offset + 1 *BytesPerWord, OSR_buf);
151161 __ z_stg (Z_R1_scratch, frame_map ()->address_for_monitor_object (i));
152162 }
163+
164+ if (large_offset) {
165+ __ z_slgfi (OSR_buf, locals_space);
166+ }
153167 }
154168}
155169
You can’t perform that action at this time.
0 commit comments