Ignore:
Timestamp:
Apr 3, 2014, 7:29:15 PM (11 years ago)
Author:
[email protected]
Message:

Fast-path for casting JS wrappers to JSNode.
<https://webkit.org/b/131196>

Source/JavaScriptCore:

Allow code outside of JSC (well, WebCore) to extend the JSType spectrum
a little bit. We do this by exposing a LastJSCObjectType constant so
WebCore can encode its own wrapper types after that.

Reviewed by Mark Hahnenberg and Geoff Garen.

  • runtime/JSType.h:

Added LastJSCObjectType for use by WebCore.

  • runtime/JSObject.h:

(JSC::JSObject::isVariableObject):

Updated since this can no longer assume that types >= VariableObjectType
are all variable objects.

Source/WebCore:

Add a way to quickly determine that a given JSObject is a JSNode.
This lets us avoid walking the ClassInfo chain in the DOM bindings
for WebCore::Node.

Reviewed by Mark Hahnenberg and Geoff Garen.

  • bindings/js/JSDOMWrapper.h:

Added a JSNodeType constant that extends beyond JSC::JSType.

  • bindings/js/JSNodeCustom.h:

(WebCore::jsNodeCast):

Added. Fast cast from JSValue to JSNode.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateImplementation):

Generate code that uses jsNodeCast in Node interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r166397 r166760  
    11231123inline bool JSObject::isVariableObject() const
    11241124{
    1125     return type() >= VariableObjectType;
    1126 }
    1127 
     1125    return type() == GlobalObjectType || type() == ActivationObjectType;
     1126}
    11281127
    11291128inline bool JSObject::isStaticScopeObject() const
Note: See TracChangeset for help on using the changeset viewer.