[Webkit-unassigned] [Bug 43742] Avoid slow-path for array lookups with integral double subscripts

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 9 16:36:41 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=43742





--- Comment #7 from Darin Adler <darin at apple.com>  2010-08-09 16:36:41 PST ---
(From update of attachment 63930)
> +        } else if (subscript.isDouble()) {
> +            i = subscript.toUInt32(callFrame);
> +            haveIntegralIndex = static_cast<double>(i) == subscript.asDouble();
> +        }

Once you have a "true" for isDouble, toUInt32 is an unnecessarily slow way to convert it to an integer. This is more like what you want:

    } else if (subscript.isDouble()) {
        i = static_cast<uint32_t>(subscript.asDouble());
        haveIntegralIndex = static_cast<double>(i) == subscript.asDouble();
    }

But I suspect this will do the wrong thing for negative zero. Please test that case. We need to add some test cases here if there are not existing tests covering these.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list