< prev index next >

src/hotspot/share/c1/c1_CodeStubs.hpp

Print this page

226  private:
227   CodeEmitInfo* _info;
228   int           _offset;
229 
230  public:
231   ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
232     : _info(info), _offset(offset) {
233   }
234   virtual void emit_code(LIR_Assembler* e);
235   virtual CodeEmitInfo* info() const             { return _info; }
236   virtual bool is_exception_throw_stub() const   { return true; }
237   virtual void visit(LIR_OpVisitState* visitor) {
238     visitor->do_slow_case(_info);
239   }
240 #ifndef PRODUCT
241   virtual void print_name(outputStream* out) const { out->print("ImplicitNullCheckStub"); }
242 #endif // PRODUCT
243 };
244 
245 













































































246 class NewInstanceStub: public CodeStub {
247  private:
248   ciInstanceKlass* _klass;
249   LIR_Opr          _klass_reg;
250   LIR_Opr          _result;
251   CodeEmitInfo*    _info;
252   Runtime1::StubID _stub_id;
253 
254  public:
255   NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id);
256   virtual void emit_code(LIR_Assembler* e);
257   virtual CodeEmitInfo* info() const             { return _info; }
258   virtual void visit(LIR_OpVisitState* visitor) {
259     visitor->do_slow_case(_info);
260     visitor->do_input(_klass_reg);
261     visitor->do_output(_result);
262   }
263 #ifndef PRODUCT
264   virtual void print_name(outputStream* out) const { out->print("NewInstanceStub"); }
265 #endif // PRODUCT

