⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 167550 in webkit


Ignore:
Timestamp:
Apr 19, 2014, 3:09:51 PM (12 years ago)
Author:
akling@apple.com
Message:

Two little shortcuts to the JSType.
<https://webkit.org/b/131896>

Tweak two sites that take the long road through JSCell::structure()->typeInfo()
to look at data that's already in JSCell::type().

Reviewed by Darin Adler.

  • runtime/NameInstance.h:

(JSC::isName):

  • runtime/NumberPrototype.cpp:

(JSC::toThisNumber):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167548 r167550  
     12014-04-19  Andreas Kling  <akling@apple.com>
     2
     3        Two little shortcuts to the JSType.
     4        <https://webkit.org/b/131896>
     5
     6        Tweak two sites that take the long road through JSCell::structure()->typeInfo()
     7        to look at data that's already in JSCell::type().
     8
     9        Reviewed by Darin Adler.
     10
     11        * runtime/NameInstance.h:
     12        (JSC::isName):
     13        * runtime/NumberPrototype.cpp:
     14        (JSC::toThisNumber):
     15
    1162014-04-19  Filip Pizlo  <fpizlo@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/NameInstance.h

    r154038 r167550  
    7070inline bool isName(JSValue v)
    7171{
    72     return v.isCell() && v.asCell()->structure()->typeInfo().isName();
     72    return v.isCell() && v.asCell()->type() == NameInstanceType;
    7373}
    7474
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r166493 r167550  
    105105    }
    106106   
    107     if (thisValue.isCell() && thisValue.asCell()->structure()->typeInfo().isNumberObject()) {
     107    if (thisValue.isCell() && thisValue.asCell()->type() == NumberObjectType) {
    108108        x = static_cast<const NumberObject*>(thisValue.asCell())->internalValue().asNumber();
    109109        return true;
Note: See TracChangeset for help on using the changeset viewer.