Changeset 209636 in webkit


Ignore:
Timestamp:
Dec 9, 2016 3:37:00 PM (7 years ago)
Author:
Chris Dumez
Message:

Inline JSCell::toObject()
https://bugs.webkit.org/show_bug.cgi?id=165679

Reviewed by Geoffrey Garen.

Inline JSCell::toObject() as it shows on Speedometer profiles.

  • runtime/JSCell.cpp:

(JSC::JSCell::toObjectSlow):
(JSC::JSCell::toObject): Deleted.

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

(JSC::JSCell::toObject):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r209632 r209636  
     12016-12-09  Chris Dumez  <cdumez@apple.com>
     2
     3        Inline JSCell::toObject()
     4        https://bugs.webkit.org/show_bug.cgi?id=165679
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Inline JSCell::toObject() as it shows on Speedometer profiles.
     9
     10        * runtime/JSCell.cpp:
     11        (JSC::JSCell::toObjectSlow):
     12        (JSC::JSCell::toObject): Deleted.
     13        * runtime/JSCell.h:
     14        * runtime/JSCellInlines.h:
     15        (JSC::JSCell::toObject):
     16
    1172016-12-09  Geoffrey Garen  <ggaren@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/JSCell.cpp

    r208957 r209636  
    170170}
    171171
    172 JSObject* JSCell::toObject(ExecState* exec, JSGlobalObject* globalObject) const
    173 {
     172JSObject* JSCell::toObjectSlow(ExecState* exec, JSGlobalObject* globalObject) const
     173{
     174    ASSERT(!isObject());
    174175    if (isString())
    175176        return static_cast<const JSString*>(this)->toObject(exec, globalObject);
    176     if (isSymbol())
    177         return static_cast<const Symbol*>(this)->toObject(exec, globalObject);
    178     ASSERT(isObject());
    179     return jsCast<JSObject*>(const_cast<JSCell*>(this));
     177    ASSERT(isSymbol());
     178    return static_cast<const Symbol*>(this)->toObject(exec, globalObject);
    180179}
    181180
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r209570 r209636  
    145145    TriState pureToBoolean() const;
    146146    JS_EXPORT_PRIVATE double toNumber(ExecState*) const;
    147     JS_EXPORT_PRIVATE JSObject* toObject(ExecState*, JSGlobalObject*) const;
     147    JSObject* toObject(ExecState*, JSGlobalObject*) const;
    148148
    149149    void dump(PrintStream&) const;
     
    251251    friend class LLIntOffsetsExtractor;
    252252
     253    JS_EXPORT_PRIVATE JSObject* toObjectSlow(ExecState*, JSGlobalObject*) const;
     254
    253255    StructureID m_structureID;
    254256    IndexingType m_indexingTypeAndMisc; // DO NOT store to this field. Always CAS.
  • trunk/Source/JavaScriptCore/runtime/JSCellInlines.h

    r209570 r209636  
    337337}
    338338
     339inline JSObject* JSCell::toObject(ExecState* exec, JSGlobalObject* globalObject) const
     340{
     341    if (isObject())
     342        return jsCast<JSObject*>(const_cast<JSCell*>(this));
     343    return toObjectSlow(exec, globalObject);
     344}
     345
    339346} // namespace JSC
Note: See TracChangeset for help on using the changeset viewer.