278   virtual void emit_code(LIR_Assembler* e);
279   virtual CodeEmitInfo* info() const             { return _info; }
280   virtual void visit(LIR_OpVisitState* visitor) {
281     visitor->do_slow_case(_info);
282     visitor->do_input(_klass_reg);
283     visitor->do_input(_length);
284     assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
285   }
286 #ifndef PRODUCT
287   virtual void print_name(outputStream* out) const { out->print("NewTypeArrayStub"); }
288 #endif // PRODUCT
289 };
290 
291 
292 class NewObjectArrayStub: public CodeStub {
293  private:
294   LIR_Opr        _klass_reg;
295   LIR_Opr        _length;
296   LIR_Opr        _result;
297   CodeEmitInfo*  _info;
298 
299  public:
300   NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info);
301   virtual void emit_code(LIR_Assembler* e);
302   virtual CodeEmitInfo* info() const             { return _info; }
303   virtual void visit(LIR_OpVisitState* visitor) {
304     visitor->do_slow_case(_info);
305     visitor->do_input(_klass_reg);
306     visitor->do_input(_length);
307     assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
308   }
309 #ifndef PRODUCT
310   virtual void print_name(outputStream* out) const { out->print("NewObjectArrayStub"); }
311 #endif // PRODUCT
312 };
313 
314 
315 class MonitorAccessStub: public CodeStub {
316  protected:
317   LIR_Opr _obj_reg;
318   LIR_Opr _lock_reg;
319 
320  public:
321   MonitorAccessStub(LIR_Opr obj_reg, LIR_Opr lock_reg) {
322     _obj_reg  = obj_reg;
323     _lock_reg  = lock_reg;
324   }
325 
326 #ifndef PRODUCT
327   virtual void print_name(outputStream* out) const { out->print("MonitorAccessStub"); }
328 #endif // PRODUCT
329 };
330 
331 
332 class MonitorEnterStub: public MonitorAccessStub {
333  private:
334   CodeEmitInfo* _info;


335 
336  public:
337   MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info);
338 
339   virtual void emit_code(LIR_Assembler* e);
340   virtual CodeEmitInfo* info() const             { return _info; }
341   virtual void visit(LIR_OpVisitState* visitor) {
342     visitor->do_input(_obj_reg);
343     visitor->do_input(_lock_reg);



344     visitor->do_slow_case(_info);
345   }
346 #ifndef PRODUCT
347   virtual void print_name(outputStream* out) const { out->print("MonitorEnterStub"); }
348 #endif // PRODUCT
349 };
350 
351 
352 class MonitorExitStub: public MonitorAccessStub {
353  private:
354   bool _compute_lock;
355   int  _monitor_ix;
356 
357  public:
358   MonitorExitStub(LIR_Opr lock_reg, bool compute_lock, int monitor_ix)
359     : MonitorAccessStub(LIR_OprFact::illegalOpr, lock_reg),
360       _compute_lock(compute_lock), _monitor_ix(monitor_ix) { }
361   virtual void emit_code(LIR_Assembler* e);
362   virtual void visit(LIR_OpVisitState* visitor) {
363     assert(_obj_reg->is_illegal(), "unused");

226  private:
227   CodeEmitInfo* _info;
228   int           _offset;
229 
230  public:
231   ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
232     : _info(info), _offset(offset) {
233   }
234   virtual void emit_code(LIR_Assembler* e);
235   virtual CodeEmitInfo* info() const             { return _info; }
236   virtual bool is_exception_throw_stub() const   { return true; }
237   virtual void visit(LIR_OpVisitState* visitor) {
238     visitor->do_slow_case(_info);
239   }
240 #ifndef PRODUCT
241   virtual void print_name(outputStream* out) const { out->print("ImplicitNullCheckStub"); }
242 #endif // PRODUCT
243 };
244 
245 
246 class LoadFlattenedArrayStub: public CodeStub {
247  private:
248   LIR_Opr          _array;
249   LIR_Opr          _index;
250   LIR_Opr          _result;
251   LIR_Opr          _scratch_reg;
252   CodeEmitInfo*    _info;
253 
254  public:
255   LoadFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info);
256   virtual void emit_code(LIR_Assembler* e);
257   virtual CodeEmitInfo* info() const             { return _info; }
258   virtual void visit(LIR_OpVisitState* visitor) {
259     visitor->do_slow_case(_info);
260     visitor->do_input(_array);
261     visitor->do_input(_index);
262     visitor->do_output(_result);
263     if (_scratch_reg != LIR_OprFact::illegalOpr) {
264       visitor->do_temp(_scratch_reg);
265     }
266   }
267 
268 #ifndef PRODUCT
269   virtual void print_name(outputStream* out) const { out->print("LoadFlattenedArrayStub"); }
270 #endif // PRODUCT
271 };
272 
273 
274 class StoreFlattenedArrayStub: public CodeStub {
275  private:
276   LIR_Opr          _array;
277   LIR_Opr          _index;
278   LIR_Opr          _value;
279   LIR_Opr          _scratch_reg;
280   CodeEmitInfo*    _info;
281 
282  public:
283   StoreFlattenedArrayStub(LIR_Opr array, LIR_Opr index, LIR_Opr value, CodeEmitInfo* info);
284   virtual void emit_code(LIR_Assembler* e);
285   virtual CodeEmitInfo* info() const             { return _info; }
286   virtual void visit(LIR_OpVisitState* visitor) {
287     visitor->do_slow_case(_info);
288     visitor->do_input(_array);
289     visitor->do_input(_index);
290     visitor->do_input(_value);
291     if (_scratch_reg != LIR_OprFact::illegalOpr) {
292       visitor->do_temp(_scratch_reg);
293     }
294   }
295 #ifndef PRODUCT
296   virtual void print_name(outputStream* out) const { out->print("StoreFlattenedArrayStub"); }
297 #endif // PRODUCT
298 };
299 
300 class SubstitutabilityCheckStub: public CodeStub {
301  private:
302   LIR_Opr          _left;
303   LIR_Opr          _right;
304   LIR_Opr          _scratch_reg;
305   CodeEmitInfo*    _info;
306  public:
307   SubstitutabilityCheckStub(LIR_Opr left, LIR_Opr right, CodeEmitInfo* info);
308   virtual void emit_code(LIR_Assembler* e);
309   virtual CodeEmitInfo* info() const             { return _info; }
310   virtual void visit(LIR_OpVisitState* visitor) {
311     visitor->do_slow_case(_info);
312     visitor->do_input(_left);
313     visitor->do_input(_right);
314     if (_scratch_reg != LIR_OprFact::illegalOpr) {
315       visitor->do_temp(_scratch_reg);
316     }
317   }
318 #ifndef PRODUCT
319   virtual void print_name(outputStream* out) const { out->print("SubstitutabilityCheckStub"); }
320 #endif // PRODUCT
321 };
322 
323 class NewInstanceStub: public CodeStub {
324  private:
325   ciInstanceKlass* _klass;
326   LIR_Opr          _klass_reg;
327   LIR_Opr          _result;
328   CodeEmitInfo*    _info;
329   Runtime1::StubID _stub_id;
330 
331  public:
332   NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id);
333   virtual void emit_code(LIR_Assembler* e);
334   virtual CodeEmitInfo* info() const             { return _info; }
335   virtual void visit(LIR_OpVisitState* visitor) {
336     visitor->do_slow_case(_info);
337     visitor->do_input(_klass_reg);
338     visitor->do_output(_result);
339   }
340 #ifndef PRODUCT
341   virtual void print_name(outputStream* out) const { out->print("NewInstanceStub"); }
342 #endif // PRODUCT

