Ignore:
Timestamp:
Aug 26, 2020, 10:27:16 PM (5 years ago)
Author:
Alexey Shvayka
Message:

Use jsTypeofIsObject() in DFG AI and operationTypeOfIsObject()
https://bugs.webkit.org/show_bug.cgi?id=144457

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch refactors jsTypeofIsObject(), leveraging fast path of isCallable(),
moves it to the header, and utilizes it in operationTypeOfIsObject() & DFG AI
(minding concurrency) to eliminate code duplication.

Also, removes orphaned slow_path_is_object declaration.

No behavior change, typeof microbenchmarks are neutral.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGOperations.cpp:
  • runtime/CommonSlowPaths.h:
  • runtime/Operations.cpp:

(JSC::jsTypeofIsObject): Deleted.

  • runtime/Operations.h:

(JSC::jsTypeofIsObjectWithConcurrency):
(JSC::jsTypeofIsObject):

Source/WTF:

  • wtf/TriState.h:

(WTF::invert):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Operations.cpp

    r266107 r266223  
    114114}
    115115
    116 bool jsTypeofIsObject(JSGlobalObject* globalObject, JSValue v)
    117 {
    118     VM& vm = globalObject->vm();
    119     if (!v.isCell())
    120         return v.isNull();
    121 
    122     JSType type = v.asCell()->type();
    123     if (type == StringType || type == SymbolType || type == HeapBigIntType)
    124         return false;
    125     if (type >= ObjectType) {
    126         if (asObject(v)->structure(vm)->masqueradesAsUndefined(globalObject))
    127             return false;
    128         JSObject* object = asObject(v);
    129         if (object->isCallable(vm))
    130             return false;
    131     }
    132     return true;
    133 }
    134 
    135116size_t normalizePrototypeChain(JSGlobalObject* globalObject, JSCell* base, bool& sawPolyProto)
    136117{
Note: See TracChangeset for help on using the changeset viewer.