< prev index next >

src/share/vm/c1/c1_LIRGenerator.cpp

Print this page




1683       value.load_byte_item();
1684     } else  {
1685       value.load_item();
1686     }
1687   } else {
1688     value.load_for_store(field_type);
1689   }
1690 
1691   set_no_result(x);
1692 
1693 #ifndef PRODUCT
1694   if (PrintNotLoaded && needs_patching) {
1695     tty->print_cr("   ###class not loaded at store_%s bci %d",
1696                   x->is_static() ?  "static" : "field", x->printable_bci());
1697   }
1698 #endif
1699 
1700   if (x->needs_null_check() &&
1701       (needs_patching ||
1702        MacroAssembler::needs_explicit_null_check(x->offset()))) {
1703     // emit an explicit null check because the offset is too large
1704     __ null_check(object.result(), new CodeEmitInfo(info));


1705   }
1706 
1707   LIR_Address* address;
1708   if (needs_patching) {
1709     // we need to patch the offset in the instruction so don't allow
1710     // generate_address to try to be smart about emitting the -1.
1711     // Otherwise the patching code won't know how to find the
1712     // instruction to patch.
1713     address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
1714   } else {
1715     address = generate_address(object.result(), x->offset(), field_type);
1716   }
1717 
1718   if (is_volatile && os::is_MP()) {
1719     __ membar_release();
1720   }
1721 
1722   if (is_oop) {
1723     // Do the pre-write barrier, if any.
1724     pre_barrier(LIR_OprFact::address(address),


1768 
1769   object.load_item();
1770 
1771 #ifndef PRODUCT
1772   if (PrintNotLoaded && needs_patching) {
1773     tty->print_cr("   ###class not loaded at load_%s bci %d",
1774                   x->is_static() ?  "static" : "field", x->printable_bci());
1775   }
1776 #endif
1777 
1778   bool stress_deopt = StressLoopInvariantCodeMotion && info && info->deoptimize_on_exception();
1779   if (x->needs_null_check() &&
1780       (needs_patching ||
1781        MacroAssembler::needs_explicit_null_check(x->offset()) ||
1782        stress_deopt)) {
1783     LIR_Opr obj = object.result();
1784     if (stress_deopt) {
1785       obj = new_register(T_OBJECT);
1786       __ move(LIR_OprFact::oopConst(NULL), obj);
1787     }
1788     // emit an explicit null check because the offset is too large
1789     __ null_check(obj, new CodeEmitInfo(info));


1790   }
1791 
1792   LIR_Opr reg = rlock_result(x, field_type);
1793   LIR_Address* address;
1794   if (needs_patching) {
1795     // we need to patch the offset in the instruction so don't allow
1796     // generate_address to try to be smart about emitting the -1.
1797     // Otherwise the patching code won't know how to find the
1798     // instruction to patch.
1799     address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
1800   } else {
1801     address = generate_address(object.result(), x->offset(), field_type);
1802   }
1803 
1804   if (is_volatile && !needs_patching) {
1805     volatile_field_load(address, reg, info);
1806   } else {
1807     LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
1808     __ load(address, reg, info, patch_code);
1809   }




1683       value.load_byte_item();
1684     } else  {
1685       value.load_item();
1686     }
1687   } else {
1688     value.load_for_store(field_type);
1689   }
1690 
1691   set_no_result(x);
1692 
1693 #ifndef PRODUCT
1694   if (PrintNotLoaded && needs_patching) {
1695     tty->print_cr("   ###class not loaded at store_%s bci %d",
1696                   x->is_static() ?  "static" : "field", x->printable_bci());
1697   }
1698 #endif
1699 
1700   if (x->needs_null_check() &&
1701       (needs_patching ||
1702        MacroAssembler::needs_explicit_null_check(x->offset()))) {
1703     // Emit an explicit null check because the offset is too large.
1704     // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
1705     // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
1706     __ null_check(object.result(), new CodeEmitInfo(info), /* deoptimize */ needs_patching);
1707   }
1708 
1709   LIR_Address* address;
1710   if (needs_patching) {
1711     // we need to patch the offset in the instruction so don't allow
1712     // generate_address to try to be smart about emitting the -1.
1713     // Otherwise the patching code won't know how to find the
1714     // instruction to patch.
1715     address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
1716   } else {
1717     address = generate_address(object.result(), x->offset(), field_type);
1718   }
1719 
1720   if (is_volatile && os::is_MP()) {
1721     __ membar_release();
1722   }
1723 
1724   if (is_oop) {
1725     // Do the pre-write barrier, if any.
1726     pre_barrier(LIR_OprFact::address(address),


1770 
1771   object.load_item();
1772 
1773 #ifndef PRODUCT
1774   if (PrintNotLoaded && needs_patching) {
1775     tty->print_cr("   ###class not loaded at load_%s bci %d",
1776                   x->is_static() ?  "static" : "field", x->printable_bci());
1777   }
1778 #endif
1779 
1780   bool stress_deopt = StressLoopInvariantCodeMotion && info && info->deoptimize_on_exception();
1781   if (x->needs_null_check() &&
1782       (needs_patching ||
1783        MacroAssembler::needs_explicit_null_check(x->offset()) ||
1784        stress_deopt)) {
1785     LIR_Opr obj = object.result();
1786     if (stress_deopt) {
1787       obj = new_register(T_OBJECT);
1788       __ move(LIR_OprFact::oopConst(NULL), obj);
1789     }
1790     // Emit an explicit null check because the offset is too large.
1791     // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
1792     // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
1793     __ null_check(obj, new CodeEmitInfo(info), /* deoptimize */ needs_patching);
1794   }
1795 
1796   LIR_Opr reg = rlock_result(x, field_type);
1797   LIR_Address* address;
1798   if (needs_patching) {
1799     // we need to patch the offset in the instruction so don't allow
1800     // generate_address to try to be smart about emitting the -1.
1801     // Otherwise the patching code won't know how to find the
1802     // instruction to patch.
1803     address = new LIR_Address(object.result(), PATCHED_ADDR, field_type);
1804   } else {
1805     address = generate_address(object.result(), x->offset(), field_type);
1806   }
1807 
1808   if (is_volatile && !needs_patching) {
1809     volatile_field_load(address, reg, info);
1810   } else {
1811     LIR_PatchCode patch_code = needs_patching ? lir_patch_normal : lir_patch_none;
1812     __ load(address, reg, info, patch_code);
1813   }


< prev index next >