355   virtual void emit_code(LIR_Assembler* e);
356   virtual CodeEmitInfo* info() const             { return _info; }
357   virtual void visit(LIR_OpVisitState* visitor) {
358     visitor->do_slow_case(_info);
359     visitor->do_input(_klass_reg);
360     visitor->do_input(_length);
361     assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
362   }
363 #ifndef PRODUCT
364   virtual void print_name(outputStream* out) const { out->print("NewTypeArrayStub"); }
365 #endif // PRODUCT
366 };
367 
368 
369 class NewObjectArrayStub: public CodeStub {
370  private:
371   LIR_Opr        _klass_reg;
372   LIR_Opr        _length;
373   LIR_Opr        _result;
374   CodeEmitInfo*  _info;
375   bool           _is_null_free;
376  public:
377   NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info, bool is_null_free);
378   virtual void emit_code(LIR_Assembler* e);
379   virtual CodeEmitInfo* info() const             { return _info; }
380   virtual void visit(LIR_OpVisitState* visitor) {
381     visitor->do_slow_case(_info);
382     visitor->do_input(_klass_reg);
383     visitor->do_input(_length);
384     assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
385   }
386 #ifndef PRODUCT
387   virtual void print_name(outputStream* out) const { out->print("NewObjectArrayStub"); }
388 #endif // PRODUCT
389 };
390 
391 
392 class MonitorAccessStub: public CodeStub {
393  protected:
394   LIR_Opr _obj_reg;
395   LIR_Opr _lock_reg;
396 
397  public:
398   MonitorAccessStub(LIR_Opr obj_reg, LIR_Opr lock_reg) {
399     _obj_reg  = obj_reg;
400     _lock_reg  = lock_reg;
401   }
402 
403 #ifndef PRODUCT
404   virtual void print_name(outputStream* out) const { out->print("MonitorAccessStub"); }
405 #endif // PRODUCT
406 };
407 
408 
409 class MonitorEnterStub: public MonitorAccessStub {
410  private:
411   CodeEmitInfo* _info;
412   CodeStub* _throw_imse_stub;
413   LIR_Opr _scratch_reg;
414 
415  public:
416   MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info, CodeStub* throw_imse_stub = NULL, LIR_Opr scratch_reg = LIR_OprFact::illegalOpr);
417 
418   virtual void emit_code(LIR_Assembler* e);
419   virtual CodeEmitInfo* info() const             { return _info; }
420   virtual void visit(LIR_OpVisitState* visitor) {
421     visitor->do_input(_obj_reg);
422     visitor->do_input(_lock_reg);
423     if (_scratch_reg != LIR_OprFact::illegalOpr) {
424       visitor->do_temp(_scratch_reg);
425     }
426     visitor->do_slow_case(_info);
427   }
428 #ifndef PRODUCT
429   virtual void print_name(outputStream* out) const { out->print("MonitorEnterStub"); }
430 #endif // PRODUCT
431 };
432 
433 
434 class MonitorExitStub: public MonitorAccessStub {
435  private:
436   bool _compute_lock;
437   int  _monitor_ix;
438 
439  public:
440   MonitorExitStub(LIR_Opr lock_reg, bool compute_lock, int monitor_ix)
441     : MonitorAccessStub(LIR_OprFact::illegalOpr, lock_reg),
442       _compute_lock(compute_lock), _monitor_ix(monitor_ix) { }
443   virtual void emit_code(LIR_Assembler* e);
444   virtual void visit(LIR_OpVisitState* visitor) {
445     assert(_obj_reg->is_illegal(), "unused");
< prev index next >