Changeset 260848 in webkit


Ignore:
Timestamp:
Apr 28, 2020 2:51:37 PM (4 years ago)
Author:
Ross Kirsling
Message:

[JSC] Align upon the name isCallable instead of isFunction
https://bugs.webkit.org/show_bug.cgi?id=211140

Reviewed by Darin Adler.

Source/JavaScriptCore:

Follow-up to r260722. Usage is now cleanly separated between isFunction / getCallData,
but the name isCallable is still clearer than isFunction so let's flip that after all.

  • API/JSContextRef.cpp:

(JSGlobalContextSetUnhandledRejectionCallback):

  • API/JSObjectRef.cpp:

(JSObjectIsFunction):

  • dfg/DFGOperations.cpp:
  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCreateThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
(JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isCallable):
(JSC::FTL::DFG::LowerDFGToB3::isFunction): Deleted.

  • ftl/FTLOperations.cpp:

(JSC::FTL::operationTypeOfObjectAsTypeofType):

  • jsc.cpp:

(functionSetUnhandledRejectionCallback):

  • runtime/CommonSlowPaths.cpp:

(JSC::SLOW_PATH_DECL):

  • runtime/ExceptionHelpers.cpp:

(JSC::errorDescriptionForValue):

  • runtime/FunctionPrototype.cpp:

(JSC::functionProtoFuncToString):

  • runtime/InternalFunction.cpp:

(JSC::getFunctionRealm):

  • runtime/JSCJSValue.h:
  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::isCallable const):
(JSC::JSValue::isFunction const): Deleted.

  • runtime/JSCell.h:
  • runtime/JSCellInlines.h:

(JSC::JSCell::isCallable):
(JSC::JSCell::isFunction): Deleted.

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue):

  • runtime/ObjectConstructor.cpp:

(JSC::toPropertyDescriptor):

  • runtime/ObjectPrototype.cpp:

(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):

  • runtime/Operations.cpp:

(JSC::jsTypeStringForValue):
(JSC::jsIsObjectTypeOrNull):

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::structureForTarget):
(JSC::ProxyObject::finishCreation):

  • runtime/RuntimeType.cpp:

(JSC::runtimeTypeForValue):

  • tools/JSDollarVM.cpp:

(JSC::functionCallWithStackSize):
(JSC::functionFindTypeForExpression):
(JSC::functionReturnTypeFor):
(JSC::functionHasBasicBlockExecuted):
(JSC::functionBasicBlockExecutionCount):

  • wasm/WasmInstance.cpp:

(JSC::Wasm::Instance::setFunctionWrapper):

  • wasm/WasmOperations.cpp:

(JSC::Wasm::operationIterateResults):
(JSC::Wasm::operationWasmRefFunc):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::link):

  • wasm/js/WebAssemblyWrapperFunction.cpp:

(JSC::WebAssemblyWrapperFunction::finishCreation):

Source/WebCore:

  • Modules/plugins/QuickTimePluginReplacement.mm:

(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):

  • bindings/js/JSCustomElementRegistryCustom.cpp:

(WebCore::getCustomElementCallback):

  • bindings/js/JSDOMConvertCallbacks.h:

(WebCore::Converter<IDLCallbackFunction<T>>::convert):

  • bindings/js/JSDOMConvertScheduledAction.h:

(WebCore::Converter<IDLScheduledAction>::convert):

  • bindings/js/JSDOMPromise.cpp:

(WebCore::DOMPromise::whenPromiseIsSettled):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::queueMicrotask):

  • bindings/js/JSWorkerGlobalScopeCustom.cpp:

(WebCore::JSWorkerGlobalScope::queueMicrotask):

  • bindings/js/ReadableStream.cpp:

(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):

  • bindings/js/ReadableStreamDefaultController.cpp:

(WebCore::ReadableStreamDefaultController::invoke):

  • bindings/js/ScriptController.cpp:

(WebCore::ScriptController::callInWorld):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateOverloadDispatcher):

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):

  • worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::registerPaint):

Source/WebKit:

  • WebProcess/Plugins/Netscape/NPJSObject.cpp:

(WebKit::NPJSObject::hasMethod):

