Can I remove this code: Handle::Handle duplicate declaration?

Peter B. Kessler Peter.Kessler at Sun.COM
Tue Feb 5 17:37:31 PST 2008


In

     http://hg.openjdk.java.net/jdk7/hotspot-gc-gate/hotspot/file/a61af66fc99e/src/share/vm/runtime/handles.hpp

I see

     68 class Handle VALUE_OBJ_CLASS_SPEC {
          ....
     80 #ifndef ASSERT
     81   Handle(Thread* thread, oop obj);
     82 #else
     83   // Don't inline body with assert for current thread
     84   Handle(Thread* thread, oop obj);
     85 #endif // ASSERT
          ....
    109 };

It looks from the comment in the #else like there used to
be an inlined body in the #ifndef, but there isn't any more.
Over in

     http://hg.openjdk.java.net/jdk7/hotspot-gc-gate/hotspot/file/a61af66fc99e/src/share/vm/runtime/handles.inline.hpp

there is the inline definition of Handle(Thread*, oop)
if ASSERT is not defined, and in

     http://hg.openjdk.java.net/jdk7/hotspot-gc-gate/hotspot/file/a61af66fc99e/src/share/vm/runtime/handles.cpp

there is the non-inline definition of Handle(Thread*, oop)
if ASSERT is defined.  Just like one would expect.

But the declaration is the same in either case, so I think
the .hpp file could be cleaned up.  Unless something really
subtle is going on.

             ... peter

P.S. This might make a good "first push" change, since it would
be easy to undo or redo if things don't work quite the way we
expect them to.




More information about the hotspot-dev mailing list