Changeset 440 for trunk/JavaScriptCore/kjs/Arguments.cpp
- Timestamp:
- 08/18/08 11:14:49 (5 months ago)
- Files:
-
- trunk/JavaScriptCore/kjs/Arguments.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/kjs/Arguments.cpp
r414 r440 33 33 namespace KJS { 34 34 35 ASSERT_CLASS_FITS_IN_CELL(Arguments); 36 35 37 const ClassInfo Arguments::info = { "Arguments", 0, 0, 0 }; 36 38 … … 38 40 Arguments::Arguments(ExecState* exec, JSFunction* function, const ArgList& args, JSActivation* activation) 39 41 : JSObject(exec->lexicalGlobalObject()->objectPrototype()) 40 , m_activationObject(activation) 41 , m_indexToNameMap(function, args) 42 , d(new ArgumentsData(activation, function, args)) 42 43 { 44 ASSERT(activation); 45 43 46 putDirect(exec->propertyNames().callee, function, DontEnum); 44 47 putDirect(exec, exec->propertyNames().length, args.size(), DontEnum); … … 48 51 for (ArgList::const_iterator it = args.begin(); it != end; ++it, ++i) { 49 52 Identifier name = Identifier::from(exec, i); 50 if (! m_indexToNameMap.isMapped(name))53 if (!d->indexToNameMap.isMapped(name)) 51 54 putDirect(name, (*it).jsValue(exec), DontEnum); 52 55 } … … 56 59 { 57 60 JSObject::mark(); 58 if ( m_activationObject && !m_activationObject->marked())59 m_activationObject->mark();61 if (!d->activation->marked()) 62 d->activation->mark(); 60 63 } 61 64 … … 63 66 { 64 67 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]); 66 69 } 67 70 68 71 bool Arguments::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) 69 72 { 70 if ( m_indexToNameMap.isMapped(propertyName)) {73 if (d->indexToNameMap.isMapped(propertyName)) { 71 74 slot.setCustom(this, mappedIndexGetter); 72 75 return true; … … 78 81 void Arguments::put(ExecState* exec, const Identifier& propertyName, JSValue* value) 79 82 { 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); 82 85 else 83 86 JSObject::put(exec, propertyName, value); … … 86 89 bool Arguments::deleteProperty(ExecState* exec, const Identifier& propertyName) 87 90 { 88 if ( m_indexToNameMap.isMapped(propertyName)) {89 m_indexToNameMap.unMap(exec, propertyName);91 if (d->indexToNameMap.isMapped(propertyName)) { 92 d->indexToNameMap.unMap(exec, propertyName); 90 93 return true; 91 94 }
