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

    r27027 r27373  
    138138      callThis = thisArg->toObject(exec);
    139139
    140     result = func->call(exec,callThis,args.copyTail());
     140    List argsTail;
     141    args.slice(1, argsTail);
     142    result = func->call(exec, callThis, argsTail);
    141143    }
    142144    break;
Note: See TracChangeset for help on using the changeset viewer.