Changeset 95326 in webkit


Ignore:
Timestamp:
Sep 16, 2011 2:34:20 PM (13 years ago)
Author:
weinig@apple.com
Message:

Prepare JSTypes for more Object subtypes
https://bugs.webkit.org/show_bug.cgi?id=68200

Reviewed by Gavin Barraclough.

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::branchIfNotObject):

  • jit/JITInlineMethods.h:

(JSC::JIT::emitJumpIfNotObject):

  • runtime/JSGlobalObject.h:

(JSC::Structure::prototypeForLookup):

  • runtime/JSObject.h:

(JSC::JSObject::finishCreation):

  • runtime/JSType.h:
  • runtime/JSTypeInfo.h:

(JSC::TypeInfo::type):
(JSC::TypeInfo::isObject):
(JSC::TypeInfo::isFinal):
(JSC::TypeInfo::prohibitsPropertyCaching):

  • runtime/NativeErrorConstructor.h:

(JSC::NativeErrorConstructor::finishCreation):

  • runtime/Operations.cpp:

(JSC::jsIsObjectType):

  • runtime/Structure.cpp:

(JSC::Structure::addPropertyTransitionToExistingStructure):
(JSC::Structure::addPropertyTransition):

  • runtime/Structure.h:

(JSC::Structure::isObject):
(JSC::JSCell::isObject):

Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95324 r95326  
     12011-09-15  Sam Weinig  <sam@webkit.org>
     2
     3        Prepare JSTypes for more Object subtypes
     4        https://bugs.webkit.org/show_bug.cgi?id=68200
     5
     6        Reviewed by Gavin Barraclough.
     7
     8        * dfg/DFGJITCompiler.h:
     9        (JSC::DFG::JITCompiler::branchIfNotObject):
     10        * jit/JITInlineMethods.h:
     11        (JSC::JIT::emitJumpIfNotObject):
     12        * runtime/JSGlobalObject.h:
     13        (JSC::Structure::prototypeForLookup):
     14        * runtime/JSObject.h:
     15        (JSC::JSObject::finishCreation):
     16        * runtime/JSType.h:
     17        * runtime/JSTypeInfo.h:
     18        (JSC::TypeInfo::type):
     19        (JSC::TypeInfo::isObject):
     20        (JSC::TypeInfo::isFinal):
     21        (JSC::TypeInfo::prohibitsPropertyCaching):
     22        * runtime/NativeErrorConstructor.h:
     23        (JSC::NativeErrorConstructor::finishCreation):
     24        * runtime/Operations.cpp:
     25        (JSC::jsIsObjectType):
     26        * runtime/Structure.cpp:
     27        (JSC::Structure::addPropertyTransitionToExistingStructure):
     28        (JSC::Structure::addPropertyTransition):
     29        * runtime/Structure.h:
     30        (JSC::Structure::isObject):
     31        (JSC::JSCell::isObject):
     32
    1332011-09-16  Geoffrey Garen  <ggaren@apple.com>
    234
  • trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.h

    r95310 r95326  
    188188    Jump branchIfNotObject(GPRReg structureReg)
    189189    {
    190         return branch8(NotEqual, Address(structureReg, Structure::typeInfoTypeOffset()), TrustedImm32(ObjectType));
     190        return branch8(Below, Address(structureReg, Structure::typeInfoTypeOffset()), TrustedImm32(ObjectType));
    191191    }
    192192
  • trunk/Source/JavaScriptCore/jit/JITInlineMethods.h

    r95324 r95326  
    316316ALWAYS_INLINE JIT::Jump JIT::emitJumpIfNotObject(RegisterID structureReg)
    317317{
    318     return branch8(NotEqual, Address(structureReg, Structure::typeInfoTypeOffset()), TrustedImm32(ObjectType));
     318    return branch8(Below, Address(structureReg, Structure::typeInfoTypeOffset()), TrustedImm32(ObjectType));
    319319}
    320320
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r94929 r95326  
    349349    inline JSValue Structure::prototypeForLookup(ExecState* exec) const
    350350    {
    351         if (typeInfo().type() == ObjectType)
     351        if (isObject())
    352352            return m_prototype.get();
    353353
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r95318 r95326  
    246246            ASSERT(prototype().isNull() || Heap::heap(this) == Heap::heap(prototype()));
    247247            ASSERT_UNUSED(inlineStorage, static_cast<void*>(inlineStorage) == static_cast<void*>(this + 1));
    248             ASSERT(m_structure->typeInfo().type() == ObjectType);
     248            ASSERT(m_structure->isObject());
    249249        }
    250250
  • trunk/Source/JavaScriptCore/runtime/JSType.h

    r94931 r95326  
    3737        // The CompoundType value must come before any JSType that may have children
    3838        CompoundType      = 7,
    39         ObjectType        = 8,
    40         GetterSetterType  = 9,
    41         APIValueWrapper   = 10
     39        GetterSetterType  = 8,
     40        APIValueWrapper   = 9,
     41        // The ObjectType value must come before any JSType that is a subclass of JSObject
     42        ObjectType        = 10,
     43        FinalObjectType   = 11,
    4244    };
    4345
  • trunk/Source/JavaScriptCore/runtime/JSTypeInfo.h

    r91095 r95326  
    6161        }
    6262
    63         JSType type() const { return (JSType)m_type; }
     63        JSType type() const { return static_cast<JSType>(m_type); }
     64        bool isObject() const { return type() >= ObjectType; }
    6465
    6566        bool masqueradesAsUndefined() const { return m_flags & MasqueradesAsUndefined; }
     
    7071        bool overridesVisitChildren() const { return m_flags & OverridesVisitChildren; }
    7172        bool overridesGetPropertyNames() const { return m_flags & OverridesGetPropertyNames; }
    72         unsigned isFinal() const { return m_flags2 & (IsJSFinalObject >> 8); }
    73         unsigned prohibitsPropertyCaching() const { return m_flags2 & (ProhibitsPropertyCaching >> 8); }
     73        bool isFinal() const { return m_flags2 & (IsJSFinalObject >> 8); }
     74        bool prohibitsPropertyCaching() const { return m_flags2 & (ProhibitsPropertyCaching >> 8); }
     75       
    7476        unsigned flags() const { return m_flags; }
    7577
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r95108 r95326  
    6363            m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), globalObject, prototype));
    6464            ASSERT(m_errorStructure);
    65             ASSERT(m_errorStructure->typeInfo().type() == ObjectType);
     65            ASSERT(m_errorStructure->isObject());
    6666        }
    6767
  • trunk/Source/JavaScriptCore/runtime/Operations.cpp

    r70749 r95326  
    8989    if (type == NumberType || type == StringType)
    9090        return false;
    91     if (type == ObjectType) {
     91    if (type >= ObjectType) {
    9292        if (asObject(v)->structure()->typeInfo().masqueradesAsUndefined())
    9393            return false;
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r94929 r95326  
    281281{
    282282    ASSERT(!structure->isDictionary());
    283     ASSERT(structure->typeInfo().type() == ObjectType);
     283    ASSERT(structure->isObject());
    284284
    285285    if (Structure* existingTransition = structure->m_transitionTable.get(propertyName.impl(), attributes)) {
     
    308308
    309309    ASSERT(!structure->isDictionary());
    310     ASSERT(structure->typeInfo().type() == ObjectType);
     310    ASSERT(structure->isObject());
    311311    ASSERT(!Structure::addPropertyTransitionToExistingStructure(structure, propertyName, attributes, specificValue, offset));
    312312   
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r94931 r95326  
    120120        bool isUncacheableDictionary() const { return m_dictionaryKind == UncachedDictionaryKind; }
    121121
     122        // Type accessors.
    122123        const TypeInfo& typeInfo() const { ASSERT(structure()->classInfo() == &s_info); return m_typeInfo; }
     124        bool isObject() const { return typeInfo().isObject(); }
     125
    123126
    124127        JSGlobalObject* globalObject() const { return m_globalObject.get(); }
     
    305308    inline bool JSCell::isObject() const
    306309    {
    307         return m_structure->typeInfo().type() == ObjectType;
     310        return m_structure->isObject();
    308311    }
    309312
Note: See TracChangeset for help on using the changeset viewer.