harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elena Semukhina" <elena.semukh...@gmail.com>
Subject Re: [drlvm][opt] Two JIRAs created. Please take a look!
Date Wed, 14 Mar 2007 12:11:13 GMT

On 3/14/07, Mikhail Fursov <mike.fursov@gmail.com> wrote:
> Elena,
> I'm afraid that the test from
> https://issues.apache.org/jira/browse/HARMONY-3379 has never passed with
> before.

Yes, this test never passed with OPT because it never was not run in OPT:)

The 'ref' object in the test is a PhantomReference object. The spec for
PhantomReference reads:
"Unlike soft and weak references, phantom references are not automatically
cleared by the garbage collector as they are enqueued."

 I think they should not be automatically cleared even because all its
methods are inlined since we must ensure that their get() method always
returns null after the referents of phantom references are reclaimed.


Here is the test:
       ReferenceQueue queue = new ReferenceQueue();
       Object referent = new PhantomReferenceTest();
       Reference ref = new PhantomReference(referent, queue);

       // drop strong reference
       referent = null;


       // run finalization to be sure that the reference is enqueued

       Reference enqueued;
       enqueued = queue.poll();
       if (enqueued == null) {
           System.out.println("FAIL: reference was not enqueued");
       if (ref.get() != null) {
           System.out.println("FAIL: reference was not cleared.");

the ref.get() content:
   public T get() {
       return null;

Reference constructor:
   Reference(T referent, ReferenceQueue<? super T> q) {
       this.queue = q;
       this.referent = referent;

As you can see if all methods of the 'ref' object are inlined, the 'ref'
object is eliminated as dead code.
I think that test is not correct.

On 3/14/07, Elena Semukhina <elena.semukhina@gmail.com> wrote:
> Hello,
> as we recently moved to run smoke tests in OPT mode, 3 tests have been
> discovered to fail and added to the exclude lists.
> I filed two JIRAs to track that issues:
> https://issues.apache.org/jira/browse/HARMONY-3349 and
> https://issues.apache.org/jira/browse/HARMONY-3379.
> Could anybody look at them and evaluate?
> --
> Thanks,
> Elena

Mikhail Fursov


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message