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