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/function.cpp

    r29818 r30040  
    282282// ECMA 10.1.8
    283283Arguments::Arguments(ExecState* exec, FunctionImp* func, const List& args, ActivationImp* act)
    284 : JSObject(exec->lexicalGlobalObject()->objectPrototype()),
    285 _activationObject(act),
    286 indexToNameMap(func, args)
    287 {
    288   putDirect(exec->propertyNames().callee, func, DontEnum);
    289   putDirect(exec->propertyNames().length, args.size(), DontEnum);
    290  
    291   int i = 0;
    292   List::const_iterator end = args.end();
    293   for (List::const_iterator it = args.begin(); it != end; ++it, ++i) {
    294     if (!indexToNameMap.isMapped(Identifier::from(i))) {
    295       JSObject::put(exec, Identifier::from(i), *it, DontEnum);
    296     }
    297   }
     284    : JSObject(exec->lexicalGlobalObject()->objectPrototype())
     285    , _activationObject(act)
     286    , indexToNameMap(func, args)
     287{
     288    putDirect(exec->propertyNames().callee, func, DontEnum);
     289    putDirect(exec->propertyNames().length, args.size(), DontEnum);
     290 
     291    int i = 0;
     292    List::const_iterator end = args.end();
     293    for (List::const_iterator it = args.begin(); it != end; ++it, ++i) {
     294        Identifier name = Identifier::from(i);
     295        if (!indexToNameMap.isMapped(name))
     296            putDirect(name, *it, DontEnum);
     297    }
    298298}
    299299
     
    867867{
    868868    ASSERT_ARG(function, function);
    869     put(exec, exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
     869    putDirect(exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
    870870}
    871871
     
    875875{
    876876    ASSERT_ARG(function, function);
    877     put(exec, exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
     877    putDirect(exec->propertyNames().length, jsNumber(len), DontDelete | ReadOnly | DontEnum);
    878878}
    879879
Note: See TracChangeset for help on using the changeset viewer.