• oliver@apple.com's avatar
    Move typed array implementations into wtf · 9ce01c6f
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=73248
    
    Reviewed by Sam Weinig.
    
    Source/JavaScriptCore:
    
    Move typed array implementation files from WebCore to wtf.  Inline the
    .cpp files for each of the array views to cut down on unnecessary exports
    and function call overhead for trivial operations.
    
    Added files to all the project files.
    
    * GNUmakefile.list.am:
    * JavaScriptCore.exp:
    * JavaScriptCore.vcproj/WTF/WTF.vcproj:
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * wtf/ArrayBuffer.cpp: Renamed from Source/WebCore/html/canvas/Float32Array.cpp.
    (WTF::ArrayBuffer::transfer):
    (WTF::ArrayBuffer::addView):
    (WTF::ArrayBuffer::removeView):
    * wtf/ArrayBuffer.h: Renamed from Source/WebCore/html/canvas/ArrayBuffer.cpp.
    (WTF::ArrayBufferContents::ArrayBufferContents):
    (WTF::ArrayBufferContents::data):
    (WTF::ArrayBufferContents::sizeInBytes):
    (WTF::ArrayBufferContents::transfer):
    (WTF::ArrayBuffer::~ArrayBuffer):
    (WTF::ArrayBuffer::clampValue):
    (WTF::ArrayBuffer::create):
    (WTF::ArrayBuffer::ArrayBuffer):
    (WTF::ArrayBuffer::data):
    (WTF::ArrayBuffer::byteLength):
    (WTF::ArrayBuffer::slice):
    (WTF::ArrayBuffer::sliceImpl):
    (WTF::ArrayBuffer::clampIndex):
    (WTF::ArrayBufferContents::tryAllocate):
    (WTF::ArrayBufferContents::~ArrayBufferContents):
    * wtf/ArrayBufferView.cpp: Copied from Source/WebCore/bindings/js/JSArrayBufferCustom.cpp.
    (WTF::ArrayBufferView::ArrayBufferView):
    (WTF::ArrayBufferView::~ArrayBufferView):
    (WTF::ArrayBufferView::neuter):
    * wtf/ArrayBufferView.h: Renamed from Source/WebCore/html/canvas/ArrayBufferView.h.
    (WTF::ArrayBufferView::isByteArray):
    (WTF::ArrayBufferView::isUnsignedByteArray):
    (WTF::ArrayBufferView::isShortArray):
    (WTF::ArrayBufferView::isUnsignedShortArray):
    (WTF::ArrayBufferView::isIntArray):
    (WTF::ArrayBufferView::isUnsignedIntArray):
    (WTF::ArrayBufferView::isFloatArray):
    (WTF::ArrayBufferView::isDoubleArray):
    (WTF::ArrayBufferView::isDataView):
    (WTF::ArrayBufferView::buffer):
    (WTF::ArrayBufferView::baseAddress):
    (WTF::ArrayBufferView::byteOffset):
    (WTF::ArrayBufferView::verifySubRange):
    (WTF::ArrayBufferView::clampOffsetAndNumElements):
    (WTF::ArrayBufferView::setImpl):
    (WTF::ArrayBufferView::setRangeImpl):
    (WTF::ArrayBufferView::zeroRangeImpl):
    (WTF::ArrayBufferView::calculateOffsetAndLength):
    * wtf/CMakeLists.txt:
    * wtf/Float32Array.h: Renamed from Source/WebCore/html/canvas/Float32Array.h.
    (WTF::Float32Array::set):
    (WTF::Float32Array::item):
    (WTF::Float32Array::isFloatArray):
    (WTF::Float32Array::create):
    (WTF::Float32Array::Float32Array):
    (WTF::Float32Array::subarray):
    * wtf/Float64Array.h: Renamed from Source/WebCore/html/canvas/Float64Array.h.
    (WTF::Float64Array::set):
    (WTF::Float64Array::item):
    (WTF::Float64Array::isDoubleArray):
    (WTF::Float64Array::create):
    (WTF::Float64Array::Float64Array):
    (WTF::Float64Array::subarray):
    * wtf/Int16Array.h: Renamed from Source/WebCore/html/canvas/Int16Array.cpp.
    (WTF::Int16Array::set):
    (WTF::Int16Array::isShortArray):
    (WTF::Int16Array::create):
    (WTF::Int16Array::Int16Array):
    (WTF::Int16Array::subarray):
    * wtf/Int32Array.h: Renamed from Source/WebCore/html/canvas/Int32Array.cpp.
    (WTF::Int32Array::set):
    (WTF::Int32Array::isIntArray):
    (WTF::Int32Array::create):
    (WTF::Int32Array::Int32Array):
    (WTF::Int32Array::subarray):
    * wtf/Int8Array.h: Renamed from Source/WebCore/html/canvas/Int8Array.cpp.
    (WTF::Int8Array::set):
    (WTF::Int8Array::isByteArray):
    (WTF::Int8Array::create):
    (WTF::Int8Array::Int8Array):
    (WTF::Int8Array::subarray):
    * wtf/IntegralTypedArrayBase.h: Renamed from Source/WebCore/html/canvas/IntegralTypedArrayBase.h.
    (WTF::IntegralTypedArrayBase::set):
    (WTF::IntegralTypedArrayBase::item):
    (WTF::IntegralTypedArrayBase::IntegralTypedArrayBase):
    * wtf/TypedArrayBase.h: Renamed from Source/WebCore/html/canvas/TypedArrayBase.h.
    (WTF::TypedArrayBase::data):
    (WTF::TypedArrayBase::set):
    (WTF::TypedArrayBase::setRange):
    (WTF::TypedArrayBase::zeroRange):
    (WTF::TypedArrayBase::length):
    (WTF::TypedArrayBase::byteLength):
    (WTF::TypedArrayBase::TypedArrayBase):
    (WTF::TypedArrayBase::create):
    (WTF::TypedArrayBase::subarrayImpl):
    * wtf/Uint16Array.h: Renamed from Source/WebCore/html/canvas/Uint16Array.cpp.
    (WTF::Uint16Array::set):
    (WTF::Uint16Array::isUnsignedShortArray):
    (WTF::Uint16Array::create):
    (WTF::Uint16Array::Uint16Array):
    (WTF::Uint16Array::subarray):
    * wtf/Uint32Array.h: Renamed from Source/WebCore/html/canvas/Uint32Array.cpp.
    (WTF::Uint32Array::set):
    (WTF::Uint32Array::isUnsignedIntArray):
    (WTF::Uint32Array::create):
    (WTF::Uint32Array::Uint32Array):
    (WTF::Uint32Array::subarray):
    * wtf/Uint8Array.h: Renamed from Source/WebCore/html/canvas/Uint8Array.h.
    (WTF::Uint8Array::set):
    (WTF::Uint8Array::isUnsignedByteArray):
    (WTF::Uint8Array::create):
    (WTF::Uint8Array::Uint8Array):
    (WTF::Uint8Array::subarray):
    * wtf/wtf.pro:
    
    Source/WebCore:
    
    Removed the typed array implementation files from WebCore and
    added forwarding headers.
    
    * CMakeLists.txt:
    * ForwardingHeaders/wtf/ArrayBuffer.h: Added.
    * ForwardingHeaders/wtf/ArrayBufferView.h: Added.
    * ForwardingHeaders/wtf/Float32Array.h: Added.
    * ForwardingHeaders/wtf/Float64Array.h: Added.
    * ForwardingHeaders/wtf/Int16Array.h: Added.
    * ForwardingHeaders/wtf/Int32Array.h: Added.
    * ForwardingHeaders/wtf/Int8Array.h: Added.
    * ForwardingHeaders/wtf/Uint16Array.h: Added.
    * ForwardingHeaders/wtf/Uint32Array.h: Added.
    * ForwardingHeaders/wtf/Uint8Array.h: Added.
    * GNUmakefile.list.am:
    * Target.pri:
    * WebCore.vcproj/WebCore.vcproj:
    * WebCore.xcodeproj/project.pbxproj:
    * bindings/js/JSArrayBufferCustom.cpp:
    * bindings/js/JSArrayBufferViewHelper.h:
    * bindings/js/JSAudioContextCustom.cpp:
    * bindings/js/JSFileReaderCustom.cpp:
    * bindings/js/JSFloat32ArrayCustom.cpp:
    * bindings/js/JSFloat64ArrayCustom.cpp:
    * bindings/js/JSInt16ArrayCustom.cpp:
    * bindings/js/JSInt32ArrayCustom.cpp:
    * bindings/js/JSInt8ArrayCustom.cpp:
    * bindings/js/JSUint16ArrayCustom.cpp:
    * bindings/js/JSUint32ArrayCustom.cpp:
    * bindings/js/JSUint8ArrayCustom.cpp:
    * bindings/js/JSWaveShaperNodeCustom.cpp:
    * bindings/js/JSWebGLRenderingContextCustom.cpp:
    * bindings/js/JSXMLHttpRequestCustom.cpp:
    * bindings/scripts/CodeGeneratorJS.pm:
    (AddIncludesForType):
    (GenerateHeader):
    (NativeToJSValue):
    * bindings/scripts/test/JS/JSFloat64Array.cpp:
    * bindings/scripts/test/JS/JSFloat64Array.h:
    * dom/MessageEvent.h:
    * fileapi/FileReader.cpp:
    * fileapi/FileReaderLoader.cpp:
    * fileapi/FileReaderSync.cpp:
    * fileapi/WebKitBlobBuilder.cpp:
    * html/HTMLMediaElement.cpp:
    * html/canvas/ArrayBuffer.h: Removed.
    * html/canvas/ArrayBufferView.cpp: Removed.
    * html/canvas/DataView.h:
    * html/canvas/Float64Array.cpp: Removed.
    * html/canvas/Int16Array.h: Removed.
    * html/canvas/Int32Array.h: Removed.
    * html/canvas/Int8Array.h: Removed.
    * html/canvas/Uint16Array.h: Removed.
    * html/canvas/Uint32Array.h: Removed.
    * html/canvas/Uint8Array.cpp: Removed.
    * html/canvas/WebGLBuffer.cpp:
    * html/canvas/WebGLBuffer.h:
    * html/canvas/WebGLGetInfo.cpp:
    * html/canvas/WebGLGetInfo.h:
    * html/canvas/WebGLRenderingContext.cpp:
    * html/canvas/WebGLRenderingContext.h:
    * page/Crypto.cpp:
    * platform/graphics/GraphicsContext3D.cpp:
    * platform/graphics/mac/GraphicsContext3DMac.mm:
    * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
    * webaudio/AsyncAudioDecoder.cpp:
    * webaudio/AudioBuffer.h:
    * webaudio/AudioContext.cpp:
    * webaudio/AudioParam.h:
    * webaudio/AudioParamTimeline.h:
    * webaudio/JavaScriptAudioNode.cpp:
    * webaudio/RealtimeAnalyser.cpp:
    * webaudio/WaveShaperProcessor.h:
    * websockets/WebSocketChannel.cpp:
    * websockets/WorkerThreadableWebSocketChannel.cpp:
    * xml/XMLHttpRequest.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    9ce01c6f
Crypto.cpp 2.33 KB