Changeset 30040 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


Ignore:
Timestamp:
Feb 6, 2008, 9:33:07 AM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Sam.

  • replace calls to put to set up properties with calls to putDirect, to prepare for a future change where put won't take attributes any more, and for a slight performance boost
  • API/JSObjectRef.cpp: (JSObjectMakeConstructor): Use putDirect instead of put.
  • kjs/CommonIdentifiers.h: Removed lastIndex.
  • kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::reset): Use putDirect instead of put.
  • kjs/array_object.cpp: (KJS::arrayProtoFuncConcat): Took out extra call to get length (unused). (KJS::ArrayObjectImp::ArrayObjectImp): Use putDirect instead of put.
  • kjs/error_object.cpp: (KJS::ErrorPrototype::ErrorPrototype): Use putDirect instead of put.
  • kjs/function.cpp: (KJS::Arguments::Arguments): Use putDirect instead of put. (KJS::PrototypeFunction::PrototypeFunction): Use putDirect instead of put.
  • kjs/function_object.cpp: (KJS::FunctionObjectImp::construct): Use putDirect instead of put.
  • kjs/nodes.cpp: (KJS::FuncDeclNode::makeFunction): Use putDirect instead of put. (KJS::FuncExprNode::evaluate): Use putDirect instead of put.
  • kjs/regexp_object.cpp: (KJS::regExpProtoFuncCompile): Use setLastIndex instead of put(lastIndex). (KJS::RegExpImp::match): Get and set lastIndex by using m_lastIndex instead of calling get and put.
  • kjs/regexp_object.h: (KJS::RegExpImp::setLastIndex): Added.
  • kjs/string_object.cpp: (KJS::stringProtoFuncMatch): Use setLastIndex instead of put(lastIndex).

WebCore:

Reviewed by Sam.

  • replace calls to put to set up properties with calls to putDirect, to prepare for a future change where put won't take attributes any more, and for a slight performance boost
  • bindings/js/JSAudioConstructor.cpp: (WebCore::JSAudioConstructor::JSAudioConstructor): Use putDirect instead of put.
  • bindings/js/JSEventTargetBase.h: (WebCore::JSEventTargetPrototype::self): Ditto.
  • bindings/js/JSHTMLOptionElementConstructor.cpp: (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor): Ditto.
  • bindings/js/JSSQLResultSetRowListCustom.cpp: (WebCore::JSSQLResultSetRowList::item): Ditto.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r29997 r30040  
    46704670
    46714671    JSObject* proto = exec->lexicalGlobalObject()->objectConstructor()->construct(exec, exec->emptyList());
    4672     proto->put(exec, exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
    4673     func->put(exec, exec->propertyNames().prototype, proto, Internal|DontDelete);
    4674 
    4675     func->put(exec, exec->propertyNames().length, jsNumber(m_body->parameters().size()), ReadOnly|DontDelete|DontEnum);
     4672    proto->putDirect(exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
     4673    func->putDirect(exec->propertyNames().prototype, proto, Internal | DontDelete);
     4674    func->putDirect(exec->propertyNames().length, jsNumber(m_body->parameters().size()), ReadOnly | DontDelete | DontEnum);
    46764675    return func;
    46774676}
     
    47084707    FunctionImp* func = new FunctionImp(exec, m_ident, m_body.get(), exec->scopeChain());
    47094708    JSObject* proto = exec->lexicalGlobalObject()->objectConstructor()->construct(exec, exec->emptyList());
    4710     proto->put(exec, exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
    4711     func->put(exec, exec->propertyNames().prototype, proto, Internal | DontDelete);
     4709    proto->putDirect(exec->propertyNames().constructor, func, ReadOnly | DontDelete | DontEnum);
     4710    func->putDirect(exec->propertyNames().prototype, proto, Internal | DontDelete);
    47124711
    47134712    if (named) {
    4714         functionScopeObject->put(exec, m_ident, func, Internal | ReadOnly | (exec->codeType() == EvalCode ? 0 : DontDelete));
     4713        functionScopeObject->putDirect(m_ident, func, Internal | ReadOnly | (exec->codeType() == EvalCode ? 0 : DontDelete));
    47154714        exec->popScope();
    47164715    }
Note: See TracChangeset for help on using the changeset viewer.