WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
131196
Fast-path for casting JS wrappers to JSNode.
https://bugs.webkit.org/show_bug.cgi?id=131196
Summary
Fast-path for casting JS wrappers to JSNode.
Andreas Kling
Reported
2014-04-03 17:40:16 PDT
We should have a fast-path for casting JS wrappers to JSNode.
Attachments
Patch
(6.31 KB, patch)
2014-04-03 18:09 PDT
,
Andreas Kling
mhahnenberg
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Andreas Kling
Comment 1
2014-04-03 18:09:31 PDT
Created
attachment 228567
[details]
Patch
Mark Hahnenberg
Comment 2
2014-04-03 18:18:55 PDT
Comment on
attachment 228567
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=228567&action=review
r=me with comments
> Source/WebCore/bindings/js/JSDOMWrapper.h:33 > + JSNodeExtendedType = 0,
I'd say something like: JSNodeType = ExtendedObjectType, That way you don't have to remember to do the addition later, and you don't have to keep typing "Extended" everywhere :-)
Geoffrey Garen
Comment 3
2014-04-03 18:23:54 PDT
Comment on
attachment 228567
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=228567&action=review
r=me
> Source/JavaScriptCore/runtime/JSObject.h:1125 > + return type() >= VariableObjectType && type() < ExtendedObjectType;
I think this would be clearer as "== GlobalObjectType || == ActivationObjectType" (removing VariableObjectType altogether).
> Source/JavaScriptCore/runtime/JSType.h:73 > + // We use (>=VariableObjectType && <ExtendedObjectType) checks to test for Global & Activation objects, but exclude NameScopes.
Space. And see comment above.
> Source/JavaScriptCore/runtime/JSType.h:79 > + ExtendedObjectType,
I would call this "LastJSCType = ActivationObjectType", or something like that.
> Source/WebCore/bindings/js/JSNodeCustom.h:85 > + return value.asCell()->type() == (JSC::ExtendedObjectType + JSNodeExtendedType) ? JSC::jsCast<JSNode*>(value) : nullptr;
It kind of stinks that the client of the constant needs to know that the constant isn't the right value to test, and you have to add something else in. Can we just make a JSNodeType constant that includes JSC::ExtendedObjectType?
Andreas Kling
Comment 4
2014-04-03 19:30:12 PDT
Committed
r166760
: <
http://trac.webkit.org/changeset/166760
>
Simon Fraser (smfr)
Comment 5
2014-04-03 22:08:45 PDT
Broke bindings tests.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug