@@ -165,29 +165,21 @@ int StubAssembler::call_RT(Register oop_result, Register metadata_result, addres
165
165
}
166
166
167
167
enum return_state_t {
168
- does_not_return, requires_return
168
+ does_not_return, requires_return, requires_pop_epilogue_return
169
169
};
170
170
171
171
// Implementation of StubFrame
172
172
173
173
class StubFrame : public StackObj {
174
174
private:
175
175
StubAssembler* _sasm;
176
- bool _return_state;
177
- bool _use_pop_on_epilogue;
176
+ return_state_t _return_state;
178
177
179
178
public:
180
- StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments,
181
- return_state_t return_state, bool use_pop_on_epilogue);
182
-
183
- public:
184
- StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments, bool use_pop_on_epilogue);
185
- StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments, return_state_t return_state);
186
- StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments);
179
+ StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments, return_state_t return_state=requires_return);
180
+ void load_argument (int offset_in_words, Register reg);
187
181
188
182
~StubFrame ();
189
-
190
- void load_argument (int offset_in_words, Register reg);
191
183
};;
192
184
193
185
void StubAssembler::prologue (const char * name, bool must_gc_arguments) {
@@ -212,31 +204,26 @@ void StubAssembler::epilogue(bool use_pop) {
212
204
213
205
#define __ _sasm->
214
206
215
- StubFrame::StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments,
216
- return_state_t return_state, bool use_pop_on_epilogue)
217
- : _sasm(sasm), _return_state(return_state), _use_pop_on_epilogue(use_pop_on_epilogue) {
207
+ StubFrame::StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments, return_state_t return_state) {
208
+ _sasm = sasm;
209
+ _return_state = return_state;
218
210
__ prologue (name, must_gc_arguments);
219
211
}
220
212
221
- StubFrame::StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments,
222
- bool use_pop_on_epilogue) :
223
- StubFrame(sasm, name, must_gc_arguments, requires_return, use_pop_on_epilogue) {}
224
-
225
- StubFrame::StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments,
226
- return_state_t return_state) :
227
- StubFrame(sasm, name, must_gc_arguments, return_state, /* use_pop_on_epilogue*/ false ) {}
228
-
229
- StubFrame::StubFrame (StubAssembler* sasm, const char * name, bool must_gc_arguments) :
230
- StubFrame(sasm, name, must_gc_arguments, requires_return, /* use_pop_on_epilogue*/ false ) {}
231
-
232
213
// load parameters that were stored with LIR_Assembler::store_parameter
233
214
// Note: offsets for store_parameter and load_argument must match
234
215
void StubFrame::load_argument (int offset_in_words, Register reg) {
235
216
__ load_parameter (offset_in_words, reg);
236
217
}
237
218
219
+
238
220
StubFrame::~StubFrame () {
239
- __ epilogue (_use_pop_on_epilogue);
221
+ if (_return_state == does_not_return) {
222
+ __ should_not_reach_here ();
223
+ } else {
224
+ __ epilogue (_return_state == requires_pop_epilogue_return);
225
+ }
226
+ _sasm = nullptr ;
240
227
}
241
228
242
229
#undef __
@@ -916,7 +903,7 @@ OopMapSet* Runtime1::generate_code_for(C1StubId id, StubAssembler* sasm) {
916
903
// fall through
917
904
case C1StubId::monitorenter_id:
918
905
{
919
- StubFrame f (sasm, " monitorenter" , dont_gc_arguments, /* use_pop_on_epilogue */ true );
906
+ StubFrame f (sasm, " monitorenter" , dont_gc_arguments, requires_pop_epilogue_return );
920
907
OopMap* map = save_live_registers (sasm, save_fpu_registers);
921
908
assert_cond (map != nullptr );
922
909
0 commit comments