Ignore:
Timestamp:
Nov 18, 2002, 1:55:23 PM (23 years ago)
Author:
darin
Message:
  • fix worst speed problems on the sort page of the iBench JavaScript test

Sped up JavaScript iBench by 70%, the sort page by 88%.

  • kjs/array_object.h: Add array-specific sort functions.
  • kjs/array_object.cpp: (compareByStringForQSort): Added. (ArrayInstanceImp::sort): Added. (compareWithCompareFunctionForQSort): Added. (ArrayProtoFuncImp::call): Use ArrayInstanceImp::sort if the object being sorted is actually an array.
  • kjs/object.h: Add argumentsPropertyName.
  • kjs/object.cpp: Add argumentsPropertyName.
  • kjs/function.cpp: (FunctionImp::FunctionImp): Use argumentsPropertyName to avoid making a UString. (FunctionImp::call): Ditto. (ActivationImp::ActivationImp): Ditto.
  • kjs/function_object.cpp: (FunctionObjectImp::construct): Ditto.
  • kjs/ustring.h: Added compare function for -1/0/+1 comparison.
  • kjs/ustring.cpp: (KJS::compare): Added.
File:
1 edited

Legend:

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

    r2249 r2736  
    6060  Value protect(this);
    6161  //fprintf(stderr,"FunctionImp::FunctionImp this=%p\n");
    62   put(exec,"arguments",Null(),ReadOnly|DontDelete|DontEnum);
     62  put(exec,argumentsPropertyName,Null(),ReadOnly|DontDelete|DontEnum);
    6363}
    6464
     
    109109  // previous arguments object.
    110110  // Note: this does not appear to be part of the spec
    111   Value oldArgs = get(&newExec, "arguments");
     111  Value oldArgs = get(&newExec, argumentsPropertyName);
    112112
    113113  if (codeType() == FunctionCode) {
    114114    assert(ctx.activationObject().inherits(&ActivationImp::info));
    115115    Object argsObj = static_cast<ActivationImp*>(ctx.activationObject().imp())->argumentsObject();
    116     put(&newExec, "arguments", argsObj, DontDelete|DontEnum|ReadOnly);
     116    put(&newExec, argumentsPropertyName, argsObj, DontDelete|DontEnum|ReadOnly);
    117117  }
    118118
     
    128128    exec->setException(newExec.exception());
    129129  if (codeType() == FunctionCode)
    130     put(&newExec, "arguments", oldArgs, DontDelete|DontEnum|ReadOnly);
     130    put(&newExec, argumentsPropertyName, oldArgs, DontDelete|DontEnum|ReadOnly);
    131131
    132132#ifdef KJS_VERBOSE
     
    309309  Value protect(this);
    310310  arguments = new ArgumentsImp(exec,f, args);
    311   put(exec, "arguments", Object(arguments), Internal|DontDelete);
     311  put(exec, argumentsPropertyName, Object(arguments), Internal|DontDelete);
    312312}
    313313
Note: See TracChangeset for help on using the changeset viewer.