1884 , _lock(lock)
1885 , _scratch(scratch)
1886 , _stub(stub) {}
1887
1888 LIR_Opr hdr_opr() const { return _hdr; }
1889 LIR_Opr obj_opr() const { return _obj; }
1890 LIR_Opr lock_opr() const { return _lock; }
1891 LIR_Opr scratch_opr() const { return _scratch; }
1892 CodeStub* stub() const { return _stub; }
1893
1894 virtual void emit_code(LIR_Assembler* masm);
1895 virtual LIR_OpLock* as_OpLock() { return this; }
1896 void print_instr(outputStream* out) const PRODUCT_RETURN;
1897 };
1898
1899 class LIR_OpLoadKlass: public LIR_Op {
1900 friend class LIR_OpVisitState;
1901
1902 private:
1903 LIR_Opr _obj;
1904 public:
1905 LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info)
1906 : LIR_Op(lir_load_klass, result, info)
1907 , _obj(obj)
1908 {}
1909
1910 LIR_Opr obj() const { return _obj; }
1911
1912 virtual LIR_OpLoadKlass* as_OpLoadKlass() { return this; }
1913 virtual void emit_code(LIR_Assembler* masm);
1914 void print_instr(outputStream* out) const PRODUCT_RETURN;
1915 };
1916
1917 class LIR_OpDelay: public LIR_Op {
1918 friend class LIR_OpVisitState;
1919
1920 private:
1921 LIR_Op* _op;
1922
1923 public:
1924 LIR_OpDelay(LIR_Op* op, CodeEmitInfo* info):
1925 LIR_Op(lir_delay_slot, LIR_OprFact::illegalOpr, info),
1926 _op(op) {
1927 assert(op->code() == lir_nop, "should be filling with nops");
1928 }
1929 virtual void emit_code(LIR_Assembler* masm);
1930 virtual LIR_OpDelay* as_OpDelay() { return this; }
2354 void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res) { append(new LIR_OpUpdateCRC32(crc, val, res)); }
2355
2356 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);
2357 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);
2358
2359 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
2360 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
2361 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
2362 ciMethod* profiled_method, int profiled_bci);
2363 // MethodData* profiling
2364 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
2365 append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass));
2366 }
2367 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) {
2368 append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict));
2369 }
2370
2371 void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }
2372 void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); }
2373
2374 void load_klass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info) { append(new LIR_OpLoadKlass(obj, result, info)); }
2375
2376 #ifdef ASSERT
2377 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)); }
2378 #endif
2379 };
2380
2381 void print_LIR(BlockList* blocks);
2382
2383 class LIR_InsertionBuffer : public CompilationResourceObj {
2384 private:
2385 LIR_List* _lir; // the lir list where ops of this buffer should be inserted later (NULL when uninitialized)
2386
2387 // list of insertion points. index and count are stored alternately:
2388 // _index_and_count[i * 2]: the index into lir list where "count" ops should be inserted
2389 // _index_and_count[i * 2 + 1]: the number of ops to be inserted at index
2390 intStack _index_and_count;
2391
2392 // the LIR_Ops to be inserted
2393 LIR_OpList _ops;
2394
|
1884 , _lock(lock)
1885 , _scratch(scratch)
1886 , _stub(stub) {}
1887
1888 LIR_Opr hdr_opr() const { return _hdr; }
1889 LIR_Opr obj_opr() const { return _obj; }
1890 LIR_Opr lock_opr() const { return _lock; }
1891 LIR_Opr scratch_opr() const { return _scratch; }
1892 CodeStub* stub() const { return _stub; }
1893
1894 virtual void emit_code(LIR_Assembler* masm);
1895 virtual LIR_OpLock* as_OpLock() { return this; }
1896 void print_instr(outputStream* out) const PRODUCT_RETURN;
1897 };
1898
1899 class LIR_OpLoadKlass: public LIR_Op {
1900 friend class LIR_OpVisitState;
1901
1902 private:
1903 LIR_Opr _obj;
1904 CodeStub* _stub;
1905 public:
1906 LIR_OpLoadKlass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info, CodeStub* stub)
1907 : LIR_Op(lir_load_klass, result, info)
1908 , _obj(obj)
1909 , _stub(stub) {}
1910
1911 LIR_Opr obj() const { return _obj; }
1912 CodeStub* stub() const { return _stub; }
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; }
2356 void update_crc32(LIR_Opr crc, LIR_Opr val, LIR_Opr res) { append(new LIR_OpUpdateCRC32(crc, val, res)); }
2357
2358 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);
2359 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);
2360
2361 void checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
2362 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
2363 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
2364 ciMethod* profiled_method, int profiled_bci);
2365 // MethodData* profiling
2366 void profile_call(ciMethod* method, int bci, ciMethod* callee, LIR_Opr mdo, LIR_Opr recv, LIR_Opr t1, ciKlass* cha_klass) {
2367 append(new LIR_OpProfileCall(method, bci, callee, mdo, recv, t1, cha_klass));
2368 }
2369 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) {
2370 append(new LIR_OpProfileType(LIR_OprFact::address(mdp), obj, exact_klass, current_klass, tmp, not_null, no_conflict));
2371 }
2372
2373 void xadd(LIR_Opr src, LIR_Opr add, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xadd, src, add, res, tmp)); }
2374 void xchg(LIR_Opr src, LIR_Opr set, LIR_Opr res, LIR_Opr tmp) { append(new LIR_Op2(lir_xchg, src, set, res, tmp)); }
2375
2376 void load_klass(LIR_Opr obj, LIR_Opr result, CodeEmitInfo* info, CodeStub* stub) { append(new LIR_OpLoadKlass(obj, result, info, stub)); }
2377
2378 #ifdef ASSERT
2379 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)); }
2380 #endif
2381 };
2382
2383 void print_LIR(BlockList* blocks);
2384
2385 class LIR_InsertionBuffer : public CompilationResourceObj {
2386 private:
2387 LIR_List* _lir; // the lir list where ops of this buffer should be inserted later (NULL when uninitialized)
2388
2389 // list of insertion points. index and count are stored alternately:
2390 // _index_and_count[i * 2]: the index into lir list where "count" ops should be inserted
2391 // _index_and_count[i * 2 + 1]: the number of ops to be inserted at index
2392 intStack _index_and_count;
2393
2394 // the LIR_Ops to be inserted
2395 LIR_OpList _ops;
2396
|