Ignore:
Timestamp:
Jun 4, 2010, 2:38:38 PM (15 years ago)
Author:
[email protected]
Message:

Bug 40187 - Change function signature of NativeConstructor to match NativeFunction

Reviewed by Oliver Hunt.

Mostly for consistency, but constructor & args arguments are redundant,
and this will help if we wish to be able to JIT calls to more constructors.

JavaScriptCore:

  • API/JSCallbackConstructor.cpp:

(JSC::constructJSCallback):

  • API/JSCallbackObject.h:
  • API/JSCallbackObjectFunctions.h:

(JSC::::construct):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeConstruct):

  • interpreter/Interpreter.h:
  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/ArrayConstructor.cpp:

(JSC::constructWithArrayConstructor):

  • runtime/BooleanConstructor.cpp:

(JSC::constructWithBooleanConstructor):

  • runtime/ConstructData.cpp:

(JSC::construct):

  • runtime/ConstructData.h:
  • runtime/DateConstructor.cpp:

(JSC::constructWithDateConstructor):

  • runtime/Error.cpp:

(JSC::constructNativeError):
(JSC::Error::create):

  • runtime/ErrorConstructor.cpp:

(JSC::constructWithErrorConstructor):

  • runtime/FunctionConstructor.cpp:

(JSC::constructWithFunctionConstructor):

  • runtime/NativeErrorConstructor.cpp:

(JSC::constructWithNativeErrorConstructor):

  • runtime/NativeErrorConstructor.h:

(JSC::NativeErrorConstructor::errorStructure):

  • runtime/NumberConstructor.cpp:

(JSC::constructWithNumberConstructor):

  • runtime/ObjectConstructor.cpp:

(JSC::constructWithObjectConstructor):

  • runtime/RegExpConstructor.cpp:

(JSC::constructWithRegExpConstructor):

  • runtime/StringConstructor.cpp:

(JSC::constructWithStringConstructor):

WebCore:

  • bindings/js/JSArrayBufferConstructor.cpp:

(WebCore::constructCanvasArrayBuffer):

  • bindings/js/JSAudioConstructor.cpp:

(WebCore::constructAudio):

  • bindings/js/JSEventSourceConstructor.cpp:

(WebCore::constructEventSource):

  • bindings/js/JSFloatArrayConstructor.cpp:

(WebCore::constructCanvasFloatArray):

  • bindings/js/JSImageConstructor.cpp:

(WebCore::constructImage):

  • bindings/js/JSInt16ArrayConstructor.cpp:

(WebCore::constructCanvasShortArray):

  • bindings/js/JSInt32ArrayConstructor.cpp:

(WebCore::constructCanvasIntArray):

  • bindings/js/JSInt8ArrayConstructor.cpp:

(WebCore::constructCanvasByteArray):

  • bindings/js/JSMessageChannelConstructor.cpp:

(WebCore::JSMessageChannelConstructor::construct):

  • bindings/js/JSMessageChannelConstructor.h:
  • bindings/js/JSOptionConstructor.cpp:

(WebCore::constructHTMLOptionElement):

  • bindings/js/JSSharedWorkerConstructor.cpp:

(WebCore::constructSharedWorker):

  • bindings/js/JSUint16ArrayConstructor.cpp:

(WebCore::constructCanvasUnsignedShortArray):

  • bindings/js/JSUint32ArrayConstructor.cpp:

(WebCore::constructCanvasUnsignedIntArray):

  • bindings/js/JSUint8ArrayConstructor.cpp:

(WebCore::constructCanvasUnsignedByteArray):

  • bindings/js/JSWebKitCSSMatrixConstructor.cpp:

(WebCore::constructWebKitCSSMatrix):

  • bindings/js/JSWebKitPointConstructor.cpp:

(WebCore::constructWebKitPoint):

  • bindings/js/JSWebSocketConstructor.cpp:

(WebCore::constructWebSocket):

  • bindings/js/JSWorkerConstructor.cpp:

(WebCore::constructWorker):

  • bindings/js/JSXMLHttpRequestConstructor.cpp:

(WebCore::constructXMLHttpRequest):

  • bindings/js/JSXSLTProcessorConstructor.cpp:

(WebCore::constructXSLTProcessor):

  • bindings/scripts/CodeGeneratorJS.pm:
  • bridge/runtime_object.cpp:

(JSC::Bindings::callRuntimeConstructor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSCallbackConstructor.cpp

    r59941 r60708  
    5353}
    5454
    55 static JSObject* constructJSCallback(ExecState* exec, JSObject* constructor, const ArgList& args)
     55static EncodedJSValue JSC_HOST_CALL constructJSCallback(ExecState* exec)
    5656{
     57    JSObject* constructor = exec->callee();
    5758    JSContextRef ctx = toRef(exec);
    5859    JSObjectRef constructorRef = toRef(constructor);
     
    6061    JSObjectCallAsConstructorCallback callback = static_cast<JSCallbackConstructor*>(constructor)->callback();
    6162    if (callback) {
    62         int argumentCount = static_cast<int>(args.size());
     63        int argumentCount = static_cast<int>(exec->argumentCount());
    6364        Vector<JSValueRef, 16> arguments(argumentCount);
    6465        for (int i = 0; i < argumentCount; i++)
    65             arguments[i] = toRef(exec, args.at(i));
     66            arguments[i] = toRef(exec, exec->argument(i));
    6667
    6768        JSValueRef exception = 0;
     
    7374        if (exception)
    7475            exec->setException(toJS(exec, exception));
    75         return toJS(result);
     76        return JSValue::encode(toJS(result));
    7677    }
    7778   
    78     return toJS(JSObjectMake(ctx, static_cast<JSCallbackConstructor*>(constructor)->classRef(), 0));
     79    return JSValue::encode(toJS(JSObjectMake(ctx, static_cast<JSCallbackConstructor*>(constructor)->classRef(), 0)));
    7980}
    8081
Note: See TracChangeset for help on using the changeset viewer.