Ignore:
Timestamp:
Jan 31, 2011, 12:07:21 PM (14 years ago)
Author:
[email protected]
Message:

2011-01-31 Oliver Hunt <[email protected]>

Convert markstack to a slot visitor API
https://bugs.webkit.org/show_bug.cgi?id=53219

rolling r77098, r77099, r77100, r77109, and
r77111 back in, along with a few more Qt fix attempts.

File:
1 edited

Legend:

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

    r77113 r77151  
    8585        Holder(JSObject*);
    8686
    87         JSObject* object() const { return m_object; }
     87        JSObject* object() const { return m_object.get(); }
     88        DeprecatedPtr<JSObject>* objectSlot() { return &m_object; }
    8889
    8990        bool appendNextProperty(Stringifier&, UStringBuilder&);
    9091
    9192    private:
    92         JSObject* const m_object;
     93        DeprecatedPtr<JSObject> m_object;
    9394        const bool m_isArray;
    9495        bool m_isJSArray;
     
    259260        size_t size = m_holderStack.size();
    260261        for (size_t i = 0; i < size; ++i)
    261             markStack.append(m_holderStack[i].object());
     262            markStack.append(m_holderStack[i].objectSlot());
    262263    }
    263264}
     
    270271
    271272    PropertyNameForFunctionCall emptyPropertyName(m_exec->globalData().propertyNames->emptyIdentifier);
    272     object->putDirect(m_exec->globalData().propertyNames->emptyIdentifier, value);
     273    object->putDirect(m_exec->globalData(), m_exec->globalData().propertyNames->emptyIdentifier, value);
    273274
    274275    UStringBuilder result;
     
    500501    if (!m_index) {
    501502        if (m_isArray) {
    502             m_isJSArray = isJSArray(&exec->globalData(), m_object);
     503            m_isJSArray = isJSArray(&exec->globalData(), m_object.get());
    503504            m_size = m_object->get(exec, exec->globalData().propertyNames->length).toUInt32(exec);
    504505            builder.append('[');
     
    533534        // Get the value.
    534535        JSValue value;
    535         if (m_isJSArray && asArray(m_object)->canGetIndex(index))
    536             value = asArray(m_object)->getIndex(index);
     536        if (m_isJSArray && asArray(m_object.get())->canGetIndex(index))
     537            value = asArray(m_object.get())->getIndex(index);
    537538        else {
    538             PropertySlot slot(m_object);
     539            PropertySlot slot(m_object.get());
    539540            if (!m_object->getOwnPropertySlot(exec, index, slot))
    540541                slot.setUndefined();
     
    550551
    551552        // Append the stringified value.
    552         stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object, index);
     553        stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object.get(), index);
    553554    } else {
    554555        // Get the value.
    555         PropertySlot slot(m_object);
     556        PropertySlot slot(m_object.get());
    556557        Identifier& propertyName = m_propertyNames->propertyNameVector()[index];
    557558        if (!m_object->getOwnPropertySlot(exec, propertyName, slot))
     
    575576
    576577        // Append the stringified value.
    577         stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object, propertyName);
     578        stringifyResult = stringifier.appendStringifiedValue(builder, value, m_object.get(), propertyName);
    578579    }
    579580
     
    642643        JSValue args[] = { property, unfiltered };
    643644        ArgList argList(args, 2);
    644         return call(m_exec, m_function, m_callType, m_callData, thisObj, argList);
     645        return call(m_exec, m_function.get(), m_callType, m_callData, thisObj, argList);
    645646    }
    646647
     
    648649
    649650    ExecState* m_exec;
    650     JSObject* m_function;
     651    DeprecatedPtr<JSObject> m_function;
    651652    CallType m_callType;
    652653    CallData m_callData;
     
    727728                else {
    728729                    if (isJSArray(&m_exec->globalData(), array) && array->canSetIndex(indexStack.last()))
    729                         array->setIndex(indexStack.last(), filteredValue);
     730                        array->setIndex(m_exec->globalData(), indexStack.last(), filteredValue);
    730731                    else
    731732                        array->put(m_exec, indexStack.last(), filteredValue);
Note: See TracChangeset for help on using the changeset viewer.