Ignore:
Timestamp:
Jun 15, 2008, 7:19:08 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-06-15 Darin Adler <Darin Adler>

Rubber stamped by Sam.

  • use JS prefix and simpler names for basic JavaScriptCore types, to complement JSValue and JSObject
  • JavaScriptCore.exp:
  • VM/Machine.cpp: (KJS::jsLess): (KJS::jsLessEq): (KJS::jsAdd): (KJS::callEval): (KJS::Machine::execute): (KJS::Machine::retrieveArguments): (KJS::Machine::retrieveCaller): (KJS::Machine::getCallFrame): (KJS::Machine::getFunctionAndArguments):
  • VM/Machine.h:
  • VM/Register.h:
  • kjs/DebuggerCallFrame.cpp: (KJS::DebuggerCallFrame::functionName):
  • kjs/ExecState.h:
  • kjs/JSActivation.cpp: (KJS::JSActivation::createArgumentsObject):
  • kjs/array_instance.cpp: (KJS::): (KJS::JSArray::checkConsistency): (KJS::JSArray::JSArray): (KJS::JSArray::~JSArray): (KJS::JSArray::getItem): (KJS::JSArray::lengthGetter): (KJS::JSArray::inlineGetOwnPropertySlot): (KJS::JSArray::getOwnPropertySlot): (KJS::JSArray::put): (KJS::JSArray::deleteProperty): (KJS::JSArray::getPropertyNames): (KJS::JSArray::increaseVectorLength): (KJS::JSArray::setLength): (KJS::JSArray::mark): (KJS::JSArray::sort): (KJS::JSArray::compactForSorting): (KJS::JSArray::lazyCreationData): (KJS::JSArray::setLazyCreationData):
  • kjs/array_instance.h:
  • kjs/array_object.cpp: (KJS::): (KJS::ArrayPrototype::ArrayPrototype): (KJS::ArrayPrototype::getOwnPropertySlot): (KJS::arrayProtoFuncToString): (KJS::arrayProtoFuncToLocaleString): (KJS::arrayProtoFuncConcat): (KJS::arrayProtoFuncSort): (KJS::ArrayObjectImp::construct):
  • kjs/array_object.h:
  • kjs/completion.h:
  • kjs/function.cpp: (KJS::): (KJS::JSFunction::JSFunction): (KJS::JSFunction::mark): (KJS::JSFunction::getCallData): (KJS::JSFunction::callAsFunction): (KJS::JSFunction::argumentsGetter): (KJS::JSFunction::callerGetter): (KJS::JSFunction::lengthGetter): (KJS::JSFunction::getOwnPropertySlot): (KJS::JSFunction::put): (KJS::JSFunction::deleteProperty): (KJS::JSFunction::getParameterName): (KJS::JSFunction::getConstructData): (KJS::JSFunction::construct): (KJS::IndexToNameMap::IndexToNameMap): (KJS::Arguments::Arguments):
  • kjs/function.h:
  • kjs/function_object.cpp: (KJS::functionProtoFuncToString): (KJS::functionProtoFuncApply): (KJS::FunctionObjectImp::construct):
  • kjs/internal.cpp: (KJS::JSString::toPrimitive): (KJS::JSString::getPrimitiveNumber): (KJS::JSString::toBoolean): (KJS::JSString::toNumber): (KJS::JSString::toString): (KJS::StringInstance::create): (KJS::JSString::toObject): (KJS::JSString::toThisObject): (KJS::JSString::lengthGetter): (KJS::JSString::indexGetter): (KJS::JSString::indexNumericPropertyGetter): (KJS::JSString::getOwnPropertySlot): (KJS::JSNumberCell::type): (KJS::JSNumberCell::toPrimitive): (KJS::JSNumberCell::getPrimitiveNumber): (KJS::JSNumberCell::toBoolean): (KJS::JSNumberCell::toNumber): (KJS::JSNumberCell::toString): (KJS::JSNumberCell::toObject): (KJS::JSNumberCell::toThisObject): (KJS::JSNumberCell::getUInt32): (KJS::JSNumberCell::getTruncatedInt32): (KJS::JSNumberCell::getTruncatedUInt32): (KJS::GetterSetter::mark): (KJS::GetterSetter::toPrimitive): (KJS::GetterSetter::getPrimitiveNumber): (KJS::GetterSetter::toBoolean): (KJS::GetterSetter::toNumber): (KJS::GetterSetter::toString): (KJS::GetterSetter::toObject): (KJS::GetterSetter::getOwnPropertySlot): (KJS::GetterSetter::put): (KJS::GetterSetter::toThisObject):
  • kjs/internal.h: (KJS::JSString::JSString): (KJS::JSString::getStringPropertySlot):
  • kjs/nodes.cpp: (KJS::FuncDeclNode::makeFunction): (KJS::FuncExprNode::makeFunction):
  • kjs/nodes.h:
  • kjs/object.cpp: (KJS::JSObject::put): (KJS::JSObject::deleteProperty): (KJS::JSObject::defineGetter): (KJS::JSObject::defineSetter): (KJS::JSObject::lookupGetter): (KJS::JSObject::lookupSetter): (KJS::JSObject::fillGetterPropertySlot):
  • kjs/object.h: (KJS::): (KJS::GetterSetter::GetterSetter):
  • kjs/operations.cpp: (KJS::equal): (KJS::strictEqual):
  • kjs/property_map.cpp: (KJS::PropertyMap::containsGettersOrSetters):
  • kjs/regexp_object.cpp: (KJS::RegExpMatchesArray::getOwnPropertySlot): (KJS::RegExpMatchesArray::put): (KJS::RegExpMatchesArray::deleteProperty): (KJS::RegExpMatchesArray::getPropertyNames): (KJS::RegExpMatchesArray::RegExpMatchesArray): (KJS::RegExpMatchesArray::fillArrayInstance):
  • kjs/string_object.cpp: (KJS::StringInstance::StringInstance): (KJS::replace): (KJS::stringProtoFuncReplace): (KJS::stringProtoFuncToLowerCase): (KJS::stringProtoFuncToUpperCase): (KJS::stringProtoFuncToLocaleLowerCase): (KJS::stringProtoFuncToLocaleUpperCase):
  • kjs/string_object.h: (KJS::StringInstance::internalValue):
  • kjs/value.cpp: (KJS::JSCell::getNumber): (KJS::JSCell::getString): (KJS::JSCell::getObject): (KJS::jsString): (KJS::jsOwnedString):
  • kjs/value.h: (KJS::JSNumberCell::JSNumberCell): (KJS::jsNumberCell): (KJS::JSValue::uncheckedGetNumber):
  • profiler/Profiler.cpp: (KJS::createCallIdentifier): (KJS::createCallIdentifierFromFunctionImp):

WebCore:

2008-06-15 Darin Adler <Darin Adler>

Rubber stamped by Sam.

  • use JS prefix and simpler names for basic JavaScriptCore types, to complement JSValue and JSObject
  • bindings/js/JSNavigatorCustom.cpp: (WebCore::needsYouTubeQuirk):
  • bindings/js/kjs_events.cpp: (WebCore::JSLazyEventListener::parseCode):
  • bridge/jni/jni_utility.cpp: (KJS::Bindings::convertArrayInstanceToJavaArray): (KJS::Bindings::convertValueToJValue):
  • bridge/qt/qt_runtime.cpp: (KJS::Bindings::valueRealType): (KJS::Bindings::convertValueToQVariant): (KJS::Bindings::QtConnectionObject::execute):
  • bridge/runtime_array.cpp:

WebKit/mac:

2008-06-15 Darin Adler <Darin Adler>

Rubber stamped by Sam.

  • use JS prefix and simpler names for basic JavaScriptCore types, to complement JSValue and JSObject
  • WebView/WebView.mm: (aeDescFromJSValue):

WebKit/win:

2008-06-15 Darin Adler <Darin Adler>

Rubber stamped by Sam.

  • use JS prefix and simpler names for basic JavaScriptCore types, to complement JSValue and JSObject
  • WebScriptCallFrame.cpp: (WebScriptCallFrame::functionName):

WebKitTools:

2008-06-15 Darin Adler <Darin Adler>

  • Scripts/do-webcore-rename: Updated for the latest round of renaming.
File:
1 edited

