Ignore:
Timestamp:
Jul 26, 2011, 2:56:13 PM (14 years ago)
Author:
[email protected]
Message:

Refactor automatically generated JS DOM bindings to replace operator new with static create methods
https://bugs.webkit.org/show_bug.cgi?id=64732

Patch by Mark Hahnenberg <[email protected]> on 2011-07-26
Reviewed by Oliver Hunt.

Source/JavaScriptCore:

Replacing the public constructors in the automatically generated JS DOM bindings with static
create methods. JSByteArray is used by several of these bindings in WebCore.

(JSC::JSByteArray::create):

  • runtime/JSByteArray.h:

Source/WebCore:

No new tests.

Replacing the public constructors in the automatically generated JS DOM bindings in CodeGeneratorJS.pm
with static create methods. This is part of a larger refactoring effort to use static create methods
in the headers of the generated files (so as to be inline-able) in favor of public constructors throughout JSC.

  • bindings/js/JSAudioConstructor.h:

(WebCore::JSAudioConstructor::create):

  • bindings/js/JSDOMBinding.h:

(WebCore::createWrapper):

  • bindings/js/JSDOMGlobalObject.h:

(WebCore::getDOMConstructor):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::history):
(WebCore::JSDOMWindow::location):

  • bindings/js/JSDOMWindowShell.cpp:

(WebCore::JSDOMWindowShell::setWindow):

  • bindings/js/JSDocumentCustom.cpp:

(WebCore::JSDocument::location):

  • bindings/js/JSImageConstructor.h:

(WebCore::JSImageConstructor::create):

  • bindings/js/JSImageDataCustom.cpp:

(WebCore::toJS):

  • bindings/js/JSOptionConstructor.h:

(WebCore::JSOptionConstructor::create):

  • bindings/js/WorkerScriptController.cpp:

(WebCore::WorkerScriptController::initScript):

  • bindings/scripts/CodeGeneratorJS.pm:

(AddIncludesForTypeInImpl):
(AddIncludesForTypeInHeader):
(AddIncludesForType):
(GenerateHeader):
(GenerateImplementation):
(GenerateCallbackImplementation):
(GenerateConstructorDeclaration):

  • bindings/scripts/test/JS/JSTestInterface.cpp:

(WebCore::JSTestInterfaceConstructor::create):
(WebCore::JSTestInterface::createPrototype):

  • bindings/scripts/test/JS/JSTestInterface.h:

(WebCore::JSTestInterface::create):
(WebCore::JSTestInterfacePrototype::create):

  • bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:

(WebCore::JSTestMediaQueryListListenerConstructor::create):
(WebCore::JSTestMediaQueryListListener::createPrototype):

  • bindings/scripts/test/JS/JSTestMediaQueryListListener.h:

(WebCore::JSTestMediaQueryListListener::create):
(WebCore::JSTestMediaQueryListListenerPrototype::create):

  • bindings/scripts/test/JS/JSTestObj.cpp:

(WebCore::JSTestObjConstructor::create):
(WebCore::JSTestObj::createPrototype):

  • bindings/scripts/test/JS/JSTestObj.h:

(WebCore::JSTestObj::create):
(WebCore::JSTestObjPrototype::create):

  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:

(WebCore::JSTestSerializedScriptValueInterfaceConstructor::create):
(WebCore::JSTestSerializedScriptValueInterface::createPrototype):

  • bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:

(WebCore::JSTestSerializedScriptValueInterface::create):
(WebCore::JSTestSerializedScriptValueInterfacePrototype::create):

  • bridge/jni/jsc/JavaArrayJSC.cpp:

(JavaArray::convertJObjectToArray):

  • bridge/jsc/BridgeJSC.cpp:

(JSC::Bindings::Instance::newRuntimeObject):

  • bridge/objc/objc_utility.mm:

(JSC::Bindings::convertObjcValueToValue):

  • bridge/qt/qt_runtime.cpp:

(JSC::Bindings::convertQVariantToValue):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::create):

  • bridge/runtime_object.h:

(JSC::Bindings::RuntimeObject::create):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.cpp

    r84052 r91790  
    4141{
    4242    putDirect(exec->globalData(), exec->globalData().propertyNames->length, jsNumber(m_storage->length()), ReadOnly | DontDelete);
     43}
     44       
     45JSByteArray* JSByteArray::create(ExecState* exec, Structure* structure, ByteArray* storage)
     46{
     47    return new (allocateCell<JSByteArray>(*exec->heap())) JSByteArray(exec, structure, storage);
    4348}
    4449
Note: See TracChangeset for help on using the changeset viewer.