Ignore:
Timestamp:
Dec 10, 2005, 6:06:17 PM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

Rubber stamped by Maciej.

  • did long-promised KJS renaming:

ValueImp -> JSValue
ObjectImp -> JSObject
AllocatedValueImp -> JSCell

A renaming to get a class out of the way

KJS::Bindings::JSObject -> JavaJSObject

and some other "imp-reduction" renaming

*InstanceImp -> *Instance
*ProtoFuncImp -> *ProtoFunc
*PrototypeImp -> *Prototype
ArgumentsImp -> Arguments
RuntimeArrayImp -> RuntimeArray
RuntimeMethodImp -> RuntimeMethod

  • most files and functions

WebCore:

Rubber stamped by Maciej.

  • updated for KJS class renaming
  • many files and functions
File:
1 edited

Legend:

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

    r11525 r11527  
    5959FunctionImp::FunctionImp(ExecState *exec, const Identifier &n)
    6060  : InternalFunctionImp(
    61       static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
     61      static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())
    6262      ), param(0L), ident(n)
    6363{
     
    7474}
    7575
    76 ValueImp *FunctionImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
    77 {
    78   ObjectImp *globalObj = exec->dynamicInterpreter()->globalObject();
     76JSValue *FunctionImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
     77{
     78  JSObject *globalObj = exec->dynamicInterpreter()->globalObject();
    7979
    8080  // enter a new execution context
     
    171171void FunctionImp::processParameters(ExecState *exec, const List &args)
    172172{
    173   ObjectImp *variable = exec->context().imp()->variableObject();
     173  JSObject *variable = exec->context().imp()->variableObject();
    174174
    175175#ifdef KJS_VERBOSE
     
    207207}
    208208
    209 ValueImp *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
     209JSValue *FunctionImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
    210210{
    211211  FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
     
    220220}
    221221
    222 ValueImp *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
     222JSValue *FunctionImp::lengthGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
    223223{
    224224  FunctionImp *thisObj = static_cast<FunctionImp *>(slot.slotBase());
     
    249249}
    250250
    251 void FunctionImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
     251void FunctionImp::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
    252252{
    253253    if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier() || propertyName == lengthPropertyName)
     
    313313
    314314// ECMA 13.2.2 [[Construct]]
    315 ObjectImp *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
    316 {
    317   ObjectImp *proto;
    318   ValueImp *p = get(exec,prototypePropertyName);
     315JSObject *DeclaredFunctionImp::construct(ExecState *exec, const List &args)
     316{
     317  JSObject *proto;
     318  JSValue *p = get(exec,prototypePropertyName);
    319319  if (p->isObject())
    320     proto = static_cast<ObjectImp*>(p);
     320    proto = static_cast<JSObject*>(p);
    321321  else
    322322    proto = exec->lexicalInterpreter()->builtinObjectPrototype();
    323323
    324   ObjectImp *obj(new ObjectImp(proto));
    325 
    326   ValueImp *res = call(exec,obj,args);
     324  JSObject *obj(new JSObject(proto));
     325
     326  JSValue *res = call(exec,obj,args);
    327327
    328328  if (res->isObject())
    329     return static_cast<ObjectImp *>(res);
     329    return static_cast<JSObject *>(res);
    330330  else
    331331    return obj;
     
    414414}
    415415
    416 // ------------------------------ ArgumentsImp ---------------------------------
    417 
    418 const ClassInfo ArgumentsImp::info = {"Arguments", 0, 0, 0};
     416// ------------------------------ Arguments ---------------------------------
     417
     418const ClassInfo Arguments::info = {"Arguments", 0, 0, 0};
    419419
    420420// ECMA 10.1.8
    421 ArgumentsImp::ArgumentsImp(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act)
    422 : ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype()),
     421Arguments::Arguments(ExecState *exec, FunctionImp *func, const List &args, ActivationImp *act)
     422: JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()),
    423423_activationObject(act),
    424424indexToNameMap(func, args)
     
    431431  for (; iterator != args.end(); i++, iterator++) {
    432432    if (!indexToNameMap.isMapped(Identifier::from(i))) {
    433       ObjectImp::put(exec, Identifier::from(i), *iterator, DontEnum);
    434     }
    435   }
    436 }
    437 
    438 void ArgumentsImp::mark()
    439 {
    440   ObjectImp::mark();
     433      JSObject::put(exec, Identifier::from(i), *iterator, DontEnum);
     434    }
     435  }
     436}
     437
     438void Arguments::mark()
     439{
     440  JSObject::mark();
    441441  if (_activationObject && !_activationObject->marked())
    442442    _activationObject->mark();
    443443}
    444444
    445 ValueImp *ArgumentsImp::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
    446 {
    447   ArgumentsImp *thisObj = static_cast<ArgumentsImp *>(slot.slotBase());
     445JSValue *Arguments::mappedIndexGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
     446{
     447  Arguments *thisObj = static_cast<Arguments *>(slot.slotBase());
    448448  return thisObj->_activationObject->get(exec, thisObj->indexToNameMap[propertyName]);
    449449}
    450450
    451 bool ArgumentsImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
     451bool Arguments::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
    452452{
    453453  if (indexToNameMap.isMapped(propertyName)) {
     
    456456  }
    457457
    458   return ObjectImp::getOwnPropertySlot(exec, propertyName, slot);
    459 }
    460 
    461 void ArgumentsImp::put(ExecState *exec, const Identifier &propertyName, ValueImp *value, int attr)
     458  return JSObject::getOwnPropertySlot(exec, propertyName, slot);
     459}
     460
     461void Arguments::put(ExecState *exec, const Identifier &propertyName, JSValue *value, int attr)
    462462{
    463463  if (indexToNameMap.isMapped(propertyName)) {
    464464    _activationObject->put(exec, indexToNameMap[propertyName], value, attr);
    465465  } else {
    466     ObjectImp::put(exec, propertyName, value, attr);
    467   }
    468 }
    469 
    470 bool ArgumentsImp::deleteProperty(ExecState *exec, const Identifier &propertyName)
     466    JSObject::put(exec, propertyName, value, attr);
     467  }
     468}
     469
     470bool Arguments::deleteProperty(ExecState *exec, const Identifier &propertyName)
    471471{
    472472  if (indexToNameMap.isMapped(propertyName)) {
     
    474474    return true;
    475475  } else {
    476     return ObjectImp::deleteProperty(exec, propertyName);
     476    return JSObject::deleteProperty(exec, propertyName);
    477477  }
    478478}
     
    490490}
    491491
    492 ValueImp *ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
     492JSValue *ActivationImp::argumentsGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot)
    493493{
    494494  ActivationImp *thisObj = static_cast<ActivationImp *>(slot.slotBase());
     
    509509{
    510510    // do this first so property map arguments property wins over the below
    511     if (ObjectImp::getOwnPropertySlot(exec, propertyName, slot))
     511    if (JSObject::getOwnPropertySlot(exec, propertyName, slot))
    512512        return true;
    513513
     
    524524    if (propertyName == exec->dynamicInterpreter()->argumentsIdentifier())
    525525        return false;
    526     return ObjectImp::deleteProperty(exec, propertyName);
     526    return JSObject::deleteProperty(exec, propertyName);
    527527}
    528528
     
    534534    if (_argumentsObject && !_argumentsObject->marked())
    535535        _argumentsObject->mark();
    536     ObjectImp::mark();
     536    JSObject::mark();
    537537}
    538538
    539539void ActivationImp::createArgumentsObject(ExecState *exec) const
    540540{
    541   _argumentsObject = new ArgumentsImp(exec, _function, _arguments, const_cast<ActivationImp *>(this));
     541  _argumentsObject = new Arguments(exec, _function, _arguments, const_cast<ActivationImp *>(this));
    542542}
    543543
     
    545545
    546546
    547 GlobalFuncImp::GlobalFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len)
     547GlobalFuncImp::GlobalFuncImp(ExecState *exec, FunctionPrototype *funcProto, int i, int len)
    548548  : InternalFunctionImp(funcProto), id(i)
    549549{
     
    561561}
    562562
    563 static ValueImp *encode(ExecState *exec, const List &args, const char *do_not_escape)
     563static JSValue *encode(ExecState *exec, const List &args, const char *do_not_escape)
    564564{
    565565  UString r = "", s, str = args[0]->toString(exec);
     
    579579}
    580580
    581 static ValueImp *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
     581static JSValue *decode(ExecState *exec, const List &args, const char *do_not_unescape, bool strict)
    582582{
    583583  UString s = "", str = args[0]->toString(exec);
     
    748748}
    749749
    750 ValueImp *GlobalFuncImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
    751 {
    752   ValueImp *res = jsUndefined();
     750JSValue *GlobalFuncImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
     751{
     752  JSValue *res = jsUndefined();
    753753
    754754  static const char do_not_escape[] =
     
    773773  switch (id) {
    774774    case Eval: { // eval()
    775       ValueImp *x = args[0];
     775      JSValue *x = args[0];
    776776      if (!x->isString())
    777777        return x;
     
    797797
    798798        // enter a new execution context
    799         ObjectImp *thisVal = static_cast<ObjectImp *>(exec->context().thisValue());
     799        JSObject *thisVal = static_cast<JSObject *>(exec->context().thisValue());
    800800        ContextImp ctx(exec->dynamicInterpreter()->globalObject(),
    801801                       exec->dynamicInterpreter()->imp(),
Note: See TracChangeset for help on using the changeset viewer.