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


Ignore:
Timestamp:
Apr 25, 2003, 3:47:05 PM (22 years ago)
Author:
darin
Message:

Reviewed by Maciej.

  • a couple improvements that give a 6.6% speedup on iBench JavaScript
  • kjs/nodes.cpp: (ResolveNode::evaluate): Don't use evaluateReference.
  • kjs/object.cpp: (ObjectImp::get): Do the prototype work with the ValueImp, not a wrapper. Contributes a tiny bit to the speedup, but cleaner anyway. (ObjectImp::hasProperty): Same thing here.
File:
1 edited

Legend:

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

    r3373 r4191  
    140140{
    141141  ValueImp *imp = getDirect(propertyName);
    142   if ( imp )
     142  if (imp)
    143143    return Value(imp);
    144 
    145   Object proto = Object::dynamicCast(prototype());
    146   if (proto.isNull())
    147     return Undefined();
    148144
    149145  // non-standard netscape extension
    150146  if (propertyName == specialPrototypePropertyName)
    151     return proto;
    152 
    153   return proto.get(exec,propertyName);
     147    return Value(_proto);
     148
     149  if (_proto->dispatchType() != ObjectType)
     150    return Undefined();
     151
     152  return static_cast<ObjectImp *>(_proto)->get(exec, propertyName);
    154153}
    155154
     
    224223    return true;
    225224
     225  if (_proto->dispatchType() != ObjectType)
     226    return false;
     227
    226228  // Look in the prototype
    227   Object proto = Object::dynamicCast(prototype());
    228   return !proto.isNull() && proto.hasProperty(exec,propertyName);
     229  return static_cast<ObjectImp *>(_proto)->hasProperty(exec, propertyName);
    229230}
    230231
Note: See TracChangeset for help on using the changeset viewer.