We should have a fast-path for casting JS wrappers to JSNode.
Created attachment 228567 [details] Patch
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 :-)
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?
Committed r166760: <http://trac.webkit.org/changeset/166760>
Broke bindings tests.