Location:
trunk/Source
Files:
43 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r259676 r260848  
    263263
    264264    JSObject* object = toJS(function);
    265     if (!object->isFunction(vm)) {
     265    if (!object->isCallable(vm)) {
    266266        *exception = toRef(createTypeError(globalObject));
    267267        return;
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r260744 r260848  
    707707    JSLockHolder locker(vm);
    708708    JSCell* cell = toJS(object);
    709     return cell->isFunction(vm);
     709    return cell->isCallable(vm);
    710710}
    711711
  • trunk/Source/JavaScriptCore/ChangeLog

    r260834 r260848  
     12020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] Align upon the name isCallable instead of isFunction
     4        https://bugs.webkit.org/show_bug.cgi?id=211140
     5
     6        Reviewed by Darin Adler.
     7
     8        Follow-up to r260722. Usage is now cleanly separated between isFunction / getCallData,
     9        but the name isCallable is still clearer than isFunction so let's flip that after all.
     10
     11        * API/JSContextRef.cpp:
     12        (JSGlobalContextSetUnhandledRejectionCallback):
     13        * API/JSObjectRef.cpp:
     14        (JSObjectIsFunction):
     15        * dfg/DFGOperations.cpp:
     16        * ftl/FTLLowerDFGToB3.cpp:
     17        (JSC::FTL::DFG::LowerDFGToB3::compileCreateThis):
     18        (JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
     19        (JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
     20        (JSC::FTL::DFG::LowerDFGToB3::compileIsObjectOrNull):
     21        (JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
     22        (JSC::FTL::DFG::LowerDFGToB3::buildTypeOf):
     23        (JSC::FTL::DFG::LowerDFGToB3::isCallable):
     24        (JSC::FTL::DFG::LowerDFGToB3::isFunction): Deleted.
     25        * ftl/FTLOperations.cpp:
     26        (JSC::FTL::operationTypeOfObjectAsTypeofType):
     27        * jsc.cpp:
     28        (functionSetUnhandledRejectionCallback):
     29        * runtime/CommonSlowPaths.cpp:
     30        (JSC::SLOW_PATH_DECL):
     31        * runtime/ExceptionHelpers.cpp:
     32        (JSC::errorDescriptionForValue):
     33        * runtime/FunctionPrototype.cpp:
     34        (JSC::functionProtoFuncToString):
     35        * runtime/InternalFunction.cpp:
     36        (JSC::getFunctionRealm):
     37        * runtime/JSCJSValue.h:
     38        * runtime/JSCJSValueInlines.h:
     39        (JSC::JSValue::isCallable const):
     40        (JSC::JSValue::isFunction const): Deleted.
     41        * runtime/JSCell.h:
     42        * runtime/JSCellInlines.h:
     43        (JSC::JSCell::isCallable):
     44        (JSC::JSCell::isFunction): Deleted.
     45        * runtime/JSONObject.cpp:
     46        (JSC::Stringifier::appendStringifiedValue):
     47        * runtime/ObjectConstructor.cpp:
     48        (JSC::toPropertyDescriptor):
     49        * runtime/ObjectPrototype.cpp:
     50        (JSC::objectProtoFuncDefineGetter):
     51        (JSC::objectProtoFuncDefineSetter):
     52        * runtime/Operations.cpp:
     53        (JSC::jsTypeStringForValue):
     54        (JSC::jsIsObjectTypeOrNull):
     55        * runtime/ProxyObject.cpp:
     56        (JSC::ProxyObject::structureForTarget):
     57        (JSC::ProxyObject::finishCreation):
     58        * runtime/RuntimeType.cpp:
     59        (JSC::runtimeTypeForValue):
     60        * tools/JSDollarVM.cpp:
     61        (JSC::functionCallWithStackSize):
     62        (JSC::functionFindTypeForExpression):
     63        (JSC::functionReturnTypeFor):
     64        (JSC::functionHasBasicBlockExecuted):
     65        (JSC::functionBasicBlockExecutionCount):
     66        * wasm/WasmInstance.cpp:
     67        (JSC::Wasm::Instance::setFunctionWrapper):
     68        * wasm/WasmOperations.cpp:
     69        (JSC::Wasm::operationIterateResults):
     70        (JSC::Wasm::operationWasmRefFunc):
     71        * wasm/js/WebAssemblyModuleRecord.cpp:
     72        (JSC::WebAssemblyModuleRecord::link):
     73        * wasm/js/WebAssemblyWrapperFunction.cpp:
     74        (JSC::WebAssemblyWrapperFunction::finishCreation):
     75
    1762020-04-28  Yusuke Suzuki  <ysuzuki@apple.com>
    277
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r260834 r260848  
    21442144    if (object->structure(vm)->masqueradesAsUndefined(globalObject))
    21452145        return false;
    2146     if (object->isFunction(vm))
     2146    if (object->isCallable(vm))
    21472147        return false;
    21482148    return true;
     
    21592159    if (object->structure(vm)->masqueradesAsUndefined(globalObject))
    21602160        return false;
    2161     if (object->isFunction(vm))
     2161    if (object->isCallable(vm))
    21622162        return true;
    21632163    return false;
     
    21742174    if (object->structure(vm)->masqueradesAsUndefined(globalObject))
    21752175        return vm.smallStrings.undefinedString();
    2176     if (object->isFunction(vm))
     2176    if (object->isCallable(vm))
    21772177        return vm.smallStrings.functionString();
    21782178    return vm.smallStrings.objectString();
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r260834 r260848  
    69736973        LBasicBlock continuation = m_out.newBlock();
    69746974
    6975         m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowPath));
     6975        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowPath));
    69766976
    69776977        LBasicBlock lastNext = m_out.appendTo(isFunctionBlock, hasRareData);
     
    70187018
    70197019        LBasicBlock lastNext = m_out.appendTo(derivedCase, isFunctionBlock);
    7020         m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
     7020        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
    70217021
    70227022        m_out.appendTo(isFunctionBlock, hasRareData);
     
    70737073        LBasicBlock continuation = m_out.newBlock();
    70747074
    7075         m_out.branch(isFunction(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
     7075        m_out.branch(isCallable(callee, provenType(m_node->child1())), usually(isFunctionBlock), rarely(slowCase));
    70767076
    70777077        LBasicBlock lastNext = m_out.appendTo(isFunctionBlock, hasRareData);
     
    1156911569        ValueFromBlock isFunctionResult = m_out.anchor(m_out.booleanFalse);
    1157011570        m_out.branch(
    11571             isFunction(value, provenType(child)),
     11571            isCallable(value, provenType(child)),
    1157211572            unsure(continuation), unsure(notFunctionCase));
    1157311573       
     
    1162611626        ValueFromBlock functionResult = m_out.anchor(m_out.booleanTrue);
    1162711627        m_out.branch(
    11628             isFunction(value, provenType(child)),
     11628            isCallable(value, provenType(child)),
    1162911629            unsure(continuation), unsure(notFunctionCase));
    1163011630       
     
    1619516195        m_out.appendTo(objectCase, functionCase);
    1619616196        m_out.branch(
    16197             isFunction(value, provenType(child) & SpecObject),
     16197            isCallable(value, provenType(child) & SpecObject),
    1619816198            unsure(functionCase), unsure(notFunctionCase));
    1619916199       
     
    1790017900    }
    1790117901   
    17902     LValue isFunction(LValue cell, SpeculatedType type = SpecFullTop)
     17902    LValue isCallable(LValue cell, SpeculatedType type = SpecFullTop)
    1790317903    {
    1790417904        if (LValue proven = isProvenValue(type & SpecCell, SpecFunction))
  • trunk/Source/JavaScriptCore/ftl/FTLOperations.cpp

    r260321 r260848  
    722722    if (object->structure(vm)->masqueradesAsUndefined(globalObject))
    723723        return static_cast<int32_t>(TypeofType::Undefined);
    724     if (object->isFunction(vm))
     724    if (object->isCallable(vm))
    725725        return static_cast<int32_t>(TypeofType::Function);
    726726    return static_cast<int32_t>(TypeofType::Object);
  • trunk/Source/JavaScriptCore/jsc.cpp

    r260744 r260848  
    24862486    auto scope = DECLARE_THROW_SCOPE(vm);
    24872487
    2488     if (!object || !object->isFunction(vm))
     2488    if (!object || !object->isCallable(vm))
    24892489        return throwVMTypeError(globalObject, scope);
    24902490
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp

    r260809 r260848  
    833833    BEGIN();
    834834    auto bytecode = pc->as<OpIsFunction>();
    835     RETURN(jsBoolean(GET_C(bytecode.m_operand).jsValue().isFunction(vm)));
     835    RETURN(jsBoolean(GET_C(bytecode.m_operand).jsValue().isCallable(vm)));
    836836}
    837837
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r260810 r260848  
    9696        VM& vm = globalObject->vm();
    9797        JSObject* object = asObject(v);
    98         if (object->isFunction(vm))
     98        if (object->isCallable(vm))
    9999            return vm.smallStrings.functionString()->value(globalObject);
    100100        return JSObject::calculatedClassName(object);
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r259547 r260848  
    150150        JSObject* object = asObject(thisValue);
    151151        Integrity::auditStructureID(vm, object->structureID());
    152         if (object->isFunction(vm))
     152        if (object->isCallable(vm))
    153153            RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(globalObject, "function ", object->classInfo(vm)->className, "() {\n    [native code]\n}")));
    154154    }
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp

    r260744 r260848  
    158158JSGlobalObject* getFunctionRealm(VM& vm, JSObject* object)
    159159{
    160     ASSERT(object->isFunction(vm));
     160    ASSERT(object->isCallable(vm));
    161161
    162162    if (object->inherits<JSBoundFunction>(vm))
  • trunk/Source/JavaScriptCore/runtime/JSCJSValue.h

    r260805 r260848  
    231231    // Querying the type.
    232232    bool isEmpty() const;
    233     bool isFunction(VM&) const;
     233    bool isCallable(VM&) const;
    234234    bool isConstructor(VM&) const;
    235235    bool isUndefined() const;
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r260805 r260848  
    888888}
    889889
    890 inline bool JSValue::isFunction(VM& vm) const
    891 {
    892     if (!isCell())
    893         return false;
    894     return asCell()->isFunction(vm);
     890inline bool JSValue::isCallable(VM& vm) const
     891{
     892    return isCell() && asCell()->isCallable(vm);
    895893}
    896894
    897895inline bool JSValue::isConstructor(VM& vm) const
    898896{
    899     if (!isCell())
    900         return false;
    901     return asCell()->isConstructor(vm);
     897    return isCell() && asCell()->isConstructor(vm);
    902898}
    903899
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r260744 r260848  
    108108    bool isCustomGetterSetter() const;
    109109    bool isProxy() const;
    110     bool isFunction(VM&);
     110    bool isCallable(VM&);
    111111    bool isConstructor(VM&);
    112112    bool inherits(VM&, const ClassInfo*) const;
  • trunk/Source/JavaScriptCore/runtime/JSCellInlines.h

    r260744 r260848  
    230230}
    231231
    232 ALWAYS_INLINE bool JSCell::isFunction(VM& vm)
     232ALWAYS_INLINE bool JSCell::isCallable(VM& vm)
    233233{
    234234    if (type() == JSFunctionType)
  • trunk/Source/JavaScriptCore/runtime/JSONObject.cpp

    r260744 r260848  
    385385
    386386    JSObject* object = asObject(value);
    387     if (object->isFunction(vm)) {
     387    if (object->isCallable(vm)) {
    388388        if (holder.isArray()) {
    389389            builder.appendLiteral("null");
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r260732 r260848  
    533533        JSValue get = description->get(globalObject, vm.propertyNames->get);
    534534        RETURN_IF_EXCEPTION(scope, false);
    535         if (!get.isUndefined() && !get.isFunction(vm)) {
     535        if (!get.isUndefined() && !get.isCallable(vm)) {
    536536            throwTypeError(globalObject, scope, "Getter must be a function."_s);
    537537            return false;
     
    546546        JSValue set = description->get(globalObject, vm.propertyNames->set);
    547547        RETURN_IF_EXCEPTION(scope, false);
    548         if (!set.isUndefined() && !set.isFunction(vm)) {
     548        if (!set.isUndefined() && !set.isCallable(vm)) {
    549549            throwTypeError(globalObject, scope, "Setter must be a function."_s);
    550550            return false;
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.cpp

    r260744 r260848  
    155155
    156156    JSValue get = callFrame->argument(1);
    157     if (!get.isFunction(vm))
     157    if (!get.isCallable(vm))
    158158        return throwVMTypeError(globalObject, scope, "invalid getter usage"_s);
    159159
     
    182182
    183183    JSValue set = callFrame->argument(1);
    184     if (!set.isFunction(vm))
     184    if (!set.isCallable(vm))
    185185        return throwVMTypeError(globalObject, scope, "invalid setter usage"_s);
    186186
  • trunk/Source/JavaScriptCore/runtime/Operations.cpp

    r260809 r260848  
    100100        if (object->structure(vm)->masqueradesAsUndefined(globalObject))
    101101            return vm.smallStrings.undefinedString();
    102         if (object->isFunction(vm))
     102        if (object->isCallable(vm))
    103103            return vm.smallStrings.functionString();
    104104    }
     
    124124            return false;
    125125        JSObject* object = asObject(v);
    126         if (object->isFunction(vm))
     126        if (object->isCallable(vm))
    127127            return false;
    128128    }
  • trunk/Source/JavaScriptCore/runtime/ProxyObject.cpp

    r260744 r260848  
    7373{
    7474    VM& vm = globalObject->vm();
    75     return target.isFunction(vm) ? globalObject->callableProxyObjectStructure() : globalObject->proxyObjectStructure();
     75    return target.isCallable(vm) ? globalObject->callableProxyObjectStructure() : globalObject->proxyObjectStructure();
    7676}
    7777
     
    9292    JSObject* targetAsObject = jsCast<JSObject*>(target);
    9393
    94     m_isCallable = targetAsObject->isFunction(vm);
     94    m_isCallable = targetAsObject->isCallable(vm);
    9595    if (m_isCallable) {
    9696        TypeInfo info = structure(vm)->typeInfo();
  • trunk/Source/JavaScriptCore/runtime/RuntimeType.cpp

    r248898 r260848  
    5252    if (value.isObject())
    5353        return TypeObject;
    54     if (value.isFunction(vm))
     54    if (value.isCallable(vm))
    5555        return TypeFunction;
    5656    if (value.isSymbol())
  • trunk/Source/JavaScriptCore/tools/JSDollarVM.cpp

    r260784 r260848  
    21792179    JSValue arg0 = callFrame->argument(0);
    21802180    JSValue arg1 = callFrame->argument(1);
    2181     if (!arg0.isFunction(vm))
     2181    if (!arg0.isCallable(vm))
    21822182        return throwVMError(globalObject, throwScope, "arg0 should be a function");
    21832183    if (!arg1.isNumber())
     
    25922592
    25932593    JSValue functionValue = callFrame->argument(0);
    2594     RELEASE_ASSERT(functionValue.isFunction(vm));
     2594    RELEASE_ASSERT(functionValue.isCallable(vm));
    25952595    FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
    25962596
     
    26122612
    26132613    JSValue functionValue = callFrame->argument(0);
    2614     RELEASE_ASSERT(functionValue.isFunction(vm));
     2614    RELEASE_ASSERT(functionValue.isCallable(vm));
    26152615    FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
    26162616
     
    26462646
    26472647    JSValue functionValue = callFrame->argument(0);
    2648     RELEASE_ASSERT(functionValue.isFunction(vm));
     2648    RELEASE_ASSERT(functionValue.isCallable(vm));
    26492649    FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
    26502650
     
    26662666
    26672667    JSValue functionValue = callFrame->argument(0);
    2668     RELEASE_ASSERT(functionValue.isFunction(vm));
     2668    RELEASE_ASSERT(functionValue.isCallable(vm));
    26692669    FunctionExecutable* executable = (jsDynamicCast<JSFunction*>(vm, functionValue.asCell()->getObject()))->jsExecutable();
    26702670
  • trunk/Source/JavaScriptCore/wasm/WasmInstance.cpp

    r253987 r260848  
    109109{
    110110    ASSERT(m_owner);
    111     ASSERT(value.isFunction(owner<JSWebAssemblyInstance>()->vm()));
     111    ASSERT(value.isCallable(owner<JSWebAssemblyInstance>()->vm()));
    112112    ASSERT(!m_functionWrappers.contains(i));
    113113    auto locker = holdLock(owner<JSWebAssemblyInstance>()->cellLock());
  • trunk/Source/JavaScriptCore/wasm/WasmOperations.cpp

    r256500 r260848  
    540540                break;
    541541            case Funcref:
    542                 if (!value.isFunction(vm)) {
     542                if (!value.isCallable(vm)) {
    543543                    throwTypeError(globalObject, scope, "Funcref value is not a function"_s);
    544544                    return;
     
    729729{
    730730    JSValue value = instance->getFunctionWrapper(index);
    731     ASSERT(value.isFunction(instance->owner<JSObject>()->vm()));
     731    ASSERT(value.isCallable(instance->owner<JSObject>()->vm()));
    732732    return JSValue::encode(value);
    733733}
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp

    r260744 r260848  
    189189            // 4. If i is a function import:
    190190            // i. If IsCallable(v) is false, throw a WebAssembly.LinkError.
    191             if (!value.isFunction(vm))
     191            if (!value.isCallable(vm))
    192192                return exception(createJSWebAssemblyLinkError(globalObject, vm, importFailMessage(import, "import function", "must be callable")));
    193193
     
    393393        }
    394394
    395         ASSERT(wrapper.isFunction(vm));
     395        ASSERT(wrapper.isCallable(vm));
    396396        m_instance->instance().setFunctionWrapper(index, wrapper);
    397397
     
    413413            } else if (global.initializationType == Wasm::GlobalInformation::FromRefFunc) {
    414414                ASSERT(global.initialBitsOrImportNumber < moduleInformation.functionIndexSpaceSize());
    415                 ASSERT(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber).isFunction(vm));
     415                ASSERT(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber).isCallable(vm));
    416416                initialBits = JSValue::encode(makeFunctionWrapper("Global init expr", global.initialBitsOrImportNumber));
    417417            } else
     
    445445        case Wasm::ExternalKind::Function: {
    446446            exportedValue = makeFunctionWrapper(String::fromUTF8(exp.field), exp.kindIndex);
    447             ASSERT(exportedValue.isFunction(vm));
     447            ASSERT(exportedValue.isCallable(vm));
    448448            ASSERT(makeFunctionWrapper(String::fromUTF8(exp.field), exp.kindIndex) == exportedValue);
    449449            break;
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyWrapperFunction.cpp

    r260744 r260848  
    6969{
    7070    Base::finishCreation(vm, executable, length, name, instance);
    71     RELEASE_ASSERT(JSValue(function).isFunction(vm));
     71    RELEASE_ASSERT(JSValue(function).isCallable(vm));
    7272    m_function.set(vm, this, function);
    7373}
  • trunk/Source/WebCore/ChangeLog

    r260845 r260848  
     12020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] Align upon the name isCallable instead of isFunction
     4        https://bugs.webkit.org/show_bug.cgi?id=211140
     5
     6        Reviewed by Darin Adler.
     7
     8        * Modules/plugins/QuickTimePluginReplacement.mm:
     9        (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
     10        * bindings/js/JSCustomElementRegistryCustom.cpp:
     11        (WebCore::getCustomElementCallback):
     12        * bindings/js/JSDOMConvertCallbacks.h:
     13        (WebCore::Converter<IDLCallbackFunction<T>>::convert):
     14        * bindings/js/JSDOMConvertScheduledAction.h:
     15        (WebCore::Converter<IDLScheduledAction>::convert):
     16        * bindings/js/JSDOMPromise.cpp:
     17        (WebCore::DOMPromise::whenPromiseIsSettled):
     18        * bindings/js/JSDOMWindowCustom.cpp:
     19        (WebCore::JSDOMWindow::queueMicrotask):
     20        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
     21        (WebCore::JSWorkerGlobalScope::queueMicrotask):
     22        * bindings/js/ReadableStream.cpp:
     23        (WebCore::ReadableStream::pipeTo):
     24        (WebCore::ReadableStream::tee):
     25        * bindings/js/ReadableStreamDefaultController.cpp:
     26        (WebCore::ReadableStreamDefaultController::invoke):
     27        * bindings/js/ScriptController.cpp:
     28        (WebCore::ScriptController::callInWorld):
     29        * bindings/scripts/CodeGeneratorJS.pm:
     30        (GenerateOverloadDispatcher):
     31        * html/HTMLMediaElement.cpp:
     32        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
     33        * testing/Internals.cpp:
     34        (WebCore::Internals::parserMetaData):
     35        (WebCore::Internals::cloneArrayBuffer):
     36        * worklets/PaintWorkletGlobalScope.cpp:
     37        (WebCore::PaintWorkletGlobalScope::registerPaint):
     38
    1392020-04-28  Simon Fraser  <simon.fraser@apple.com>
    240
  • trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm

    r260744 r260848  
    154154   
    155155    JSC::JSValue replacementFunction = globalObject->get(lexicalGlobalObject, JSC::Identifier::fromString(vm, "createPluginReplacement"));
    156     if (replacementFunction.isFunction(vm))
     156    if (replacementFunction.isCallable(vm))
    157157        return true;
    158158   
  • trunk/Source/WebCore/bindings/js/JSCustomElementRegistryCustom.cpp

    r251691 r260848  
    5050    if (callback.isUndefined())
    5151        return nullptr;
    52     if (!callback.isFunction(vm)) {
     52    if (!callback.isCallable(vm)) {
    5353        throwTypeError(&lexicalGlobalObject, scope, "A custom element callback must be a function"_s);
    5454        return nullptr;
  • trunk/Source/WebCore/bindings/js/JSDOMConvertCallbacks.h

    r251425 r260848  
    4141        auto scope = DECLARE_THROW_SCOPE(vm);
    4242
    43         if (!value.isFunction(vm)) {
     43        if (!value.isCallable(vm)) {
    4444            exceptionThrower(lexicalGlobalObject, scope);
    4545            return nullptr;
  • trunk/Source/WebCore/bindings/js/JSDOMConvertScheduledAction.h

    r260722 r260848  
    3939        auto scope = DECLARE_THROW_SCOPE(vm);
    4040
    41         if (!value.isFunction(vm)) {
     41        if (!value.isCallable(vm)) {
    4242            auto code = Converter<IDLDOMString>::convert(lexicalGlobalObject, value);
    4343            RETURN_IF_EXCEPTION(scope, nullptr);
  • trunk/Source/WebCore/bindings/js/JSDOMPromise.cpp

    r260744 r260848  
    6262        return;
    6363
    64     ASSERT(thenFunction.isFunction(vm));
     64    ASSERT(thenFunction.isCallable(vm));
    6565
    6666    JSC::MarkedArgumentBuffer arguments;
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r260597 r260848  
    541541
    542542    JSValue functionValue = callFrame.uncheckedArgument(0);
    543     if (UNLIKELY(!functionValue.isFunction(vm)))
     543    if (UNLIKELY(!functionValue.isCallable(vm)))
    544544        return JSValue::decode(throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "Window", "queueMicrotask"));
    545545
  • trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp

    r251425 r260848  
    5858
    5959    JSValue functionValue = callFrame.uncheckedArgument(0);
    60     if (UNLIKELY(!functionValue.isFunction(vm)))
     60    if (UNLIKELY(!functionValue.isCallable(vm)))
    6161        return JSValue::decode(throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "WorkerGlobalScope", "queueMicrotask"));
    6262
  • trunk/Source/WebCore/bindings/js/ReadableStream.cpp

    r260744 r260848  
    7979
    8080    auto readableStreamPipeTo = m_globalObject->get(&lexicalGlobalObject, privateName);
    81     ASSERT(readableStreamPipeTo.isFunction(lexicalGlobalObject.vm()));
     81    ASSERT(readableStreamPipeTo.isCallable(lexicalGlobalObject.vm()));
    8282
    8383    MarkedArgumentBuffer arguments;
     
    9595
    9696    auto readableStreamTee = m_globalObject->get(&lexicalGlobalObject, privateName);
    97     ASSERT(readableStreamTee.isFunction(lexicalGlobalObject.vm()));
     97    ASSERT(readableStreamTee.isCallable(lexicalGlobalObject.vm()));
    9898
    9999    MarkedArgumentBuffer arguments;
  • trunk/Source/WebCore/bindings/js/ReadableStreamDefaultController.cpp

    r260744 r260848  
    5757    RETURN_IF_EXCEPTION(scope, JSC::JSValue());
    5858
    59     if (!function.isFunction(vm)) {
     59    if (!function.isCallable(vm)) {
    6060        if (!function.isUndefined())
    6161            throwTypeError(&lexicalGlobalObject, scope, "ReadableStream trying to call a property that is not callable"_s);
  • trunk/Source/WebCore/bindings/js/ScriptController.cpp

    r260744 r260848  
    660660            break;
    661661
    662         if (!functionObject || !functionObject.isFunction(world.vm())) {
     662        if (!functionObject || !functionObject.isCallable(world.vm())) {
    663663            optionalDetails = { { "Unable to create JavaScript async function to call"_s } };
    664664            break;
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r260744 r260848  
    35143514
    35153515            $overload = GetOverloadThatMatches($S, $d, \&$isObjectOrCallbackFunctionParameter);
    3516             &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isFunction(vm)");
     3516            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isCallable(vm)");
    35173517
    35183518            # FIXME: Avoid invoking GetMethod(object, Symbol.iterator) again in convert<IDLSequence<T>>(...).
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r260744 r260848  
    71487148
    71497149        auto functionValue = globalObject.get(&lexicalGlobalObject, JSC::Identifier::fromString(vm, "createControls"));
    7150         if (functionValue.isFunction(vm))
     7150        if (functionValue.isCallable(vm))
    71517151            return true;
    71527152
  • trunk/Source/WebCore/testing/Internals.cpp

    r260822 r260848  
    22742274        CodeBlock* codeBlock = iter.codeBlock();
    22752275        executable = codeBlock->ownerExecutable();
    2276     } else if (code.isFunction(vm)) {
     2276    } else if (code.isCallable(vm)) {
    22772277        JSFunction* funcObj = JSC::jsCast<JSFunction*>(code.toObject(globalObject));
    22782278        executable = funcObj->jsExecutable();
     
    46474647    lexicalGlobalObject.methodTable(vm)->getOwnPropertySlot(&lexicalGlobalObject, &lexicalGlobalObject, privateName, propertySlot);
    46484648    value = propertySlot.getValue(&lexicalGlobalObject, privateName);
    4649     ASSERT(value.isFunction(vm));
     4649    ASSERT(value.isCallable(vm));
    46504650
    46514651    JSObject* function = value.getObject();
  • trunk/Source/WebCore/worklets/PaintWorkletGlobalScope.cpp

    r260722 r260848  
    7676
    7777    // Validate that paintConstructor is a VoidFunction
    78     if (!paintConstructor->isFunction(vm))
     78    if (!paintConstructor->isCallable(vm))
    7979        return Exception { TypeError, "paintConstructor must be callable" };
    8080
  • trunk/Source/WebKit/ChangeLog

    r260847 r260848  
     12020-04-28  Ross Kirsling  <ross.kirsling@sony.com>
     2
     3        [JSC] Align upon the name isCallable instead of isFunction
     4        https://bugs.webkit.org/show_bug.cgi?id=211140
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
     9        (WebKit::NPJSObject::hasMethod):
     10
    1112020-04-28  Devin Rousso  <drousso@apple.com>
    212
  • trunk/Source/WebKit/WebProcess/Plugins/Netscape/NPJSObject.cpp

    r260744 r260848  
    110110    scope.clearException();
    111111
    112     return value.isFunction(vm);
     112    return value.isCallable(vm);
    113113}
    114114
Note: See TracChangeset for help on using the changeset viewer.