< prev index next >

src/hotspot/share/c1/c1_LIR.hpp

Print this page

1886     , _lock(lock)
1887     , _scratch(scratch)
1888     , _stub(stub)                      {}
1889 
1890   LIR_Opr hdr_opr() const                        { return _hdr; }
1891   LIR_Opr obj_opr() const                        { return _obj; }
1892   LIR_Opr lock_opr() const                       { return _lock; }
1893   LIR_Opr scratch_opr() const                    { return _scratch; }
1894   CodeStub* stub() const                         { return _stub; }
1895 
1896   virtual void emit_code(LIR_Assembler* masm);
1897   virtual LIR_OpLock* as_OpLock() { return this; }
1898   void print_instr(outputStream* out) const PRODUCT_RETURN;
1899 };
1900 
1901 class LIR_OpLoadKlass: public LIR_Op {
1902   friend class LIR_OpVisitState;
1903 
1904  private:
1905   LIR_Opr _obj;

1906  public:
1907   LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info)
1908     : LIR_Op(lir_load_klass, result, info)
1909     , _obj(obj)

1910     {}
1911 
1912   LIR_Opr obj()        const { return _obj;  }

1913 
1914   virtual LIR_OpLoadKlass* as_OpLoadKlass() { return this; }
1915   virtual void emit_code(LIR_Assembler* masm);
1916   void print_instr(outputStream* out) const PRODUCT_RETURN;
1917 };
1918 
1919 class LIR_OpDelay: public LIR_Op {
1920  friend class LIR_OpVisitState;
1921 
1922  private:
1923   LIR_Op* _op;
1924 
1925  public:
1926   LIR_OpDelay(LIR_Op* op, CodeEmitInfo* info):
1927     LIR_Op(lir_delay_slot, LIR_OprFact::illegalOpr, info),
1928     _op(op) {
1929     assert(op->code() == lir_nop, "should be filling with nops");
1930   }
1931   virtual void emit_code(LIR_Assembler* masm);
1932   virtual LIR_OpDelay* as_OpDelay() { return this; }

2358   void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res)  { append(new LIR_OpUpdateCRC32(crc, val, res)); }
2359 
2360   void instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci);
2361   void store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception, ciMethod* profiled_method, int profiled_bci);
2362 
2363   void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
2364                   LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
2365                   CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
2366                   ciMethod* profiled_method, int profiled_bci);
2367   // MethodData* profiling
2368   void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
2369     append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass));
2370   }
2371   void profile_type(LIR_Address* mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) {
2372     append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict));
2373   }
2374 
2375   void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }
2376   void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); }
2377 
2378   void load_klass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info) { append(new LIR_OpLoadKlass(obj, result, info)); }
2379 
2380 #ifdef ASSERT
2381   void lir_assert(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, const char* msg, bool halt) { append(new LIR_OpAssert(condition, opr1, opr2, msg, halt)); }
2382 #endif
2383 };
2384 
2385 void print_LIR(BlockList* blocks);
2386 
2387 class LIR_InsertionBuffer : public CompilationResourceObj {
2388  private:
2389   LIR_List*   _lir;   // the lir list where ops of this buffer should be inserted later (null when uninitialized)
2390 
2391   // list of insertion points. index and count are stored alternately:
2392   // _index_and_count[i * 2]:     the index into lir list where "count" ops should be inserted
2393   // _index_and_count[i * 2 + 1]: the number of ops to be inserted at index
2394   intStack    _index_and_count;
2395 
2396   // the LIR_Ops to be inserted
2397   LIR_OpList  _ops;
2398 

1886     , _lock(lock)
1887     , _scratch(scratch)
1888     , _stub(stub)                      {}
1889 
1890   LIR_Opr hdr_opr() const                        { return _hdr; }
1891   LIR_Opr obj_opr() const                        { return _obj; }
1892   LIR_Opr lock_opr() const                       { return _lock; }
1893   LIR_Opr scratch_opr() const                    { return _scratch; }
1894   CodeStub* stub() const                         { return _stub; }
1895 
1896   virtual void emit_code(LIR_Assembler* masm);
1897   virtual LIR_OpLock* as_OpLock() { return this; }
1898   void print_instr(outputStream* out) const PRODUCT_RETURN;
1899 };
1900 
1901 class LIR_OpLoadKlass: public LIR_Op {
1902   friend class LIR_OpVisitState;
1903 
1904  private:
1905   LIR_Opr _obj;
1906   CodeStub* _stub;
1907  public:
1908   LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info, CodeStub* stub)
1909     : LIR_Op(lir_load_klass, result, info)
1910     , _obj(obj)
1911     , _stub(stub)
1912     {}
1913 
1914   LIR_Opr obj()        const { return _obj;  }
1915   CodeStub* stub()     const { return _stub; }
1916 
1917   virtual LIR_OpLoadKlass* as_OpLoadKlass() { return this; }
1918   virtual void emit_code(LIR_Assembler* masm);
1919   void print_instr(outputStream* out) const PRODUCT_RETURN;
1920 };
1921 
1922 class LIR_OpDelay: public LIR_Op {
1923  friend class LIR_OpVisitState;
1924 
1925  private:
1926   LIR_Op* _op;
1927 
1928  public:
1929   LIR_OpDelay(LIR_Op* op, CodeEmitInfo* info):
1930     LIR_Op(lir_delay_slot, LIR_OprFact::illegalOpr, info),
1931     _op(op) {
1932     assert(op->code() == lir_nop, "should be filling with nops");
1933   }
1934   virtual void emit_code(LIR_Assembler* masm);
1935   virtual LIR_OpDelay* as_OpDelay() { return this; }

2361   void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res)  { append(new LIR_OpUpdateCRC32(crc, val, res)); }
2362 
2363   void instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci);
2364   void store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception, ciMethod* profiled_method, int profiled_bci);
2365 
2366   void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
2367                   LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
2368                   CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
2369                   ciMethod* profiled_method, int profiled_bci);
2370   // MethodData* profiling
2371   void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
2372     append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass));
2373   }
2374   void profile_type(LIR_Address* mdp, LIR_Opr obj, ciKlass* exact_klass, intptr_t current_klass, LIR_Opr tmp, bool not_null, bool no_conflict) {
2375     append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict));
2376   }
2377 
2378   void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }
2379   void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); }
2380 
2381   void load_klass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info, CodeStub* stub) { append(new LIR_OpLoadKlass(obj, result, info, stub)); }
2382 
2383 #ifdef ASSERT
2384   void lir_assert(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, const char* msg, bool halt) { append(new LIR_OpAssert(condition, opr1, opr2, msg, halt)); }
2385 #endif
2386 };
2387 
2388 void print_LIR(BlockList* blocks);
2389 
2390 class LIR_InsertionBuffer : public CompilationResourceObj {
2391  private:
2392   LIR_List*   _lir;   // the lir list where ops of this buffer should be inserted later (null when uninitialized)
2393 
2394   // list of insertion points. index and count are stored alternately:
2395   // _index_and_count[i * 2]:     the index into lir list where "count" ops should be inserted
2396   // _index_and_count[i * 2 + 1]: the number of ops to be inserted at index
2397   intStack    _index_and_count;
2398 
2399   // the LIR_Ops to be inserted
2400   LIR_OpList  _ops;
2401 
< prev index next >