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() {
131
131
// copied into place by code emitted in the IR.
132
132
133
133
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
+
137
147
// SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in
138
148
// the OSR buffer using 2 word entries: first the lock and then
139
149
// the oop.
@@ -147,6 +157,10 @@ void LIR_Assembler::osr_entry() {
147
157
__ z_lg (Z_R1_scratch, slot_offset + 1 *BytesPerWord, OSR_buf);
148
158
__ z_stg (Z_R1_scratch, frame_map ()->address_for_monitor_object (i));
149
159
}
160
+
161
+ if (large_offset) {
162
+ __ z_slgfi (OSR_buf, locals_space);
163
+ }
150
164
}
151
165
}
152
166
You can’t perform that action at this time.
0 commit comments