241 private:
242 CodeEmitInfo* _info;
243 int _offset;
244
245 public:
246 ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
247 : _info(info), _offset(offset) {
248 }
249 virtual void emit_code(LIR_Assembler* e);
250 virtual CodeEmitInfo* info() const { return _info; }
251 virtual bool is_exception_throw_stub() const { return true; }
252 virtual void visit(LIR_OpVisitState* visitor) {
253 visitor->do_slow_case(_info);
254 }
255 #ifndef PRODUCT
256 virtual void print_name(outputStream* out) const { out->print("ImplicitNullCheckStub"); }
257 #endif // PRODUCT
258 };
259
260
261 class NewInstanceStub: public CodeStub {
262 private:
263 ciInstanceKlass* _klass;
264 LIR_Opr _klass_reg;
265 LIR_Opr _result;
266 CodeEmitInfo* _info;
267 C1StubId _stub_id;
268
269 public:
270 NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id);
271 virtual void emit_code(LIR_Assembler* e);
272 virtual CodeEmitInfo* info() const { return _info; }
273 virtual void visit(LIR_OpVisitState* visitor) {
274 visitor->do_slow_case(_info);
275 visitor->do_input(_klass_reg);
276 visitor->do_output(_result);
277 }
278 #ifndef PRODUCT
279 virtual void print_name(outputStream* out) const { out->print("NewInstanceStub"); }
280 #endif // PRODUCT
293 virtual void emit_code(LIR_Assembler* e);
294 virtual CodeEmitInfo* info() const { return _info; }
295 virtual void visit(LIR_OpVisitState* visitor) {
296 visitor->do_slow_case(_info);
297 visitor->do_input(_klass_reg);
298 visitor->do_input(_length);
299 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
300 }
301 #ifndef PRODUCT
302 virtual void print_name(outputStream* out) const { out->print("NewTypeArrayStub"); }
303 #endif // PRODUCT
304 };
305
306
307 class NewObjectArrayStub: public CodeStub {
308 private:
309 LIR_Opr _klass_reg;
310 LIR_Opr _length;
311 LIR_Opr _result;
312 CodeEmitInfo* _info;
313
314 public:
315 NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info);
316 virtual void emit_code(LIR_Assembler* e);
317 virtual CodeEmitInfo* info() const { return _info; }
318 virtual void visit(LIR_OpVisitState* visitor) {
319 visitor->do_slow_case(_info);
320 visitor->do_input(_klass_reg);
321 visitor->do_input(_length);
322 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
323 }
324 #ifndef PRODUCT
325 virtual void print_name(outputStream* out) const { out->print("NewObjectArrayStub"); }
326 #endif // PRODUCT
327 };
328
329
330 class MonitorAccessStub: public CodeStub {
331 protected:
332 LIR_Opr _obj_reg;
333 LIR_Opr _lock_reg;
334
335 public:
336 MonitorAccessStub(LIR_Opr obj_reg, LIR_Opr lock_reg) {
337 _obj_reg = obj_reg;
338 _lock_reg = lock_reg;
339 }
340
341 #ifndef PRODUCT
342 virtual void print_name(outputStream* out) const { out->print("MonitorAccessStub"); }
343 #endif // PRODUCT
344 };
345
346
347 class MonitorEnterStub: public MonitorAccessStub {
348 private:
349 CodeEmitInfo* _info;
350
351 public:
352 MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info)
353 : MonitorAccessStub(obj_reg, lock_reg) {
354 _info = new CodeEmitInfo(info);
355 FrameMap* f = Compilation::current()->frame_map();
356 f->update_reserved_argument_area_size(2 * BytesPerWord);
357 }
358
359 virtual void emit_code(LIR_Assembler* e);
360 virtual CodeEmitInfo* info() const { return _info; }
361 virtual void visit(LIR_OpVisitState* visitor) {
362 visitor->do_input(_obj_reg);
363 visitor->do_input(_lock_reg);
364 visitor->do_slow_case(_info);
365 }
366 #ifndef PRODUCT
367 virtual void print_name(outputStream* out) const { out->print("MonitorEnterStub"); }
368 #endif // PRODUCT
369 };
370
371
372 class MonitorExitStub: public MonitorAccessStub {
373 private:
374 bool _compute_lock;
375 int _monitor_ix;
376
377 public:
378 MonitorExitStub(LIR_Opr lock_reg, bool compute_lock, int monitor_ix)
379 : MonitorAccessStub(LIR_OprFact::illegalOpr, lock_reg),
380 _compute_lock(compute_lock), _monitor_ix(monitor_ix) { }
381 virtual void emit_code(LIR_Assembler* e);
382 virtual void visit(LIR_OpVisitState* visitor) {
383 assert(_obj_reg->is_illegal(), "unused");
|
241 private:
242 CodeEmitInfo* _info;
243 int _offset;
244
245 public:
246 ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
247 : _info(info), _offset(offset) {
248 }
249 virtual void emit_code(LIR_Assembler* e);
250 virtual CodeEmitInfo* info() const { return _info; }
251 virtual bool is_exception_throw_stub() const { return true; }
252 virtual void visit(LIR_OpVisitState* visitor) {
253 visitor->do_slow_case(_info);
254 }
255 #ifndef PRODUCT
256 virtual void print_name(outputStream* out) const { out->print("ImplicitNullCheckStub"); }
257 #endif // PRODUCT
258 };
259
260
261 class LoadFlattenedArrayStub: public CodeStub {
262 private:
263 LIR_Opr _array;
264 LIR_Opr _index;
265 LIR_Opr _result;
266 LIR_Opr _scratch_reg;
267 CodeEmitInfo* _info;
268
269 public:
270 LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info);
271 virtual void emit_code(LIR_Assembler* e);
272 virtual CodeEmitInfo* info() const { return _info; }
273 virtual void visit(LIR_OpVisitState* visitor) {
274 visitor->do_slow_case(_info);
275 visitor->do_input(_array);
276 visitor->do_input(_index);
277 visitor->do_output(_result);
278 if (_scratch_reg != LIR_OprFact::illegalOpr) {
279 visitor->do_temp(_scratch_reg);
280 }
281 }
282
283 #ifndef PRODUCT
284 virtual void print_name(outputStream* out) const { out->print("LoadFlattenedArrayStub"); }
285 #endif // PRODUCT
286 };
287
288
289 class StoreFlattenedArrayStub: public CodeStub {
290 private:
291 LIR_Opr _array;
292 LIR_Opr _index;
293 LIR_Opr _value;
294 LIR_Opr _scratch_reg;
295 CodeEmitInfo* _info;
296
297 public:
298 StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info);
299 virtual void emit_code(LIR_Assembler* e);
300 virtual CodeEmitInfo* info() const { return _info; }
301 virtual void visit(LIR_OpVisitState* visitor) {
302 visitor->do_slow_case(_info);
303 visitor->do_input(_array);
304 visitor->do_input(_index);
305 visitor->do_input(_value);
306 if (_scratch_reg != LIR_OprFact::illegalOpr) {
307 visitor->do_temp(_scratch_reg);
308 }
309 }
310 #ifndef PRODUCT
311 virtual void print_name(outputStream* out) const { out->print("StoreFlattenedArrayStub"); }
312 #endif // PRODUCT
313 };
314
315 class SubstitutabilityCheckStub: public CodeStub {
316 private:
317 LIR_Opr _left;
318 LIR_Opr _right;
319 LIR_Opr _scratch_reg;
320 CodeEmitInfo* _info;
321 public:
322 SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info);
323 virtual void emit_code(LIR_Assembler* e);
324 virtual CodeEmitInfo* info() const { return _info; }
325 virtual void visit(LIR_OpVisitState* visitor) {
326 visitor->do_slow_case(_info);
327 visitor->do_input(_left);
328 visitor->do_input(_right);
329 if (_scratch_reg != LIR_OprFact::illegalOpr) {
330 visitor->do_temp(_scratch_reg);
331 }
332 }
333 #ifndef PRODUCT
334 virtual void print_name(outputStream* out) const { out->print("SubstitutabilityCheckStub"); }
335 #endif // PRODUCT
336 };
337
338 class NewInstanceStub: public CodeStub {
339 private:
340 ciInstanceKlass* _klass;
341 LIR_Opr _klass_reg;
342 LIR_Opr _result;
343 CodeEmitInfo* _info;
344 C1StubId _stub_id;
345
346 public:
347 NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, C1StubId stub_id);
348 virtual void emit_code(LIR_Assembler* e);
349 virtual CodeEmitInfo* info() const { return _info; }
350 virtual void visit(LIR_OpVisitState* visitor) {
351 visitor->do_slow_case(_info);
352 visitor->do_input(_klass_reg);
353 visitor->do_output(_result);
354 }
355 #ifndef PRODUCT
356 virtual void print_name(outputStream* out) const { out->print("NewInstanceStub"); }
357 #endif // PRODUCT
370 virtual void emit_code(LIR_Assembler* e);
371 virtual CodeEmitInfo* info() const { return _info; }
372 virtual void visit(LIR_OpVisitState* visitor) {
373 visitor->do_slow_case(_info);
374 visitor->do_input(_klass_reg);
375 visitor->do_input(_length);
376 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
377 }
378 #ifndef PRODUCT
379 virtual void print_name(outputStream* out) const { out->print("NewTypeArrayStub"); }
380 #endif // PRODUCT
381 };
382
383
384 class NewObjectArrayStub: public CodeStub {
385 private:
386 LIR_Opr _klass_reg;
387 LIR_Opr _length;
388 LIR_Opr _result;
389 CodeEmitInfo* _info;
390 bool _is_null_free;
391 public:
392 NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_null_free);
393 virtual void emit_code(LIR_Assembler* e);
394 virtual CodeEmitInfo* info() const { return _info; }
395 virtual void visit(LIR_OpVisitState* visitor) {
396 visitor->do_slow_case(_info);
397 visitor->do_input(_klass_reg);
398 visitor->do_input(_length);
399 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
400 }
401 #ifndef PRODUCT
402 virtual void print_name(outputStream* out) const { out->print("NewObjectArrayStub"); }
403 #endif // PRODUCT
404 };
405
406
407 class MonitorAccessStub: public CodeStub {
408 protected:
409 LIR_Opr _obj_reg;
410 LIR_Opr _lock_reg;
411
412 public:
413 MonitorAccessStub(LIR_Opr obj_reg, LIR_Opr lock_reg) {
414 _obj_reg = obj_reg;
415 _lock_reg = lock_reg;
416 }
417
418 #ifndef PRODUCT
419 virtual void print_name(outputStream* out) const { out->print("MonitorAccessStub"); }
420 #endif // PRODUCT
421 };
422
423
424 class MonitorEnterStub: public MonitorAccessStub {
425 private:
426 CodeEmitInfo* _info;
427 CodeStub* _throw_ie_stub;
428 LIR_Opr _scratch_reg;
429
430 public:
431 MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info,
432 CodeStub* throw_ie_stub = nullptr, LIR_Opr scratch_reg = LIR_OprFact::illegalOpr)
433 : MonitorAccessStub(obj_reg, lock_reg) {
434 _info = new CodeEmitInfo(info);
435 _scratch_reg = scratch_reg;
436 _throw_ie_stub = throw_ie_stub;
437 if (_throw_ie_stub != nullptr) {
438 assert(_scratch_reg != LIR_OprFact::illegalOpr, "must be");
439 }
440 FrameMap* f = Compilation::current()->frame_map();
441 f->update_reserved_argument_area_size(2 * BytesPerWord);
442 }
443
444 virtual void emit_code(LIR_Assembler* e);
445 virtual CodeEmitInfo* info() const { return _info; }
446 virtual void visit(LIR_OpVisitState* visitor) {
447 visitor->do_input(_obj_reg);
448 visitor->do_input(_lock_reg);
449 if (_scratch_reg != LIR_OprFact::illegalOpr) {
450 visitor->do_temp(_scratch_reg);
451 }
452 visitor->do_slow_case(_info);
453 }
454 #ifndef PRODUCT
455 virtual void print_name(outputStream* out) const { out->print("MonitorEnterStub"); }
456 #endif // PRODUCT
457 };
458
459
460 class MonitorExitStub: public MonitorAccessStub {
461 private:
462 bool _compute_lock;
463 int _monitor_ix;
464
465 public:
466 MonitorExitStub(LIR_Opr lock_reg, bool compute_lock, int monitor_ix)
467 : MonitorAccessStub(LIR_OprFact::illegalOpr, lock_reg),
468 _compute_lock(compute_lock), _monitor_ix(monitor_ix) { }
469 virtual void emit_code(LIR_Assembler* e);
470 virtual void visit(LIR_OpVisitState* visitor) {
471 assert(_obj_reg->is_illegal(), "unused");
|