Ignore:
Timestamp:
Apr 29, 2015, 2:27:48 PM (10 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore:
JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
https://bugs.webkit.org/show_bug.cgi?id=144397

Reviewed by Andreas Kling.

Add the flag to JSTypeInfo. It's an inline flag so that it's fast to query. Slap the flag on
callback objects and internal functions. Modify the TypeOf operation to use this flag to avoid
making a getCallData() call if it isn't necessary.

  • API/JSCallbackObject.h:
  • runtime/InternalFunction.h:
  • runtime/JSTypeInfo.h:

(JSC::TypeInfo::typeOfShouldCallGetCallData):

  • runtime/Operations.cpp:

(JSC::jsTypeStringForValue):

  • tests/stress/type-of-functions-and-objects.js: Added.

(foo):
(bar):
(baz):
(fuzz):
(expect):
(test):

Source/WebCore:
JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
https://bugs.webkit.org/show_bug.cgi?id=144397

Reviewed by Andreas Kling.

If you override getCallData() and you want to be called a "function", then you need to use the
new TypeOfShouldCallGetCallData flag.

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):

  • bridge/objc/objc_runtime.h:
  • bridge/runtime_method.h:
  • bridge/runtime_object.h:

Source/WebKit2:
JSTypeInfo should have an inline type flag to indicate if getCallData() has been overridden
https://bugs.webkit.org/show_bug.cgi?id=144397

Reviewed by Andreas Kling.

If you override getCallData() and you want to be called a "function", then you need to use the
new TypeOfShouldCallGetCallData flag.

  • WebProcess/Plugins/Netscape/JSNPObject.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r183005 r183575  
    126126public:
    127127    typedef Parent Base;
    128     static const unsigned StructureFlags = Base::StructureFlags | ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | ImplementsHasInstance | OverridesHasInstance | OverridesGetPropertyNames;
     128    static const unsigned StructureFlags = Base::StructureFlags | ProhibitsPropertyCaching | OverridesGetOwnPropertySlot | InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | ImplementsHasInstance | OverridesHasInstance | OverridesGetPropertyNames | TypeOfShouldCallGetCallData;
    129129
    130130    ~JSCallbackObject();
Note: See TracChangeset for help on using the changeset viewer.