Bug 117593

Summary: Avoid duplicate isInt32() / isUInt32() checks in JSDOMBindings
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, darin, ggaren, laszlo.gombos
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Chris Dumez
Reported 2013-06-13 08:00:33 PDT
In JSDOMBindings.cpp, the following pattern is used several times: if (value.isInt32()) return value.toInt32(exec); This would be more efficiently written as: if (value.isInt32()) return value.asInt32(); The issue is that JSValue::toInt32() also calls value.isInt32() internally as well and returns value.asInt32() if it is. We should therefore call asInt32() directly since we already know the value is an int32.
Attachments
Patch (2.36 KB, patch)
2013-06-13 08:15 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2013-06-13 08:15:30 PDT
Geoffrey Garen
Comment 2 2013-06-13 08:26:47 PDT
Comment on attachment 204587 [details] Patch r=me
WebKit Commit Bot
Comment 3 2013-06-13 09:11:46 PDT
The commit-queue encountered the following flaky tests while processing attachment 204587 [details]: platform/mac/fonts/han-disunification.html bug 114207 (author: ap@webkit.org) platform/mac/editing/deleting/deletionUI-single-instance.html bug 114181 (author: rniwa@webkit.org) transitions/color-transition-rounding.html bug 114182 (author: simon.fraser@apple.com) transitions/cubic-bezier-overflow-svg-length.html bug 114183 (author: peter@chromium.org) transitions/interrupt-zero-duration.html bug 114184 (authors: cmarrin@apple.com, rniwa@webkit.org, and simon.fraser@apple.com) transitions/multiple-background-transitions.html bug 114185 (author: simon.fraser@apple.com) transitions/cubic-bezier-overflow-color.html bug 114186 (author: peter@chromium.org) transitions/multiple-shadow-transitions.html bug 114187 (author: simon.fraser@apple.com) transitions/mismatched-shadow-transitions.html bug 114188 (author: simon.fraser@apple.com) transitions/color-transition-all.html bug 114189 (authors: ossy@webkit.org and simon.fraser@apple.com) transitions/cubic-bezier-overflow-shadow.html bug 114191 (author: peter@chromium.org) transitions/min-max-width-height-transitions.html bug 114192 (author: simon.fraser@apple.com) transitions/cancel-transition.html bug 114193 (authors: ojan@chromium.org, rniwa@webkit.org, and simon.fraser@apple.com) transitions/border-radius-transition.html bug 114194 (author: simon.fraser@apple.com) transitions/flex-transitions.html bug 114195 (author: tony@chromium.org) transitions/mixed-type.html bug 114196 (author: mikelawther@chromium.org) transitions/multiple-mask-transitions.html bug 114197 (author: simon.fraser@apple.com) transitions/color-transition-premultiplied.html bug 114198 (author: simon.fraser@apple.com) transitions/mismatched-shadow-styles.html bug 114199 (author: simon.fraser@apple.com) transitions/mask-transitions.html bug 114200 (authors: ojan@chromium.org, oliver@apple.com, and simon.fraser@apple.com) transitions/cubic-bezier-overflow-length.html bug 114201 (author: peter@chromium.org) transitions/multiple-background-size-transitions.html bug 114202 (authors: mitz@webkit.org and simon.fraser@apple.com) transitions/clip-transition.html bug 114203 (authors: dglazkov@chromium.org, krit@webkit.org, and simon.fraser@apple.com) transitions/cubic-bezier-overflow-transform.html bug 114204 (author: peter@chromium.org) transitions/interrupted-accelerated-transition.html bug 56242 (authors: rniwa@webkit.org, simon.fraser@apple.com, and tonyg@chromium.org) transitions/background-transitions.html bug 114206 (author: simon.fraser@apple.com) http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html bug 114208 (authors: abarth@webkit.org and rniwa@webkit.org) fast/repaint/table-cell-collapsed-border-scroll.html bug 117529 (author: robert@webkit.org) fast/loader/javascript-url-in-object.html bug 114210 (authors: rniwa@webkit.org and sam@webkit.org) compositing/reflections/load-video-in-reflection.html bug 117427 (authors: mihaip@chromium.org, rniwa@webkit.org, and simon.fraser@apple.com) The commit-queue is continuing to process your patch.
WebKit Commit Bot
Comment 4 2013-06-13 09:13:05 PDT
Comment on attachment 204587 [details] Patch Clearing flags on attachment: 204587 Committed r151550: <http://trac.webkit.org/changeset/151550>
WebKit Commit Bot
Comment 5 2013-06-13 09:13:16 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.