Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4655125

adding method caching in JNIid (4096069) causes bug in invoke, HotSwap, invoke

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.4.0, 1.4.1
    • vm-legacy
    • None
    • mantis
    • generic, sparc
    • generic, solaris_7

      To optimize JNI invokes (by caching resolves), three fields:

        jint _resolved_lock; // Lock for updating _resolved fields
        volatile methodOop _resolved_method; // Non NULL if method is resolved
        volatile klassOop _resolved_receiver; // Receiver at time of resolve

      and five methods:

        inline void JNIid::lock();
        inline void JNIid::unlock() ;
        methodOop resolved_method() const;
        klassOop resolved_receiver() const;
        void set_resolved_method( methodOop m, klassOop r );

      have been added to JNIid. However, HotSwaping can make the cache incorrect,
      causing the following bug: a method is invoked via JNI, the resolved method
      is cached in the JNIid, the method is replaced using HotSwap, the method
      is invoked again and because of the cache, the old method is called.

            dcubed Daniel Daugherty
            rfield Robert Field (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: