Ignore:
Timestamp:
Oct 18, 2008, 6:52:42 PM (17 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • JavaScriptCore.exp: Update entry points, since some now take JSValue* instead of const JSValue*.
  • API/APICast.h:
  • API/JSCallbackConstructor.h:
  • API/JSCallbackFunction.cpp:
  • API/JSCallbackFunction.h:
  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:
  • API/JSContextRef.cpp:
  • API/JSObjectRef.cpp:
  • API/JSValueRef.cpp:
  • VM/CTI.cpp:
  • VM/CTI.h:
  • VM/CodeBlock.cpp:
  • VM/CodeBlock.h:
  • VM/CodeGenerator.cpp:
  • VM/CodeGenerator.h:
  • VM/ExceptionHelpers.cpp:
  • VM/ExceptionHelpers.h:
  • VM/JSPropertyNameIterator.cpp:
  • VM/JSPropertyNameIterator.h:
  • VM/Machine.cpp:
  • VM/Machine.h:
  • VM/Register.h:
  • kjs/ArgList.cpp:
  • kjs/ArgList.h:
  • kjs/Arguments.cpp:
  • kjs/Arguments.h:
  • kjs/ArrayConstructor.cpp:
  • kjs/ArrayPrototype.cpp:
  • kjs/BooleanConstructor.cpp:
  • kjs/BooleanConstructor.h:
  • kjs/BooleanObject.h:
  • kjs/BooleanPrototype.cpp:
  • kjs/CallData.cpp:
  • kjs/CallData.h:
  • kjs/ConstructData.cpp:
  • kjs/ConstructData.h:
  • kjs/DateConstructor.cpp:
  • kjs/DateInstance.h:
  • kjs/DatePrototype.cpp:
  • kjs/DebuggerCallFrame.cpp:
  • kjs/DebuggerCallFrame.h:
  • kjs/ErrorConstructor.cpp:
  • kjs/ErrorPrototype.cpp:
  • kjs/ExecState.cpp:
  • kjs/ExecState.h:
  • kjs/FunctionConstructor.cpp:
  • kjs/FunctionPrototype.cpp:
  • kjs/GetterSetter.cpp:
  • kjs/GetterSetter.h:
  • kjs/InternalFunction.h:
  • kjs/JSActivation.cpp:
  • kjs/JSActivation.h:
  • kjs/JSArray.cpp:
  • kjs/JSArray.h:
  • kjs/JSCell.cpp:
  • kjs/JSCell.h:
  • kjs/JSFunction.cpp:
  • kjs/JSFunction.h:
  • kjs/JSGlobalData.h:
  • kjs/JSGlobalObject.cpp:
  • kjs/JSGlobalObject.h:
  • kjs/JSGlobalObjectFunctions.cpp:
  • kjs/JSGlobalObjectFunctions.h:
  • kjs/JSImmediate.cpp:
  • kjs/JSImmediate.h:
  • kjs/JSNotAnObject.cpp:
  • kjs/JSNotAnObject.h:
  • kjs/JSNumberCell.cpp:
  • kjs/JSNumberCell.h:
  • kjs/JSObject.cpp:
  • kjs/JSObject.h:
  • kjs/JSStaticScopeObject.cpp:
  • kjs/JSStaticScopeObject.h:
  • kjs/JSString.cpp:
  • kjs/JSString.h:
  • kjs/JSValue.h:
  • kjs/JSVariableObject.h:
  • kjs/JSWrapperObject.h:
  • kjs/MathObject.cpp:
  • kjs/NativeErrorConstructor.cpp:
  • kjs/NumberConstructor.cpp:
  • kjs/NumberConstructor.h:
  • kjs/NumberObject.cpp:
  • kjs/NumberObject.h:
  • kjs/NumberPrototype.cpp:
  • kjs/ObjectConstructor.cpp:
  • kjs/ObjectPrototype.cpp:
  • kjs/ObjectPrototype.h:
  • kjs/PropertyMap.h:
  • kjs/PropertySlot.cpp:
  • kjs/PropertySlot.h:
  • kjs/RegExpConstructor.cpp:
  • kjs/RegExpConstructor.h:
  • kjs/RegExpMatchesArray.h:
  • kjs/RegExpObject.cpp:
  • kjs/RegExpObject.h:
  • kjs/RegExpPrototype.cpp:
  • kjs/Shell.cpp:
  • kjs/StringConstructor.cpp:
  • kjs/StringObject.cpp:
  • kjs/StringObject.h:
  • kjs/StringObjectThatMasqueradesAsUndefined.h:
  • kjs/StringPrototype.cpp:
  • kjs/StructureID.cpp:
  • kjs/StructureID.h:
  • kjs/collector.cpp:
  • kjs/collector.h:
  • kjs/completion.h:
  • kjs/grammar.y:
  • kjs/interpreter.cpp:
  • kjs/interpreter.h:
  • kjs/lookup.cpp:
  • kjs/lookup.h:
  • kjs/nodes.h:
  • kjs/operations.cpp:
  • kjs/operations.h:
  • kjs/protect.h:
  • profiler/ProfileGenerator.cpp: Replace JSValue* with JSValuePtr.

JavaScriptGlue:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • JSObject.cpp:
  • JSValueWrapper.cpp:
  • UserObjectImp.cpp:
  • UserObjectImp.h: Replace JSValue* with JSValuePtr.

WebCore:

2008-10-18 Darin Adler <Darin Adler>

Reviewed by Cameron Zwarich.

Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
changing JSValuePtr to be a class, and then eventually renaming it
to JSValue once that's done.

  • bindings/js/JSAttrCustom.cpp:
  • bindings/js/JSCSSRuleCustom.cpp:
  • bindings/js/JSCSSStyleDeclarationCustom.cpp:
  • bindings/js/JSCSSValueCustom.cpp:
  • bindings/js/JSCanvasPixelArrayCustom.h:
  • bindings/js/JSCanvasRenderingContext2DCustom.cpp:
  • bindings/js/JSClipboardCustom.cpp:
  • bindings/js/JSConsoleCustom.cpp:
  • bindings/js/JSCustomSQLStatementCallback.cpp:
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp:
  • bindings/js/JSCustomSQLTransactionCallback.cpp:
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp:
  • bindings/js/JSCustomVoidCallback.cpp:
  • bindings/js/JSCustomVoidCallback.h:
  • bindings/js/JSCustomXPathNSResolver.cpp:
  • bindings/js/JSDOMApplicationCacheCustom.cpp:
  • bindings/js/JSDOMBinding.cpp:
  • bindings/js/JSDOMBinding.h:
  • bindings/js/JSDOMWindowBase.cpp:
  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSDOMWindowCustom.cpp:
  • bindings/js/JSDOMWindowCustom.h:
  • bindings/js/JSDOMWindowShell.cpp:
  • bindings/js/JSDOMWindowShell.h:
  • bindings/js/JSDatabaseCustom.cpp:
  • bindings/js/JSDocumentCustom.cpp:
  • bindings/js/JSElementCustom.cpp:
  • bindings/js/JSEventCustom.cpp:
  • bindings/js/JSEventListener.cpp:
  • bindings/js/JSEventTarget.cpp:
  • bindings/js/JSEventTargetBase.h:
  • bindings/js/JSEventTargetNodeCustom.cpp:
  • bindings/js/JSHTMLAllCollection.h:
  • bindings/js/JSHTMLAppletElementCustom.cpp:
  • bindings/js/JSHTMLCollectionCustom.cpp:
  • bindings/js/JSHTMLDocumentCustom.cpp:
  • bindings/js/JSHTMLEmbedElementCustom.cpp:
  • bindings/js/JSHTMLFormElementCustom.cpp:
  • bindings/js/JSHTMLFrameElementCustom.cpp:
  • bindings/js/JSHTMLFrameSetElementCustom.cpp:
  • bindings/js/JSHTMLIFrameElementCustom.cpp:
  • bindings/js/JSHTMLInputElementCustom.cpp:
  • bindings/js/JSHTMLObjectElementCustom.cpp:
  • bindings/js/JSHTMLOptionsCollectionCustom.cpp:
  • bindings/js/JSHTMLSelectElementCustom.cpp:
  • bindings/js/JSHTMLSelectElementCustom.h:
  • bindings/js/JSHistoryCustom.cpp:
  • bindings/js/JSImageDataCustom.cpp:
  • bindings/js/JSInspectedObjectWrapper.cpp:
  • bindings/js/JSInspectedObjectWrapper.h:
  • bindings/js/JSInspectorCallbackWrapper.cpp:
  • bindings/js/JSInspectorCallbackWrapper.h:
  • bindings/js/JSJavaScriptCallFrameCustom.cpp:
  • bindings/js/JSLocationCustom.cpp:
  • bindings/js/JSMessagePortCustom.cpp:
  • bindings/js/JSMimeTypeArrayCustom.cpp:
  • bindings/js/JSNamedNodeMapCustom.cpp:
  • bindings/js/JSNamedNodesCollection.cpp:
  • bindings/js/JSNamedNodesCollection.h:
  • bindings/js/JSNavigatorCustom.cpp:
  • bindings/js/JSNodeCustom.cpp:
  • bindings/js/JSNodeFilterCondition.cpp:
  • bindings/js/JSNodeFilterCustom.cpp:
  • bindings/js/JSNodeIteratorCustom.cpp:
  • bindings/js/JSNodeListCustom.cpp:
  • bindings/js/JSPluginArrayCustom.cpp:
  • bindings/js/JSPluginCustom.cpp:
  • bindings/js/JSPluginElementFunctions.cpp:
  • bindings/js/JSPluginElementFunctions.h:
  • bindings/js/JSQuarantinedObjectWrapper.cpp:
  • bindings/js/JSQuarantinedObjectWrapper.h:
  • bindings/js/JSRGBColor.cpp:
  • bindings/js/JSRGBColor.h:
  • bindings/js/JSSQLResultSetRowListCustom.cpp:
  • bindings/js/JSSQLTransactionCustom.cpp:
  • bindings/js/JSSVGElementInstanceCustom.cpp:
  • bindings/js/JSSVGLengthCustom.cpp:
  • bindings/js/JSSVGMatrixCustom.cpp:
  • bindings/js/JSSVGPathSegCustom.cpp:
  • bindings/js/JSSVGPathSegListCustom.cpp:
  • bindings/js/JSSVGPointListCustom.cpp:
  • bindings/js/JSSVGTransformListCustom.cpp:
  • bindings/js/JSStorageCustom.cpp:
  • bindings/js/JSStyleSheetCustom.cpp:
  • bindings/js/JSStyleSheetListCustom.cpp:
  • bindings/js/JSTextCustom.cpp:
  • bindings/js/JSTreeWalkerCustom.cpp:
  • bindings/js/JSXMLHttpRequestCustom.cpp:
  • bindings/js/JSXMLHttpRequestUploadCustom.cpp:
  • bindings/js/JSXSLTProcessorCustom.cpp:
  • bindings/js/ScheduledAction.cpp:
  • bindings/js/ScheduledAction.h:
  • bindings/js/ScriptController.cpp:
  • bindings/js/ScriptController.h:
  • bindings/objc/WebScriptObject.mm:
  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/NP_jsobject.cpp:
  • bridge/c/c_instance.cpp:
  • bridge/c/c_instance.h:
  • bridge/c/c_runtime.cpp:
  • bridge/c/c_runtime.h:
  • bridge/c/c_utility.cpp:
  • bridge/jni/jni_instance.cpp:
  • bridge/jni/jni_instance.h:
  • bridge/jni/jni_jsobject.mm:
  • bridge/jni/jni_objc.mm:
  • bridge/jni/jni_runtime.cpp:
  • bridge/jni/jni_runtime.h:
  • bridge/jni/jni_utility.cpp:
  • bridge/objc/objc_class.mm:
  • bridge/objc/objc_instance.h:
  • bridge/objc/objc_instance.mm:
  • bridge/objc/objc_runtime.h:
  • bridge/objc/objc_runtime.mm:
  • bridge/objc/objc_utility.h:
  • bridge/objc/objc_utility.mm:
  • bridge/runtime.h:
  • bridge/runtime_array.cpp:
  • bridge/runtime_array.h:
  • bridge/runtime_method.cpp:
  • bridge/runtime_method.h:
  • bridge/runtime_object.cpp:
  • bridge/runtime_object.h:
  • inspector/JavaScriptCallFrame.cpp:
  • inspector/JavaScriptCallFrame.h:
  • inspector/JavaScriptProfile.cpp:
  • inspector/JavaScriptProfileNode.cpp:
  • loader/FrameLoader.cpp:
  • loader/FrameLoader.h:
  • page/Console.cpp:
  • page/Console.h:
  • plugins/MimeTypeArray.h:
  • plugins/Plugin.h:
  • plugins/PluginArray.h:
  • xml/XMLHttpRequest.cpp: Replace JSValue* with JSValuePtr.
File:
1 edited

Legend:

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

    r37681 r37684  
    7373    unsigned storageSize = m_structureID->propertyMap().storageSize();
    7474    for (unsigned i = 0; i < storageSize; ++i) {
    75         JSValue* v = m_propertyStorage[i];
     75        JSValuePtr v = m_propertyStorage[i];
    7676        if (!v->marked())
    7777            v->mark();
     
    100100
    101101// ECMA 8.6.2.2
    102 void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue* value, PutPropertySlot& slot)
     102void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValuePtr value, PutPropertySlot& slot)
    103103{
    104104    ASSERT(value);
     
    125125   
    126126    // Check if there are any setters or getters in the prototype chain
    127     JSValue* prototype;
     127    JSValuePtr prototype;
    128128    for (JSObject* obj = this; !obj->structureID()->hasGetterSetterProperties(); obj = asObject(prototype)) {
    129129        prototype = obj->prototype();
     
    139139
    140140    for (JSObject* obj = this; ; obj = asObject(prototype)) {
    141         if (JSValue* gs = obj->getDirect(propertyName)) {
     141        if (JSValuePtr gs = obj->getDirect(propertyName)) {
    142142            if (gs->isGetterSetter()) {
    143143                JSObject* setterFunc = asGetterSetter(gs)->setter();       
     
    169169}
    170170
    171 void JSObject::put(ExecState* exec, unsigned propertyName, JSValue* value)
     171void JSObject::put(ExecState* exec, unsigned propertyName, JSValuePtr value)
    172172{
    173173    PutPropertySlot slot;
     
    175175}
    176176
    177 void JSObject::putWithAttributes(ExecState*, const Identifier& propertyName, JSValue* value, unsigned attributes)
     177void JSObject::putWithAttributes(ExecState*, const Identifier& propertyName, JSValuePtr value, unsigned attributes)
    178178{
    179179    putDirect(propertyName, value, attributes);
    180180}
    181181
    182 void JSObject::putWithAttributes(ExecState* exec, unsigned propertyName, JSValue* value, unsigned attributes)
     182void JSObject::putWithAttributes(ExecState* exec, unsigned propertyName, JSValuePtr value, unsigned attributes)
    183183{
    184184    putWithAttributes(exec, Identifier::from(exec, propertyName), value, attributes);
     
    228228}
    229229
    230 static ALWAYS_INLINE JSValue* callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)
    231 {
    232     JSValue* function = object->get(exec, propertyName);
     230static ALWAYS_INLINE JSValuePtr callDefaultValueFunction(ExecState* exec, const JSObject* object, const Identifier& propertyName)
     231{
     232    JSValuePtr function = object->get(exec, propertyName);
    233233    CallData callData;
    234234    CallType callType = function->getCallData(callData);
     
    241241        return exec->exception();
    242242
    243     JSValue* result = call(exec, function, callType, callData, const_cast<JSObject*>(object), exec->emptyList());
     243    JSValuePtr result = call(exec, function, callType, callData, const_cast<JSObject*>(object), exec->emptyList());
    244244    ASSERT(!result->isGetterSetter());
    245245    if (exec->hadException())
     
    250250}
    251251
    252 bool JSObject::getPrimitiveNumber(ExecState* exec, double& number, JSValue*& result)
     252bool JSObject::getPrimitiveNumber(ExecState* exec, double& number, JSValuePtr& result)
    253253{
    254254    result = defaultValue(exec, PreferNumber);
     
    258258
    259259// ECMA 8.6.2.6
    260 JSValue* JSObject::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
     260JSValuePtr JSObject::defaultValue(ExecState* exec, PreferredPrimitiveType hint) const
    261261{
    262262    // Must call toString first for Date objects.
    263263    if ((hint == PreferString) || (hint != PreferNumber && prototype() == exec->lexicalGlobalObject()->datePrototype())) {
    264         if (JSValue* value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))
     264        if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))
    265265            return value;
    266         if (JSValue* value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))
     266        if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))
    267267            return value;
    268268    } else {
    269         if (JSValue* value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))
     269        if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().valueOf))
    270270            return value;
    271         if (JSValue* value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))
     271        if (JSValuePtr value = callDefaultValueFunction(exec, this, exec->propertyNames().toString))
    272272            return value;
    273273    }
     
    291291void JSObject::defineGetter(ExecState* exec, const Identifier& propertyName, JSObject* getterFunction)
    292292{
    293     JSValue* object = getDirect(propertyName);
     293    JSValuePtr object = getDirect(propertyName);
    294294    if (object && object->isGetterSetter()) {
    295295        ASSERT(m_structureID->hasGetterSetterProperties());
     
    318318void JSObject::defineSetter(ExecState* exec, const Identifier& propertyName, JSObject* setterFunction)
    319319{
    320     JSValue* object = getDirect(propertyName);
     320    JSValuePtr object = getDirect(propertyName);
    321321    if (object && object->isGetterSetter()) {
    322322        ASSERT(m_structureID->hasGetterSetterProperties());
     
    343343}
    344344
    345 JSValue* JSObject::lookupGetter(ExecState*, const Identifier& propertyName)
     345JSValuePtr JSObject::lookupGetter(ExecState*, const Identifier& propertyName)
    346346{
    347347    JSObject* object = this;
    348348    while (true) {
    349         JSValue* value = object->getDirect(propertyName);
     349        JSValuePtr value = object->getDirect(propertyName);
    350350        if (value) {
    351351            if (!value->isGetterSetter())
     
    363363}
    364364
    365 JSValue* JSObject::lookupSetter(ExecState*, const Identifier& propertyName)
     365JSValuePtr JSObject::lookupSetter(ExecState*, const Identifier& propertyName)
    366366{
    367367    JSObject* object = this;
    368368    while (true) {
    369         JSValue* value = object->getDirect(propertyName);
     369        JSValuePtr value = object->getDirect(propertyName);
    370370        if (value) {
    371371            if (!value->isGetterSetter())
     
    383383}
    384384
    385 bool JSObject::hasInstance(ExecState* exec, JSValue* value, JSValue* proto)
     385bool JSObject::hasInstance(ExecState* exec, JSValuePtr value, JSValuePtr proto)
    386386{
    387387    if (!proto->isObject()) {
     
    436436double JSObject::toNumber(ExecState* exec) const
    437437{
    438     JSValue* primitive = toPrimitive(exec, PreferNumber);
     438    JSValuePtr primitive = toPrimitive(exec, PreferNumber);
    439439    if (exec->hadException()) // should be picked up soon in nodes.cpp
    440440        return 0.0;
     
    444444UString JSObject::toString(ExecState* exec) const
    445445{
    446     JSValue* primitive = toPrimitive(exec, PreferString);
     446    JSValuePtr primitive = toPrimitive(exec, PreferString);
    447447    if (exec->hadException())
    448448        return "";
     
    494494}
    495495
    496 NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValue** location)
     496NEVER_INLINE void JSObject::fillGetterPropertySlot(PropertySlot& slot, JSValuePtr* location)
    497497{
    498498    if (JSObject* getterFunction = asGetterSetter(*location)->getter())
Note: See TracChangeset for help on using the changeset viewer.