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

compiled code takes implicit null traps on hot paths

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • hotspot
    • None
    • beta3
    • sparc
    • generic

      From: Doug Lea <###@###.###>

      * Compile attached file HashSetTest.java
      * Run java -server HashSetTest java.util.HashSet 10 50000
      * look at the time for line:
        Remove (absent) : 79991

      * Uncomment out line 32:
                  // if (j == 0) t0(s, key, size);
      * run again, with time:
        Iterator.remove : 536

      Times are approx time per operation in nanosec on my ultra80 using b74.

      I believe the code triggering this problem is the same as that
      from our first exchange (which made me remember John's mail).
      It is the lines in java.util.HashMap.remove()
              Entry e = removeEntryForKey(key);
              return (e == null ? e : e.value);

      The commented line above forces a few iterations early on
      to execute this with e null.

            jrose John Rose
            jrose John Rose
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: