Changeset 26959 in webkit for trunk/JavaScriptCore/kjs/object.cpp


Ignore:
Timestamp:
Oct 24, 2007, 1:21:21 AM (18 years ago)
Author:
darin
Message:

Reviewed by Eric.

  • kjs/object.cpp: (KJS::JSObject::defaultValue): Get rid of a little Identifier ref/deref for what SunSpider claims is a 0.4% speedup.
File:
1 edited

Legend:

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

    r26690 r26959  
    358358JSValue* JSObject::defaultValue(ExecState* exec, JSType hint) const
    359359{
    360   Identifier firstPropertyName;
    361   Identifier secondPropertyName;
    362360  /* Prefer String for Date objects */
    363361  if ((hint == StringType) || (hint != StringType) && (hint != NumberType) && (_proto == exec->lexicalInterpreter()->builtinDatePrototype())) {
    364     firstPropertyName = exec->propertyNames().toString;
    365     secondPropertyName = exec->propertyNames().valueOf;
     362    if (JSValue* v = tryGetAndCallProperty(exec, this, exec->propertyNames().toString))
     363      return v;
     364    if (JSValue* v = tryGetAndCallProperty(exec, this, exec->propertyNames().valueOf))
     365      return v;
    366366  } else {
    367     firstPropertyName = exec->propertyNames().valueOf;
    368     secondPropertyName = exec->propertyNames().toString;
    369   }
    370 
    371   JSValue *v;
    372   if ((v = tryGetAndCallProperty(exec, this, firstPropertyName)))
    373     return v;
    374   if ((v = tryGetAndCallProperty(exec, this, secondPropertyName)))
    375     return v;
     367    if (JSValue* v = tryGetAndCallProperty(exec, this, exec->propertyNames().valueOf))
     368      return v;
     369    if (JSValue* v = tryGetAndCallProperty(exec, this, exec->propertyNames().toString))
     370      return v;
     371  }
    376372
    377373  if (exec->hadException())
Note: See TracChangeset for help on using the changeset viewer.