Show
Ignore:
Timestamp:
08/18/08 11:14:49 (5 months ago)
Author:
odole
Message:

merge with webkit revision 35814

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/JavaScriptCore/kjs/Arguments.cpp

    r414 r440  
    3333namespace KJS { 
    3434 
     35ASSERT_CLASS_FITS_IN_CELL(Arguments); 
     36 
    3537const ClassInfo Arguments::info = { "Arguments", 0, 0, 0 }; 
    3638 
     
    3840Arguments::Arguments(ExecState* exec, JSFunction* function, const ArgList& args, JSActivation* activation) 
    3941    : JSObject(exec->lexicalGlobalObject()->objectPrototype()) 
    40     , m_activationObject(activation) 
    41     , m_indexToNameMap(function, args) 
     42    , d(new ArgumentsData(activation, function, args)) 
    4243{ 
     44    ASSERT(activation); 
     45 
    4346    putDirect(exec->propertyNames().callee, function, DontEnum); 
    4447    putDirect(exec, exec->propertyNames().length, args.size(), DontEnum); 
     
    4851    for (ArgList::const_iterator it = args.begin(); it != end; ++it, ++i) { 
    4952        Identifier name = Identifier::from(exec, i); 
    50         if (!m_indexToNameMap.isMapped(name)) 
     53        if (!d->indexToNameMap.isMapped(name)) 
    5154            putDirect(name, (*it).jsValue(exec), DontEnum); 
    5255    } 
     
    5659{ 
    5760    JSObject::mark(); 
    58     if (m_activationObject && !m_activationObject->marked()) 
    59         m_activationObject->mark(); 
     61    if (!d->activation->marked()) 
     62        d->activation->mark(); 
    6063} 
    6164 
     
    6366{ 
    6467      Arguments* thisObj = static_cast<Arguments*>(slot.slotBase()); 
    65       return thisObj->m_activationObject->get(exec, thisObj->m_indexToNameMap[propertyName]); 
     68      return thisObj->d->activation->get(exec, thisObj->d->indexToNameMap[propertyName]); 
    6669} 
    6770 
    6871bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 
    6972{ 
    70     if (m_indexToNameMap.isMapped(propertyName)) { 
     73    if (d->indexToNameMap.isMapped(propertyName)) { 
    7174        slot.setCustom(this, mappedIndexGetter); 
    7275        return true; 
     
    7881void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 
    7982{ 
    80     if (m_indexToNameMap.isMapped(propertyName)) 
    81         m_activationObject->put(exec, m_indexToNameMap[propertyName], value); 
     83    if (d->indexToNameMap.isMapped(propertyName)) 
     84        d->activation->put(exec, d->indexToNameMap[propertyName], value); 
    8285    else 
    8386        JSObject::put(exec, propertyName, value); 
     
    8689bool Arguments::deleteProperty(ExecState* exec, const Identifier& propertyName)  
    8790{ 
    88     if (m_indexToNameMap.isMapped(propertyName)) { 
    89         m_indexToNameMap.unMap(exec, propertyName); 
     91    if (d->indexToNameMap.isMapped(propertyName)) { 
     92        d->indexToNameMap.unMap(exec, propertyName); 
    9093        return true; 
    9194    }