< prev index next >

src/hotspot/share/c1/c1_LIR.hpp

Print this page

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

1903  public:
1904   LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info)
1905     : LIR_Op(lir_load_klass, result, info)
1906     , _obj(obj)
1907     {}
1908 
1909   LIR_Opr obj()        const { return _obj;  }

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

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

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

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