Legend:

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

    r34518 r34578  
    5050namespace KJS {
    5151
    52 // ------------------------------ StringImp ------------------------------------
    53 
    54 JSValue* StringImp::toPrimitive(ExecState*, JSType) const
    55 {
    56   return const_cast<StringImp*>(this);
    57 }
    58 
    59 bool StringImp::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
     52// ------------------------------ JSString ------------------------------------
     53
     54JSValue* JSString::toPrimitive(ExecState*, JSType) const
     55{
     56  return const_cast<JSString*>(this);
     57}
     58
     59bool JSString::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
    6060{
    6161    value = this;
     
    6464}
    6565
    66 bool StringImp::toBoolean(ExecState*) const
     66bool JSString::toBoolean(ExecState*) const
    6767{
    6868    return !m_value.isEmpty();
    6969}
    7070
    71 double StringImp::toNumber(ExecState*) const
     71double JSString::toNumber(ExecState*) const
    7272{
    7373    return m_value.toDouble();
    7474}
    7575
    76 UString StringImp::toString(ExecState*) const
     76UString JSString::toString(ExecState*) const
    7777{
    7878    return m_value;
    7979}
    8080
    81 inline StringInstance* StringInstance::create(ExecState* exec, StringImp* string)
     81inline StringInstance* StringInstance::create(ExecState* exec, JSString* string)
    8282{
    8383    return new StringInstance(exec->lexicalGlobalObject()->stringPrototype(), string);
    8484}
    8585
    86 JSObject* StringImp::toObject(ExecState* exec) const
    87 {
    88     return StringInstance::create(exec, const_cast<StringImp*>(this));
    89 }
    90 
    91 JSObject* StringImp::toThisObject(ExecState* exec) const
    92 {
    93     return StringInstance::create(exec, const_cast<StringImp*>(this));
    94 }
    95 
    96 JSValue* StringImp::lengthGetter(ExecState*, const Identifier&, const PropertySlot& slot)
    97 {
    98     return jsNumber(static_cast<StringImp*>(slot.slotBase())->value().size());
    99 }
    100 
    101 JSValue* StringImp::indexGetter(ExecState*, const Identifier&, const PropertySlot& slot)
    102 {
    103     return jsString(static_cast<StringImp*>(slot.slotBase())->value().substr(slot.index(), 1));
    104 }
    105 
    106 JSValue* StringImp::indexNumericPropertyGetter(ExecState*, unsigned index, const PropertySlot& slot)
    107 {
    108     return jsString(static_cast<StringImp*>(slot.slotBase())->value().substr(index, 1));
    109 }
    110 
    111 bool StringImp::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
     86JSObject* JSString::toObject(ExecState* exec) const
     87{
     88    return StringInstance::create(exec, const_cast<JSString*>(this));
     89}
     90
     91JSObject* JSString::toThisObject(ExecState* exec) const
     92{
     93    return StringInstance::create(exec, const_cast<JSString*>(this));
     94}
     95
     96JSValue* JSString::lengthGetter(ExecState*, const Identifier&, const PropertySlot& slot)
     97{
     98    return jsNumber(static_cast<JSString*>(slot.slotBase())->value().size());
     99}
     100
     101JSValue* JSString::indexGetter(ExecState*, const Identifier&, const PropertySlot& slot)
     102{
     103    return jsString(static_cast<JSString*>(slot.slotBase())->value().substr(slot.index(), 1));
     104}
     105
     106JSValue* JSString::indexNumericPropertyGetter(ExecState*, unsigned index, const PropertySlot& slot)
     107{
     108    return jsString(static_cast<JSString*>(slot.slotBase())->value().substr(index, 1));
     109}
     110
     111bool JSString::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
    112112{
    113113    // The semantics here are really getPropertySlot, not getOwnPropertySlot.
     
    131131}
    132132
    133 bool StringImp::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
     133bool JSString::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot)
    134134{
    135135    // The semantics here are really getPropertySlot, not getOwnPropertySlot.
     
    137137    if (getStringPropertySlot(propertyName, slot))
    138138        return true;
    139     return StringImp::getOwnPropertySlot(exec, Identifier::from(propertyName), slot);
    140 }
    141 
    142 // ------------------------------ NumberImp ------------------------------------
    143 
    144 JSType NumberImp::type() const
     139    return JSString::getOwnPropertySlot(exec, Identifier::from(propertyName), slot);
     140}
     141
     142// ------------------------------ JSNumberCell ------------------------------------
     143
     144JSType JSNumberCell::type() const
    145145{
    146146    return NumberType;
    147147}
    148148
    149 JSValue* NumberImp::toPrimitive(ExecState*, JSType) const
    150 {
    151     return const_cast<NumberImp*>(this);
    152 }
    153 
    154 bool NumberImp::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
     149JSValue* JSNumberCell::toPrimitive(ExecState*, JSType) const
     150{
     151    return const_cast<JSNumberCell*>(this);
     152}
     153
     154bool JSNumberCell::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
    155155{
    156156    number = val;
     
    159159}
    160160
    161 bool NumberImp::toBoolean(ExecState *) const
     161bool JSNumberCell::toBoolean(ExecState *) const
    162162{
    163163  return val < 0.0 || val > 0.0; // false for NaN
    164164}
    165165
    166 double NumberImp::toNumber(ExecState *) const
     166double JSNumberCell::toNumber(ExecState *) const
    167167{
    168168  return val;
    169169}
    170170
    171 UString NumberImp::toString(ExecState *) const
     171UString JSNumberCell::toString(ExecState *) const
    172172{
    173173  if (val == 0.0) // +0.0 or -0.0
     
    176176}
    177177
    178 JSObject *NumberImp::toObject(ExecState *exec) const
     178JSObject *JSNumberCell::toObject(ExecState *exec) const
    179179{
    180180  List args;
    181   args.append(const_cast<NumberImp*>(this));
     181  args.append(const_cast<JSNumberCell*>(this));
    182182  return static_cast<JSObject *>(exec->lexicalGlobalObject()->numberConstructor()->construct(exec,args));
    183183}
    184184
    185 JSObject* NumberImp::toThisObject(ExecState* exec) const
     185JSObject* JSNumberCell::toThisObject(ExecState* exec) const
    186186{
    187187    List args;
    188     args.append(const_cast<NumberImp*>(this));
     188    args.append(const_cast<JSNumberCell*>(this));
    189189    return static_cast<JSObject*>(exec->lexicalGlobalObject()->numberConstructor()->construct(exec, args));
    190190}
    191191
    192 bool NumberImp::getUInt32(uint32_t& uint32) const
     192bool JSNumberCell::getUInt32(uint32_t& uint32) const
    193193{
    194194    uint32 = static_cast<uint32_t>(val);
     
    196196}
    197197
    198 bool NumberImp::getTruncatedInt32(int32_t& int32) const
     198bool JSNumberCell::getTruncatedInt32(int32_t& int32) const
    199199{
    200200    if (!(val >= -2147483648.0 && val < 2147483648.0))
     
    204204}
    205205
    206 bool NumberImp::getTruncatedUInt32(uint32_t& uint32) const
     206bool JSNumberCell::getTruncatedUInt32(uint32_t& uint32) const
    207207{
    208208    if (!(val >= 0.0 && val < 4294967296.0))
     
    212212}
    213213
    214 // --------------------------- GetterSetterImp ---------------------------------
    215 void GetterSetterImp::mark()
     214// --------------------------- GetterSetter ---------------------------------
     215void GetterSetter::mark()
    216216{
    217217    JSCell::mark();
     
    223223}
    224224
    225 JSValue* GetterSetterImp::toPrimitive(ExecState*, JSType) const
     225JSValue* GetterSetter::toPrimitive(ExecState*, JSType) const
    226226{
    227227    ASSERT(false);
     
    229229}
    230230
    231 bool GetterSetterImp::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
     231bool GetterSetter::getPrimitiveNumber(ExecState*, double& number, JSValue*& value)
    232232{
    233233    ASSERT_NOT_REACHED();
     
    237237}
    238238
    239 bool GetterSetterImp::toBoolean(ExecState*) const
    240 {
    241     ASSERT(false);
    242     return false;
    243 }
    244 
    245 double GetterSetterImp::toNumber(ExecState *) const
     239bool GetterSetter::toBoolean(ExecState*) const
     240{
     241    ASSERT(false);
     242    return false;
     243}
     244
     245double GetterSetter::toNumber(ExecState *) const
    246246{
    247247    ASSERT(false);
     
    249249}
    250250
    251 UString GetterSetterImp::toString(ExecState *) const
     251UString GetterSetter::toString(ExecState *) const
    252252{
    253253    ASSERT(false);
     
    255255}
    256256
    257 JSObject *GetterSetterImp::toObject(ExecState *exec) const
     257JSObject *GetterSetter::toObject(ExecState *exec) const
    258258{
    259259    ASSERT(false);
     
    261261}
    262262
    263 bool GetterSetterImp::getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&)
    264 {
    265     ASSERT_NOT_REACHED();
    266     return false;
    267 }
    268 
    269 bool GetterSetterImp::getOwnPropertySlot(ExecState*, unsigned, PropertySlot&)
    270 {
    271     ASSERT_NOT_REACHED();
    272     return false;
    273 }
    274 
    275 void GetterSetterImp::put(ExecState*, const Identifier&, JSValue*)
    276 {
    277     ASSERT_NOT_REACHED();
    278 }
    279 
    280 void GetterSetterImp::put(ExecState*, unsigned, JSValue*)
    281 {
    282     ASSERT_NOT_REACHED();
    283 }
    284 
    285 JSObject* GetterSetterImp::toThisObject(ExecState*) const
     263bool GetterSetter::getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&)
     264{
     265    ASSERT_NOT_REACHED();
     266    return false;
     267}
     268
     269bool GetterSetter::getOwnPropertySlot(ExecState*, unsigned, PropertySlot&)
     270{
     271    ASSERT_NOT_REACHED();
     272    return false;
     273}
     274
     275void GetterSetter::put(ExecState*, const Identifier&, JSValue*)
     276{
     277    ASSERT_NOT_REACHED();
     278}
     279
     280void GetterSetter::put(ExecState*, unsigned, JSValue*)
     281{
     282    ASSERT_NOT_REACHED();
     283}
     284
     285JSObject* GetterSetter::toThisObject(ExecState*) const
    286286{
    287287    ASSERT_NOT_REACHED();
Note: See TracChangeset for help on using the changeset viewer.