Ignore:
Timestamp:
Nov 1, 2007, 5:14:04 PM (18 years ago)
Author:
ggaren
Message:

JavaScriptCore:

Reviewed by Maciej Stachowiak.


In preparation for making List a simple stack-allocated Vector:

Removed all instances of List copying and/or assignment, and made List
inherit from Noncopyable.


Functions that used to return a List by copy now take List& out
parameters.


Layout tests and JS tests pass.

  • kjs/list.cpp: (KJS::List::slice): Replaced copyTail with a more generic slice alternative. (JavaScriptCore only calls slice(1), but WebCore calls slice(2)).

WebCore:

Reviewed by Maciej Stachowiak.


In preparation for making List a simple stack-allocated Vector:

Removed all instances of List copying, assignment, and/or storage.


Layout tests and JS tests pass.

  • bindings/js/kjs_window.cpp: (KJS::WindowFunc::callAsFunction): Stores a Vector of protected JSValue*'s instead of a List now. Converts to List on the fly when calling the timer function. This is slightly less efficient, but the common case is 0-2 arguments, so it's no biggie.

(HTML iBench shows no regression. PLT does not use JS timers.)


(KJS::ScheduledAction::execute): Uses the more efficient and non-copying
List::slice now.
(KJS::ScheduledAction::ScheduledAction): ditto

  • bindings/objc/WebScriptObject.mm: (getListFromNSArray): Takes a List out parameter now, to avoid copying.
File:
1 edited

Legend:

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

    r27095 r27373  
    136136            JSObject* o = element->toObject(exec);
    137137            JSValue* conversionFunction = o->get(exec, exec->propertyNames().toLocaleString);
    138             if (conversionFunction->isObject() && static_cast<JSObject*>(conversionFunction)->implementsCall())
    139                 str += static_cast<JSObject*>(conversionFunction)->call(exec, o, List())->toString(exec);
    140             else
     138            if (conversionFunction->isObject() && static_cast<JSObject*>(conversionFunction)->implementsCall()) {
     139                List args;
     140                str += static_cast<JSObject*>(conversionFunction)->call(exec, o, args)->toString(exec);
     141            } else {
    141142                // try toString() fallback
    142143                fallback = true;
     144            }
    143145        }
    144146
Note: See TracChangeset for help on using the changeset viewer.