Changeset 82519 in webkit


Ignore:
Timestamp:
Mar 30, 2011 4:53:25 PM (13 years ago)
Author:
oliver@apple.com
Message:

Rollout r82500

Location:
trunk/Source/JavaScriptCore
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r82516 r82519  
     12011-03-30  Oliver Hunt  <oliver@apple.com>
     2
     3        Rollout r82500
     4
     5        * bytecode/CodeBlock.cpp:
     6        (JSC::CodeBlock::dump):
     7        (JSC::CodeBlock::derefStructures):
     8        (JSC::CodeBlock::refStructures):
     9        (JSC::CodeBlock::markAggregate):
     10        * bytecode/Instruction.h:
     11        (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
     12        (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
     13        (JSC::PolymorphicAccessStructureList::derefStructures):
     14        (JSC::Instruction::Instruction):
     15        * bytecode/StructureStubInfo.cpp:
     16        (JSC::StructureStubInfo::deref):
     17        * bytecode/StructureStubInfo.h:
     18        (JSC::StructureStubInfo::initGetByIdChain):
     19        (JSC::StructureStubInfo::initPutByIdTransition):
     20        * bytecompiler/BytecodeGenerator.cpp:
     21        (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
     22        (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
     23        * interpreter/Interpreter.cpp:
     24        (JSC::Interpreter::privateExecute):
     25        * jit/JITOpcodes.cpp:
     26        (JSC::JIT::emit_op_jneq_ptr):
     27        * jit/JITOpcodes32_64.cpp:
     28        (JSC::JIT::emit_op_jneq_ptr):
     29        * jit/JITPropertyAccess.cpp:
     30        (JSC::JIT::privateCompileGetByIdChainList):
     31        * jit/JITPropertyAccess32_64.cpp:
     32        (JSC::JIT::privateCompileGetByIdChainList):
     33        * jit/JITStubs.cpp:
     34        (JSC::getPolymorphicAccessStructureListSlot):
     35        (JSC::DEFINE_STUB_FUNCTION):
     36        * runtime/JSCell.h:
     37        * runtime/JSGlobalData.cpp:
     38        (JSC::JSGlobalData::JSGlobalData):
     39        * runtime/JSGlobalData.h:
     40        * runtime/JSGlobalObject.cpp:
     41        (JSC::markIfNeeded):
     42        * runtime/JSGlobalObject.h:
     43        (JSC::Structure::prototypeChain):
     44        * runtime/JSObject.h:
     45        (JSC::JSObject::markChildrenDirect):
     46        * runtime/JSPropertyNameIterator.cpp:
     47        (JSC::JSPropertyNameIterator::create):
     48        (JSC::JSPropertyNameIterator::get):
     49        (JSC::JSPropertyNameIterator::markChildren):
     50        * runtime/JSPropertyNameIterator.h:
     51        (JSC::JSPropertyNameIterator::setCachedPrototypeChain):
     52        * runtime/MarkStack.h:
     53        (JSC::MarkStack::append):
     54        * runtime/Structure.h:
     55        * runtime/StructureChain.cpp:
     56        (JSC::StructureChain::StructureChain):
     57        * runtime/StructureChain.h:
     58        (JSC::StructureChain::create):
     59
    1602011-03-29  Matthew Delaney  <mdelaney@apple.com>
    261
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r82500 r82519  
    732732            int r0 = (++it)->u.operand;
    733733            int id0 = (++it)->u.operand;
    734             JSValue scope = JSValue((++it)->u.jsCell.get());
     734            JSValue scope = JSValue((++it)->u.jsCell);
    735735            ++it;
    736736            int depth = (++it)->u.operand;
     
    14381438    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
    14391439        vPC[4].u.structure->deref();
     1440        vPC[5].u.structureChain->deref();
    14401441        return;
    14411442    }
     
    14431444        vPC[4].u.structure->deref();
    14441445        vPC[5].u.structure->deref();
     1446        vPC[6].u.structureChain->deref();
    14451447        return;
    14461448    }
     
    14851487    if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain)) {
    14861488        vPC[4].u.structure->ref();
     1489        vPC[5].u.structureChain->ref();
    14871490        return;
    14881491    }
     
    14901493        vPC[4].u.structure->ref();
    14911494        vPC[5].u.structure->ref();
     1495        vPC[6].u.structureChain->ref();
    14921496        return;
    14931497    }
     
    15241528            markStack.append(&callLinkInfo(i).callee);
    15251529#endif
    1526 #if ENABLE(INTERPRETER)
    1527     Interpreter* interpreter = m_globalData->interpreter;
    1528     for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i) {
    1529         Instruction* vPC = &m_instructions[m_propertyAccessInstructions[i]];
    1530         if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_getter_chain) || vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_custom_chain))
    1531             markStack.append(&vPC[5].u.structureChain);
    1532         else if (vPC[0].u.opcode == interpreter->getOpcode(op_put_by_id_transition))
    1533             markStack.append(&vPC[6].u.structureChain);
    1534     }
    1535 #endif
    1536 #if ENABLE(JIT)
    1537     for (size_t size = m_structureStubInfos.size(), i = 0; i < size; ++i)
    1538         m_structureStubInfos[i].markAggregate(markStack);
    1539 #endif
    15401530}
    15411531
  • trunk/Source/JavaScriptCore/bytecode/Instruction.h

    r82500 r82519  
    6464            union {
    6565                Structure* proto;
    66                 WriteBarrierBase<StructureChain> chain;
     66                StructureChain* chain;
    6767            } u;
    6868
     
    8383            }
    8484           
    85             void set(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain)
     85            void set(PolymorphicAccessStructureListStubRoutineType _stubRoutine, Structure* _base, StructureChain* _chain)
    8686            {
    8787                stubRoutine = _stubRoutine;
    8888                base = _base;
    89                 u.chain.set(globalData, owner, _chain);
     89                u.chain = _chain;
    9090                isChain = true;
    9191            }
     
    102102        }
    103103
    104         PolymorphicAccessStructureList(JSGlobalData& globalData, JSCell* owner, PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain)
     104        PolymorphicAccessStructureList(PolymorphicAccessStructureListStubRoutineType stubRoutine, Structure* firstBase, StructureChain* firstChain)
    105105        {
    106             list[0].set(globalData, owner, stubRoutine, firstBase, firstChain);
     106            list[0].set(stubRoutine, firstBase, firstChain);
    107107        }
    108108
     
    116116
    117117                if (info.u.proto) {
    118                     if (!info.isChain)
     118                    if (info.isChain)
     119                        info.u.chain->deref();
     120                    else
    119121                        info.u.proto->deref();
    120122                }
    121             }
    122         }
    123 
    124         void markAggregate(MarkStack& markStack, int count)
    125         {
    126             for (int i = 0; i < count; ++i) {
    127                 PolymorphicStubInfo& info = list[i];
    128                 ASSERT(info.base);
    129                
    130                 if (info.u.proto && info.isChain)
    131                     markStack.append(&info.u.chain);
    132123            }
    133124        }
     
    140131            // We have to initialize one of the pointer members to ensure that
    141132            // the entire struct is initialized, when opcode is not a pointer.
    142             u.jsCell.clear();
     133            u.jsCell = 0;
    143134#endif
    144135            u.opcode = opcode;
     
    149140            // We have to initialize one of the pointer members to ensure that
    150141            // the entire struct is initialized in 64-bit.
    151             u.jsCell.clear();
     142            u.jsCell = 0;
    152143            u.operand = operand;
    153144        }
    154145
    155146        Instruction(Structure* structure) { u.structure = structure; }
    156         Instruction(JSGlobalData& globalData, JSCell* owner, StructureChain* structureChain)
    157         {
    158             u.structureChain.clear();
    159             u.structureChain.set(globalData, owner, structureChain);
    160         }
    161         Instruction(JSGlobalData& globalData, JSCell* owner, JSCell* jsCell)
    162         {
    163             u.jsCell.clear();
    164             u.jsCell.set(globalData, owner, jsCell);
    165         }
     147        Instruction(StructureChain* structureChain) { u.structureChain = structureChain; }
     148        Instruction(JSCell* jsCell) { u.jsCell = jsCell; }
    166149        Instruction(PolymorphicAccessStructureList* polymorphicStructures) { u.polymorphicStructures = polymorphicStructures; }
    167150        Instruction(PropertySlot::GetValueFunc getterFunc) { u.getterFunc = getterFunc; }
     
    171154            int operand;
    172155            Structure* structure;
    173             WriteBarrierBase<StructureChain> structureChain;
    174             WriteBarrierBase<JSCell> jsCell;
     156            StructureChain* structureChain;
     157            JSCell* jsCell;
    175158            PolymorphicAccessStructureList* polymorphicStructures;
    176159            PropertySlot::GetValueFunc getterFunc;
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp

    r82500 r82519  
    4545    case access_get_by_id_chain:
    4646        u.getByIdChain.baseObjectStructure->deref();
     47        u.getByIdChain.chain->deref();
    4748        return;
    4849    case access_get_by_id_self_list: {
     
    6162        u.putByIdTransition.previousStructure->deref();
    6263        u.putByIdTransition.structure->deref();
     64        u.putByIdTransition.chain->deref();
    6365        return;
    6466    case access_put_by_id_replace:
     
    7779    }
    7880}
    79 
    80 void StructureStubInfo::markAggregate(MarkStack& markStack)
    81 {
    82     switch (accessType) {
    83     case access_get_by_id_self:
    84         return;
    85     case access_get_by_id_proto:
    86         return;
    87     case access_get_by_id_chain:
    88         return;
    89     case access_get_by_id_self_list: {
    90         PolymorphicAccessStructureList* polymorphicStructures = u.getByIdSelfList.structureList;
    91         polymorphicStructures->markAggregate(markStack, u.getByIdSelfList.listSize);
    92         return;
    93     }
    94     case access_get_by_id_proto_list: {
    95         PolymorphicAccessStructureList* polymorphicStructures = u.getByIdProtoList.structureList;
    96         polymorphicStructures->markAggregate(markStack, u.getByIdProtoList.listSize);
    97         return;
    98     }
    99     case access_put_by_id_transition:
    100         return;
    101     case access_put_by_id_replace:
    102         return;
    103     case access_get_by_id:
    104     case access_put_by_id:
    105     case access_get_by_id_generic:
    106     case access_put_by_id_generic:
    107     case access_get_array_length:
    108     case access_get_string_length:
    109         // These instructions don't ref their Structures.
    110         return;
    111     default:
    112         ASSERT_NOT_REACHED();
    113     }
    114 }
    11581#endif
    11682
  • trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h

    r82500 r82519  
    8686
    8787            u.getByIdChain.chain = chain;
     88            chain->ref();
    8889        }
    8990
     
    117118
    118119            u.putByIdTransition.chain = chain;
     120            chain->ref();
    119121        }
    120122
     
    128130
    129131        void deref();
    130         void markAggregate(MarkStack&);
    131132
    132133        bool seenOnce()
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r82500 r82519  
    926926    emitOpcode(op_jneq_ptr);
    927927    instructions().append(cond->index());
    928     instructions().append(Instruction(*m_globalData, m_codeBlock->ownerExecutable(), m_scopeChain->globalObject->callFunction()));
     928    instructions().append(m_scopeChain->globalObject->callFunction());
    929929    instructions().append(target->bind(begin, instructions().size()));
    930930    return target;
     
    937937    emitOpcode(op_jneq_ptr);
    938938    instructions().append(cond->index());
    939     instructions().append(Instruction(*m_globalData, m_codeBlock->ownerExecutable(), m_scopeChain->globalObject->applyFunction()));
     939    instructions().append(m_scopeChain->globalObject->applyFunction());
    940940    instructions().append(target->bind(begin, instructions().size()));
    941941    return target;
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r82500 r82519  
    35383538         */
    35393539        int src = vPC[1].u.operand;
     3540        JSValue ptr = JSValue(vPC[2].u.jsCell);
    35403541        int target = vPC[3].u.operand;
    35413542        JSValue srcValue = callFrame->r(src).jsValue();
    3542         if (srcValue != vPC[2].u.jsCell.get()) {
     3543        if (srcValue != ptr) {
    35433544            vPC += target;
    35443545            NEXT_INSTRUCTION();
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r82500 r82519  
    763763{
    764764    unsigned src = currentInstruction[1].u.operand;
    765     JSCell* ptr = currentInstruction[2].u.jsCell.get();
     765    JSCell* ptr = currentInstruction[2].u.jsCell;
    766766    unsigned target = currentInstruction[3].u.operand;
    767767   
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r82500 r82519  
    980980{
    981981    unsigned src = currentInstruction[1].u.operand;
    982     JSCell* ptr = currentInstruction[2].u.jsCell.get();
     982    JSCell* ptr = currentInstruction[2].u.jsCell;
    983983    unsigned target = currentInstruction[3].u.operand;
    984984
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r82500 r82519  
    980980    // Track the stub we have created so that it will be deleted later.
    981981    structure->ref();
    982     prototypeStructures->list[currentIndex].set(callFrame->globalData(), m_codeBlock->ownerExecutable(), entryLabel, structure, chain);
     982    chain->ref();
     983    prototypeStructures->list[currentIndex].set(entryLabel, structure, chain);
    983984
    984985    // Finally patch the jump to slow case back in the hot path to jump here instead.
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r82500 r82519  
    10081008    // Track the stub we have created so that it will be deleted later.
    10091009    structure->ref();
    1010     prototypeStructures->list[currentIndex].set(callFrame->globalData(), m_codeBlock->ownerExecutable(), entryLabel, structure, chain);
     1010    chain->ref();
     1011    prototypeStructures->list[currentIndex].set(entryLabel, structure, chain);
    10111012   
    10121013    // Finally patch the jump to slow case back in the hot path to jump here instead.
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r82500 r82519  
    15541554}
    15551555
    1556 static PolymorphicAccessStructureList* getPolymorphicAccessStructureListSlot(JSGlobalData& globalData, ScriptExecutable* owner, StructureStubInfo* stubInfo, int& listIndex)
     1556static PolymorphicAccessStructureList* getPolymorphicAccessStructureListSlot(StructureStubInfo* stubInfo, int& listIndex)
    15571557{
    15581558    PolymorphicAccessStructureList* prototypeStructureList = 0;
     
    15661566        break;
    15671567    case access_get_by_id_chain:
    1568         prototypeStructureList = new PolymorphicAccessStructureList(globalData, owner, stubInfo->stubRoutine, stubInfo->u.getByIdChain.baseObjectStructure, stubInfo->u.getByIdChain.chain);
     1568        prototypeStructureList = new PolymorphicAccessStructureList(stubInfo->stubRoutine, stubInfo->u.getByIdChain.baseObjectStructure, stubInfo->u.getByIdChain.chain);
    15691569        stubInfo->stubRoutine = CodeLocationLabel();
    15701570        stubInfo->initGetByIdProtoList(prototypeStructureList, 2);
     
    16541654
    16551655        int listIndex;
    1656         PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(callFrame->globalData(), codeBlock->ownerExecutable(), stubInfo, listIndex);
     1656        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
    16571657        if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) {
    16581658            JIT::compileGetByIdProtoList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, slotBaseObject->structure(), propertyName, slot, offset);
     
    16641664        ASSERT(!baseValue.asCell()->structure()->isDictionary());
    16651665        int listIndex;
    1666         PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(callFrame->globalData(), codeBlock->ownerExecutable(), stubInfo, listIndex);
     1666        PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex);
    16671667       
    16681668        if (listIndex < POLYMORPHIC_LIST_CACHE_SIZE) {
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r82500 r82519  
    6969        friend class MarkedBlock;
    7070        friend class ScopeChainNode;
    71         friend class StructureChain;
    7271
    7372    private:
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r82500 r82519  
    185185    functionExecutableStructure = FunctionExecutable::createStructure(*this, jsNull());
    186186    dummyMarkableCellStructure = JSCell::createDummyStructure(*this);
    187     structureChainStructure = StructureChain::createStructure(*this, jsNull());
    188187
    189188    interpreter = new Interpreter(*this);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.h

    r82500 r82519  
    162162        RefPtr<Structure> functionExecutableStructure;
    163163        RefPtr<Structure> dummyMarkableCellStructure;
    164         RefPtr<Structure> structureChainStructure;
    165164
    166165        static void storeVPtrs();
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r82500 r82519  
    8989    if (s && s->storedPrototype())
    9090        markStack.append(s->storedPrototypeSlot());
    91     if (s && *s->cachedPrototypeChainSlot())
    92         markStack.append(s->cachedPrototypeChainSlot());
    9391}
    9492
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r82500 r82519  
    2929#include "NumberPrototype.h"
    3030#include "StringPrototype.h"
    31 #include "StructureChain.h"
    3231#include <wtf/HashSet.h>
    3332#include <wtf/OwnPtr.h>
     
    364363        if (!isValid(exec, m_cachedPrototypeChain.get())) {
    365364            JSValue prototype = prototypeForLookup(exec);
    366             m_cachedPrototypeChain = StructureChain::create(exec->globalData(), prototype.isNull() ? 0 : asObject(prototype)->structure());
     365            m_cachedPrototypeChain = StructureChain::create(prototype.isNull() ? 0 : asObject(prototype)->structure());
    367366        }
    368367        return m_cachedPrototypeChain.get();
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r82500 r82519  
    815815{
    816816    JSCell::markChildren(markStack);
    817    
     817
    818818    markStack.append(m_structure->storedPrototypeSlot());
    819     if (*m_structure->cachedPrototypeChainSlot())
    820         markStack.append(m_structure->cachedPrototypeChainSlot());
    821819    PropertyStorage storage = propertyStorage();
    822820    size_t storageSize = m_structure->propertyStorageSize();
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp

    r82500 r82519  
    7878    }
    7979
    80     jsPropertyNameIterator->setCachedPrototypeChain(exec->globalData(), structureChain);
     80    jsPropertyNameIterator->setCachedPrototypeChain(structureChain);
    8181    jsPropertyNameIterator->setCachedStructure(o->structure());
    8282    o->structure()->setEnumerationCache(exec->globalData(), jsPropertyNameIterator);
     
    8787{
    8888    JSValue identifier = m_jsStrings[i].get();
    89     if (m_cachedStructure == base->structure() && m_cachedPrototypeChain.get() == base->structure()->prototypeChain(exec))
     89    if (m_cachedStructure == base->structure() && m_cachedPrototypeChain == base->structure()->prototypeChain(exec))
    9090        return identifier;
    9191
     
    9898{
    9999    markStack.appendValues(m_jsStrings.get(), m_jsStringsSize, MayContainNullValues);
    100     if (m_cachedPrototypeChain)
    101         markStack.append(&m_cachedPrototypeChain);
    102100}
    103101
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h

    r82500 r82519  
    7474        Structure* cachedStructure() { return m_cachedStructure.get(); }
    7575
    76         void setCachedPrototypeChain(JSGlobalData& globalData, StructureChain* cachedPrototypeChain) { m_cachedPrototypeChain.set(globalData, this, cachedPrototypeChain); }
     76        void setCachedPrototypeChain(NonNullPassRefPtr<StructureChain> cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; }
    7777        StructureChain* cachedPrototypeChain() { return m_cachedPrototypeChain.get(); }
    7878
     
    8585
    8686        RefPtr<Structure> m_cachedStructure;
    87         WriteBarrier<StructureChain> m_cachedPrototypeChain;
     87        RefPtr<StructureChain> m_cachedPrototypeChain;
    8888        uint32_t m_numCacheableSlots;
    8989        uint32_t m_jsStringsSize;
  • trunk/Source/JavaScriptCore/runtime/MarkStack.h

    r82500 r82519  
    216216    template <typename T> inline void MarkStack::append(DeprecatedPtr<T>* slot)
    217217    {
    218         internalAppend(*slot->slot());
     218        internalAppend(slot->get());
    219219    }
    220220   
    221221    template <typename T> inline void MarkStack::append(WriteBarrierBase<T>* slot)
    222222    {
    223         internalAppend(*slot->slot());
     223        internalAppend(slot->get());
    224224    }
    225225
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r82500 r82519  
    3333#include "PropertyNameArray.h"
    3434#include "Protect.h"
     35#include "StructureChain.h"
    3536#include "StructureTransitionTable.h"
    3637#include "JSTypeInfo.h"
     
    4647    class PropertyNameArray;
    4748    class PropertyNameArrayData;
    48     class StructureChain;
    4949
    5050    struct ClassInfo;
     
    108108        JSValue prototypeForLookup(ExecState*) const;
    109109        StructureChain* prototypeChain(ExecState*) const;
    110         DeprecatedPtr<StructureChain>* cachedPrototypeChainSlot() { return &m_cachedPrototypeChain; }
    111110
    112111        Structure* previousID() const { return m_previous.get(); }
     
    212211
    213212        DeprecatedPtr<Unknown> m_prototype;
    214         mutable DeprecatedPtr<StructureChain> m_cachedPrototypeChain;
     213        mutable RefPtr<StructureChain> m_cachedPrototypeChain;
    215214
    216215        RefPtr<Structure> m_previous;
  • trunk/Source/JavaScriptCore/runtime/StructureChain.cpp

    r82500 r82519  
    3333namespace JSC {
    3434
    35 StructureChain::StructureChain(NonNullPassRefPtr<Structure> structure, Structure* head)
    36     : JSCell(structure.releaseRef())
     35StructureChain::StructureChain(Structure* head)
    3736{
    3837    size_t size = 0;
  • trunk/Source/JavaScriptCore/runtime/StructureChain.h

    r82500 r82519  
    2727#define StructureChain_h
    2828
    29 #include "JSCell.h"
    30 
    3129#include <wtf/OwnArrayPtr.h>
    3230#include <wtf/PassRefPtr.h>
     
    3836    class Structure;
    3937
    40     class StructureChain : public JSCell {
     38    class StructureChain : public RefCounted<StructureChain> {
    4139        friend class JIT;
    4240
    4341    public:
    44         static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (&globalData) StructureChain(globalData.structureChainStructure, head); }
     42        static PassRefPtr<StructureChain> create(Structure* head) { return adoptRef(new StructureChain(head)); }
    4543        RefPtr<Structure>* head() { return m_vector.get(); }
    4644
    47         static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(CompoundType, OverridesMarkChildren), 0, 0); }
    4845    private:
    49         StructureChain(NonNullPassRefPtr<Structure>, Structure* head);
     46        StructureChain(Structure* head);
    5047
    5148        OwnArrayPtr<RefPtr<Structure> > m_vector;
Note: See TracChangeset for help on using the changeset viewer.