RFR JDK-8185582, Update Zip implementation to use Cleaner, not finalizers

mandy chung mandy.chung at oracle.com
Fri Sep 29 21:45:18 UTC 2017



On 9/29/17 2:38 PM, Peter Levart wrote:
> I think the hotspot has an optimization and detects that finalize() 
> has no bytecodes and treats the object as not needing finalization.
http://hg.openjdk.java.net/jdk10/master/file/7d67bb6b0599/src/hotspot/share/classfile/classFileParser.cpp#l4250

   // Check if this klass has an empty finalize method (i.e. one with 
return bytecode only),
   // in which case we don't have to register objects as finalizable
   if (!_has_empty_finalizer) {
     if (_has_finalizer ||
         (super != NULL && super->has_finalizer())) {
       ik->set_has_finalizer();
     }
   }

Mandy


More information about the core-libs-dev mailing list