Commit df606084 authored by oliver@apple.com's avatar oliver@apple.com

Move TypedArray implementation into JSC

https://bugs.webkit.org/show_bug.cgi?id=119489

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Move TypedArray implementation into JSC in advance of re-implementation

* GNUmakefile.list.am:
* JSCTypedArrayStubs.h:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/ArrayBuffer.cpp: Renamed from Source/WTF/wtf/ArrayBuffer.cpp.
(JSC::ArrayBuffer::transfer):
(JSC::ArrayBuffer::addView):
(JSC::ArrayBuffer::removeView):
* runtime/ArrayBuffer.h: Renamed from Source/WTF/wtf/ArrayBuffer.h.
(JSC::ArrayBufferContents::ArrayBufferContents):
(JSC::ArrayBufferContents::data):
(JSC::ArrayBufferContents::sizeInBytes):
(JSC::ArrayBufferContents::transfer):
(JSC::ArrayBufferContents::copyTo):
(JSC::ArrayBuffer::isNeutered):
(JSC::ArrayBuffer::~ArrayBuffer):
(JSC::ArrayBuffer::clampValue):
(JSC::ArrayBuffer::create):
(JSC::ArrayBuffer::createUninitialized):
(JSC::ArrayBuffer::ArrayBuffer):
(JSC::ArrayBuffer::data):
(JSC::ArrayBuffer::byteLength):
(JSC::ArrayBuffer::slice):
(JSC::ArrayBuffer::sliceImpl):
(JSC::ArrayBuffer::clampIndex):
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBufferContents::~ArrayBufferContents):
* runtime/ArrayBufferView.cpp: Renamed from Source/WTF/wtf/ArrayBufferView.cpp.
(JSC::ArrayBufferView::ArrayBufferView):
(JSC::ArrayBufferView::~ArrayBufferView):
(JSC::ArrayBufferView::neuter):
* runtime/ArrayBufferView.h: Renamed from Source/WTF/wtf/ArrayBufferView.h.
(JSC::ArrayBufferView::buffer):
(JSC::ArrayBufferView::baseAddress):
(JSC::ArrayBufferView::byteOffset):
(JSC::ArrayBufferView::setNeuterable):
(JSC::ArrayBufferView::isNeuterable):
(JSC::ArrayBufferView::verifySubRange):
(JSC::ArrayBufferView::clampOffsetAndNumElements):
(JSC::ArrayBufferView::setImpl):
(JSC::ArrayBufferView::setRangeImpl):
(JSC::ArrayBufferView::zeroRangeImpl):
(JSC::ArrayBufferView::calculateOffsetAndLength):
* runtime/Float32Array.h: Renamed from Source/WTF/wtf/Float32Array.h.
(JSC::Float32Array::set):
(JSC::Float32Array::getType):
(JSC::Float32Array::create):
(JSC::Float32Array::createUninitialized):
(JSC::Float32Array::Float32Array):
(JSC::Float32Array::subarray):
* runtime/Float64Array.h: Renamed from Source/WTF/wtf/Float64Array.h.
(JSC::Float64Array::set):
(JSC::Float64Array::getType):
(JSC::Float64Array::create):
(JSC::Float64Array::createUninitialized):
(JSC::Float64Array::Float64Array):
(JSC::Float64Array::subarray):
* runtime/Int16Array.h: Renamed from Source/WTF/wtf/Int16Array.h.
(JSC::Int16Array::getType):
(JSC::Int16Array::create):
(JSC::Int16Array::createUninitialized):
(JSC::Int16Array::Int16Array):
(JSC::Int16Array::subarray):
* runtime/Int32Array.h: Renamed from Source/WTF/wtf/Int32Array.h.
(JSC::Int32Array::getType):
(JSC::Int32Array::create):
(JSC::Int32Array::createUninitialized):
(JSC::Int32Array::Int32Array):
(JSC::Int32Array::subarray):
* runtime/Int8Array.h: Renamed from Source/WTF/wtf/Int8Array.h.
(JSC::Int8Array::getType):
(JSC::Int8Array::create):
(JSC::Int8Array::createUninitialized):
(JSC::Int8Array::Int8Array):
(JSC::Int8Array::subarray):
* runtime/IntegralTypedArrayBase.h: Renamed from Source/WTF/wtf/IntegralTypedArrayBase.h.
(JSC::IntegralTypedArrayBase::set):
(JSC::IntegralTypedArrayBase::IntegralTypedArrayBase):
* runtime/TypedArrayBase.h: Renamed from Source/WTF/wtf/TypedArrayBase.h.
(JSC::TypedArrayBase::data):
(JSC::TypedArrayBase::set):
(JSC::TypedArrayBase::setRange):
(JSC::TypedArrayBase::zeroRange):
(JSC::TypedArrayBase::length):
(JSC::TypedArrayBase::byteLength):
(JSC::TypedArrayBase::item):
(JSC::TypedArrayBase::checkInboundData):
(JSC::TypedArrayBase::TypedArrayBase):
(JSC::TypedArrayBase::create):
(JSC::TypedArrayBase::createUninitialized):
(JSC::TypedArrayBase::subarrayImpl):
(JSC::TypedArrayBase::neuter):
* runtime/Uint16Array.h: Renamed from Source/WTF/wtf/Uint16Array.h.
(JSC::Uint16Array::getType):
(JSC::Uint16Array::create):
(JSC::Uint16Array::createUninitialized):
(JSC::Uint16Array::Uint16Array):
(JSC::Uint16Array::subarray):
* runtime/Uint32Array.h: Renamed from Source/WTF/wtf/Uint32Array.h.
(JSC::Uint32Array::getType):
(JSC::Uint32Array::create):
(JSC::Uint32Array::createUninitialized):
(JSC::Uint32Array::Uint32Array):
(JSC::Uint32Array::subarray):
* runtime/Uint8Array.h: Renamed from Source/WTF/wtf/Uint8Array.h.
(JSC::Uint8Array::getType):
(JSC::Uint8Array::create):
(JSC::Uint8Array::createUninitialized):
(JSC::Uint8Array::Uint8Array):
(JSC::Uint8Array::subarray):
* runtime/Uint8ClampedArray.h: Renamed from Source/WTF/wtf/Uint8ClampedArray.h.
(JSC::Uint8ClampedArray::getType):
(JSC::Uint8ClampedArray::create):
(JSC::Uint8ClampedArray::createUninitialized):
(JSC::Uint8ClampedArray::zeroFill):
(JSC::Uint8ClampedArray::set):
(JSC::Uint8ClampedArray::Uint8ClampedArray):
(JSC::Uint8ClampedArray::subarray):
* runtime/VM.h:

Source/WebCore:

Update WebCore for new location of TypedArray implementation.

* ForwardingHeaders/runtime/ArrayBuffer.h: Added.
* ForwardingHeaders/runtime/ArrayBufferView.h: Added.
* ForwardingHeaders/runtime/Float32Array.h: Added.
* ForwardingHeaders/runtime/Float64Array.h: Added.
* ForwardingHeaders/runtime/Int16Array.h: Added.
* ForwardingHeaders/runtime/Int32Array.h: Added.
* ForwardingHeaders/runtime/Int8Array.h: Added.
* ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Added.
* ForwardingHeaders/runtime/TypedArrayBase.h: Added.
* ForwardingHeaders/runtime/Uint16Array.h: Added.
* ForwardingHeaders/runtime/Uint32Array.h: Added.
* ForwardingHeaders/runtime/Uint8Array.h: Added.
* ForwardingHeaders/runtime/Uint8ClampedArray.h: Added.
* Modules/webaudio/AnalyserNode.h:
(WebCore::AnalyserNode::getFloatFrequencyData):
(WebCore::AnalyserNode::getByteFrequencyData):
(WebCore::AnalyserNode::getByteTimeDomainData):
* Modules/webaudio/AsyncAudioDecoder.cpp:
* Modules/webaudio/AsyncAudioDecoder.h:
(WebCore::AsyncAudioDecoder::DecodingTask::audioData):
* Modules/webaudio/AudioBuffer.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioParamTimeline.h:
* Modules/webaudio/PeriodicWave.h:
* Modules/webaudio/RealtimeAnalyser.cpp:
* Modules/webaudio/RealtimeAnalyser.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
* Modules/webaudio/WaveShaperProcessor.h:
* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WebSocket.cpp:
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* WebCore.exp.in:
* bindings/js/JSArrayBufferCustom.cpp:
* bindings/js/JSArrayBufferViewHelper.h:
* bindings/js/JSAudioContextCustom.cpp:
* bindings/js/JSCryptoCustom.cpp:
* bindings/js/JSDictionary.h:
* bindings/js/JSFileReaderCustom.cpp:
* bindings/js/JSWebGLRenderingContextCustom.cpp:
* bindings/js/JSXMLHttpRequestCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::transferArrayBuffers):
* bindings/js/SerializedScriptValue.h:
* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForType):
(GenerateHeader):
(NativeToJSValue):
* dom/MessageEvent.h:
* fileapi/FileReader.cpp:
* fileapi/FileReader.h:
* fileapi/FileReaderLoader.cpp:
* fileapi/FileReaderLoader.h:
* fileapi/FileReaderSync.cpp:
* fileapi/FileReaderSync.h:
* fileapi/WebKitBlobBuilder.cpp:
* fileapi/WebKitBlobBuilder.h:
* html/HTMLMediaElement.cpp:
* html/ImageData.h:
* html/canvas/ArrayBuffer.idl:
* html/canvas/ArrayBufferView.idl:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/DataView.h:
* html/canvas/Float32Array.idl:
* html/canvas/Float64Array.idl:
* html/canvas/Int16Array.idl:
* html/canvas/Int32Array.idl:
* html/canvas/Int8Array.idl:
* html/canvas/Uint16Array.idl:
* html/canvas/Uint32Array.idl:
* html/canvas/Uint8Array.idl:
* html/canvas/Uint8ClampedArray.idl:
* html/canvas/WebGLBuffer.h:
(WebCore::WebGLBuffer::elementArrayBuffer):
* html/canvas/WebGLGetInfo.cpp:
* html/canvas/WebGLGetInfo.h:
* html/canvas/WebGLRenderingContext.cpp:
* html/canvas/WebGLRenderingContext.h:
* inspector/InspectorMemoryAgent.cpp:
* page/Crypto.cpp:
* page/Crypto.h:
* platform/graphics/GraphicsContext3D.cpp:
* platform/graphics/ImageBuffer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/cg/ImageBufferDataCG.h:
* platform/graphics/filters/FEBlend.cpp:
* platform/graphics/filters/FEColorMatrix.cpp:
* platform/graphics/filters/FEComponentTransfer.cpp:
* platform/graphics/filters/FEComposite.cpp:
* platform/graphics/filters/FEConvolveMatrix.cpp:
* platform/graphics/filters/FECustomFilter.cpp:
* platform/graphics/filters/FEDisplacementMap.cpp:
* platform/graphics/filters/FEDropShadow.cpp:
* platform/graphics/filters/FEGaussianBlur.cpp:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMorphology.cpp:
* platform/graphics/filters/FETurbulence.cpp:
* platform/graphics/filters/FilterEffect.cpp:
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/mac/GraphicsContext3DMac.mm:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* testing/Internals.h:
* xml/XMLHttpRequest.cpp:
* xml/XMLHttpRequest.h:
(WebCore::XMLHttpRequest::optionalResponseArrayBuffer):

Source/WTF:

Remove TypedArray implementation from WTF

* GNUmakefile.list.am:
* WTF.xcodeproj/project.pbxproj:
* wtf/Forward.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eb9617a9
......@@ -264,6 +264,8 @@ set(JavaScriptCore_SOURCES
profiler/ProfileNode.cpp
profiler/LegacyProfiler.cpp
runtime/ArrayBuffer.cpp
runtime/ArrayBufferView.cpp
runtime/ArgList.cpp
runtime/Arguments.cpp
runtime/ArrayConstructor.cpp
......
2013-08-05 Oliver Hunt <oliver@apple.com>
Move TypedArray implementation into JSC
https://bugs.webkit.org/show_bug.cgi?id=119489
Reviewed by Filip Pizlo.
Move TypedArray implementation into JSC in advance of re-implementation
* GNUmakefile.list.am:
* JSCTypedArrayStubs.h:
* JavaScriptCore.xcodeproj/project.pbxproj:
* runtime/ArrayBuffer.cpp: Renamed from Source/WTF/wtf/ArrayBuffer.cpp.
(JSC::ArrayBuffer::transfer):
(JSC::ArrayBuffer::addView):
(JSC::ArrayBuffer::removeView):
* runtime/ArrayBuffer.h: Renamed from Source/WTF/wtf/ArrayBuffer.h.
(JSC::ArrayBufferContents::ArrayBufferContents):
(JSC::ArrayBufferContents::data):
(JSC::ArrayBufferContents::sizeInBytes):
(JSC::ArrayBufferContents::transfer):
(JSC::ArrayBufferContents::copyTo):
(JSC::ArrayBuffer::isNeutered):
(JSC::ArrayBuffer::~ArrayBuffer):
(JSC::ArrayBuffer::clampValue):
(JSC::ArrayBuffer::create):
(JSC::ArrayBuffer::createUninitialized):
(JSC::ArrayBuffer::ArrayBuffer):
(JSC::ArrayBuffer::data):
(JSC::ArrayBuffer::byteLength):
(JSC::ArrayBuffer::slice):
(JSC::ArrayBuffer::sliceImpl):
(JSC::ArrayBuffer::clampIndex):
(JSC::ArrayBufferContents::tryAllocate):
(JSC::ArrayBufferContents::~ArrayBufferContents):
* runtime/ArrayBufferView.cpp: Renamed from Source/WTF/wtf/ArrayBufferView.cpp.
(JSC::ArrayBufferView::ArrayBufferView):
(JSC::ArrayBufferView::~ArrayBufferView):
(JSC::ArrayBufferView::neuter):
* runtime/ArrayBufferView.h: Renamed from Source/WTF/wtf/ArrayBufferView.h.
(JSC::ArrayBufferView::buffer):
(JSC::ArrayBufferView::baseAddress):
(JSC::ArrayBufferView::byteOffset):
(JSC::ArrayBufferView::setNeuterable):
(JSC::ArrayBufferView::isNeuterable):
(JSC::ArrayBufferView::verifySubRange):
(JSC::ArrayBufferView::clampOffsetAndNumElements):
(JSC::ArrayBufferView::setImpl):
(JSC::ArrayBufferView::setRangeImpl):
(JSC::ArrayBufferView::zeroRangeImpl):
(JSC::ArrayBufferView::calculateOffsetAndLength):
* runtime/Float32Array.h: Renamed from Source/WTF/wtf/Float32Array.h.
(JSC::Float32Array::set):
(JSC::Float32Array::getType):
(JSC::Float32Array::create):
(JSC::Float32Array::createUninitialized):
(JSC::Float32Array::Float32Array):
(JSC::Float32Array::subarray):
* runtime/Float64Array.h: Renamed from Source/WTF/wtf/Float64Array.h.
(JSC::Float64Array::set):
(JSC::Float64Array::getType):
(JSC::Float64Array::create):
(JSC::Float64Array::createUninitialized):
(JSC::Float64Array::Float64Array):
(JSC::Float64Array::subarray):
* runtime/Int16Array.h: Renamed from Source/WTF/wtf/Int16Array.h.
(JSC::Int16Array::getType):
(JSC::Int16Array::create):
(JSC::Int16Array::createUninitialized):
(JSC::Int16Array::Int16Array):
(JSC::Int16Array::subarray):
* runtime/Int32Array.h: Renamed from Source/WTF/wtf/Int32Array.h.
(JSC::Int32Array::getType):
(JSC::Int32Array::create):
(JSC::Int32Array::createUninitialized):
(JSC::Int32Array::Int32Array):
(JSC::Int32Array::subarray):
* runtime/Int8Array.h: Renamed from Source/WTF/wtf/Int8Array.h.
(JSC::Int8Array::getType):
(JSC::Int8Array::create):
(JSC::Int8Array::createUninitialized):
(JSC::Int8Array::Int8Array):
(JSC::Int8Array::subarray):
* runtime/IntegralTypedArrayBase.h: Renamed from Source/WTF/wtf/IntegralTypedArrayBase.h.
(JSC::IntegralTypedArrayBase::set):
(JSC::IntegralTypedArrayBase::IntegralTypedArrayBase):
* runtime/TypedArrayBase.h: Renamed from Source/WTF/wtf/TypedArrayBase.h.
(JSC::TypedArrayBase::data):
(JSC::TypedArrayBase::set):
(JSC::TypedArrayBase::setRange):
(JSC::TypedArrayBase::zeroRange):
(JSC::TypedArrayBase::length):
(JSC::TypedArrayBase::byteLength):
(JSC::TypedArrayBase::item):
(JSC::TypedArrayBase::checkInboundData):
(JSC::TypedArrayBase::TypedArrayBase):
(JSC::TypedArrayBase::create):
(JSC::TypedArrayBase::createUninitialized):
(JSC::TypedArrayBase::subarrayImpl):
(JSC::TypedArrayBase::neuter):
* runtime/Uint16Array.h: Renamed from Source/WTF/wtf/Uint16Array.h.
(JSC::Uint16Array::getType):
(JSC::Uint16Array::create):
(JSC::Uint16Array::createUninitialized):
(JSC::Uint16Array::Uint16Array):
(JSC::Uint16Array::subarray):
* runtime/Uint32Array.h: Renamed from Source/WTF/wtf/Uint32Array.h.
(JSC::Uint32Array::getType):
(JSC::Uint32Array::create):
(JSC::Uint32Array::createUninitialized):
(JSC::Uint32Array::Uint32Array):
(JSC::Uint32Array::subarray):
* runtime/Uint8Array.h: Renamed from Source/WTF/wtf/Uint8Array.h.
(JSC::Uint8Array::getType):
(JSC::Uint8Array::create):
(JSC::Uint8Array::createUninitialized):
(JSC::Uint8Array::Uint8Array):
(JSC::Uint8Array::subarray):
* runtime/Uint8ClampedArray.h: Renamed from Source/WTF/wtf/Uint8ClampedArray.h.
(JSC::Uint8ClampedArray::getType):
(JSC::Uint8ClampedArray::create):
(JSC::Uint8ClampedArray::createUninitialized):
(JSC::Uint8ClampedArray::zeroFill):
(JSC::Uint8ClampedArray::set):
(JSC::Uint8ClampedArray::Uint8ClampedArray):
(JSC::Uint8ClampedArray::subarray):
* runtime/VM.h:
2013-08-03 Filip Pizlo <fpizlo@apple.com>
Copied space should be able to handle more than one copied backing store per JSCell
......
......@@ -32,7 +32,7 @@ javascriptcore_built_nosources += \
DerivedSources/JavaScriptCore/LLIntAssembly.h
javascriptcore_sources += \
Source/JavaScriptCore/API/APICallbackFunction.h \
Source/JavaScriptCore/API/APICallbackFunction.h \
Source/JavaScriptCore/API/APICast.h \
Source/JavaScriptCore/API/APIShims.h \
Source/JavaScriptCore/API/JSAPIWrapperObject.h \
......@@ -644,6 +644,10 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/ArgList.h \
Source/JavaScriptCore/runtime/Arguments.cpp \
Source/JavaScriptCore/runtime/Arguments.h \
Source/JavaScriptCore/runtime/ArrayBuffer.cpp \
Source/JavaScriptCore/runtime/ArrayBuffer.h \
Source/JavaScriptCore/runtime/ArrayBufferView.cpp \
Source/JavaScriptCore/runtime/ArrayBufferView.h \
Source/JavaScriptCore/runtime/ArrayConstructor.cpp \
Source/JavaScriptCore/runtime/ArrayConstructor.h \
Source/JavaScriptCore/runtime/ArrayConventions.h \
......@@ -705,6 +709,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/Executable.cpp \
Source/JavaScriptCore/runtime/Executable.h \
Source/JavaScriptCore/runtime/ExecutionHarness.h \
Source/JavaScriptCore/runtime/Float32Array.h \
Source/JavaScriptCore/runtime/Float64Array.h \
Source/JavaScriptCore/runtime/FunctionConstructor.cpp \
Source/JavaScriptCore/runtime/FunctionConstructor.h \
Source/JavaScriptCore/runtime/FunctionExecutableDump.cpp \
......@@ -723,6 +729,10 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/IndexingType.h \
Source/JavaScriptCore/runtime/InitializeThreading.cpp \
Source/JavaScriptCore/runtime/InitializeThreading.h \
Source/JavaScriptCore/runtime/Int16Array.h \
Source/JavaScriptCore/runtime/Int32Array.h \
Source/JavaScriptCore/runtime/Int8Array.h \
Source/JavaScriptCore/runtime/IntegralTypedArrayBase.h \
Source/JavaScriptCore/runtime/IntendedStructureChain.cpp \
Source/JavaScriptCore/runtime/IntendedStructureChain.h \
Source/JavaScriptCore/runtime/InternalFunction.cpp \
......@@ -882,8 +892,13 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/SymbolTable.cpp \
Source/JavaScriptCore/runtime/SymbolTable.h \
Source/JavaScriptCore/runtime/Tracing.h \
Source/JavaScriptCore/runtime/TypedArrayBase.h \
Source/JavaScriptCore/runtime/TypedArrayDescriptor.h \
Source/JavaScriptCore/runtime/Uint16Array.h \
Source/JavaScriptCore/runtime/Uint16WithFraction.h \
Source/JavaScriptCore/runtime/Uint32Array.h \
Source/JavaScriptCore/runtime/Uint8Array.h \
Source/JavaScriptCore/runtime/Uint8ClampedArray.h \
Source/JavaScriptCore/runtime/VMStackBounds.h \
Source/JavaScriptCore/runtime/Watchdog.cpp \
Source/JavaScriptCore/runtime/Watchdog.h \
......
......@@ -26,19 +26,20 @@
#ifndef JSCTypedArrayStubs_h
#define JSCTypedArrayStubs_h
#include "Float32Array.h"
#include "Float64Array.h"
#include "Int16Array.h"
#include "Int32Array.h"
#include "Int8Array.h"
#include "JSDestructibleObject.h"
#include "ObjectPrototype.h"
#include "Operations.h"
#include <wtf/Float32Array.h>
#include <wtf/Float64Array.h>
#include "Uint16Array.h"
#include "Uint32Array.h"
#include "Uint8Array.h"
#include "Uint8ClampedArray.h"
#include <wtf/Forward.h>
#include <wtf/Int16Array.h>
#include <wtf/Int32Array.h>
#include <wtf/Int8Array.h>
#include <wtf/Uint16Array.h>
#include <wtf/Uint32Array.h>
#include <wtf/Uint8Array.h>
#include <wtf/Uint8ClampedArray.h>
namespace JSC {
......
......@@ -410,6 +410,8 @@
<ClCompile Include="..\profiler\ProfilerOSRExit.cpp" />
<ClCompile Include="..\profiler\ProfilerOSRExitSite.cpp" />
<ClCompile Include="..\profiler\ProfilerProfiledBytecodes.cpp" />
<ClCompile Include="..\runtime\ArrayBuffer.cpp" />
<ClCompile Include="..\runtime\ArrayBufferView.cpp" />
<ClCompile Include="..\runtime\ArgList.cpp" />
<ClCompile Include="..\runtime\Arguments.cpp" />
<ClCompile Include="..\runtime\ArrayConstructor.cpp" />
......@@ -771,6 +773,8 @@
<ClInclude Include="..\profiler\ProfilerOSRExit.h" />
<ClInclude Include="..\profiler\ProfilerOSRExitSite.h" />
<ClInclude Include="..\profiler\ProfilerProfiledBytecodes.h" />
<ClInclude Include="..\runtime\ArrayBuffer.h" />
<ClInclude Include="..\runtime\ArrayBufferView.h" />
<ClInclude Include="..\runtime\ArgList.h" />
<ClInclude Include="..\runtime\Arguments.h" />
<ClInclude Include="..\runtime\ArrayConstructor.h" />
......@@ -806,6 +810,8 @@
<ClInclude Include="..\runtime\ExceptionHelpers.h" />
<ClInclude Include="..\runtime\Executable.h" />
<ClInclude Include="..\runtime\ExecutionHarness.h" />
<ClInclude Include="..\runtime\Float32Array.h" />
<ClInclude Include="..\runtime\Float64Array.h" />
<ClInclude Include="..\runtime\FunctionConstructor.h" />
<ClInclude Include="..\runtime\FunctionPrototype.h" />
<ClInclude Include="..\runtime\GCActivityCallback.h" />
......@@ -815,6 +821,9 @@
<ClInclude Include="..\runtime\IndexingHeaderInlines.h" />
<ClInclude Include="..\runtime\IndexingType.h" />
<ClInclude Include="..\runtime\InitializeThreading.h" />
<ClInclude Include="..\runtime\Int16Array.h" />
<ClInclude Include="..\runtime\Int32Array.h" />
<ClInclude Include="..\runtime\Int8Array.h" />
<ClInclude Include="..\runtime\IntendedStructureChain.h" />
<ClInclude Include="..\runtime\InternalFunction.h" />
<ClInclude Include="..\runtime\Intrinsic.h" />
......@@ -903,7 +912,10 @@
<ClInclude Include="..\runtime\SymbolTable.h" />
<ClInclude Include="..\runtime\Tracing.h" />
<ClInclude Include="..\runtime\TypedArrayDescriptor.h" />
<ClInclude Include="..\runtime\Uint16Array.h" />
<ClInclude Include="..\runtime\Uint16WithFraction.h" />
<ClInclude Include="..\runtime\Uint32Array.h" />
<ClInclude Include="..\runtime\Uint8Array.h" />
<ClInclude Include="..\runtime\VM.h" />
<ClInclude Include="..\runtime\Watchdog.h" />
<ClInclude Include="..\runtime\WeakGCMap.h" />
......
......@@ -444,6 +444,12 @@
<ClCompile Include="..\profiler\ProfilerProfiledBytecodes.cpp">
<Filter>profiler</Filter>
</ClCompile>
<ClCompile Include="..\runtime\ArrayBuffer.cpp">
<Filter>runtime</Filter>
</ClCompile>
<ClCompile Include="..\runtime\ArrayBufferView.cpp">
<Filter>runtime</Filter>
</ClCompile>
<ClCompile Include="..\runtime\ArgList.cpp">
<Filter>runtime</Filter>
</ClCompile>
......@@ -1460,6 +1466,36 @@
<ClInclude Include="..\profiler\ProfilerProfiledBytecodes.h">
<Filter>profiler</Filter>
</ClInclude>
<ClInclude Include="..\runtime\ArrayBuffer.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\ArrayBufferView.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Float32Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Float64Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Int16Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Int32Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Int8Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Uint16Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Uint32Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\Uint8Array.h">
<Filter>wtf</Filter>
</ClInclude>
<ClInclude Include="..\runtime\ArgList.h">
<Filter>runtime</Filter>
</ClInclude>
......
......@@ -259,6 +259,8 @@ SOURCES += \
profiler/ProfileGenerator.cpp \
profiler/ProfileNode.cpp \
profiler/LegacyProfiler.cpp \
runtime/ArrayBuffer.cpp \
runtime/ArrayBufferView.cpp \
runtime/ArgList.cpp \
runtime/Arguments.cpp \
runtime/ArrayConstructor.cpp \
......
......@@ -31,7 +31,7 @@
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WTF {
namespace JSC {
bool ArrayBuffer::transfer(ArrayBufferContents& result, Vector<RefPtr<ArrayBufferView> >& neuteredViews)
{
......
......@@ -31,7 +31,7 @@
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
namespace WTF {
namespace JSC {
class ArrayBuffer;
class ArrayBufferView;
......@@ -251,8 +251,9 @@ ArrayBufferContents::~ArrayBufferContents()
WTF::fastFree(m_data);
}
} // namespace WTF
} // namespace JSC
using WTF::ArrayBuffer;
using JSC::ArrayBuffer;
using JSC::ArrayBufferContents;
#endif // ArrayBuffer_h
......@@ -28,15 +28,14 @@
#include "ArrayBuffer.h"
namespace WTF {
namespace JSC {
ArrayBufferView::ArrayBufferView(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset)
: m_byteOffset(byteOffset)
, m_isNeuterable(true)
, m_buffer(buffer)
, m_prevView(0)
, m_nextView(0)
ArrayBufferView::ArrayBufferView(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset)
: m_byteOffset(byteOffset)
, m_isNeuterable(true)
, m_buffer(buffer)
, m_prevView(0)
, m_nextView(0)
{
m_baseAddress = m_buffer ? (static_cast<char*>(m_buffer->data()) + m_byteOffset) : 0;
if (m_buffer)
......
......@@ -26,7 +26,7 @@
#ifndef ArrayBufferView_h
#define ArrayBufferView_h
#include <wtf/ArrayBuffer.h>
#include "ArrayBuffer.h"
#include <algorithm>
#include <limits.h>
......@@ -34,10 +34,10 @@
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace WTF {
namespace JSC {
class ArrayBufferView : public RefCounted<ArrayBufferView> {
public:
public:
enum ViewType {
TypeInt8,
TypeUint8,
......@@ -74,7 +74,7 @@ class ArrayBufferView : public RefCounted<ArrayBufferView> {
WTF_EXPORT_PRIVATE virtual ~ArrayBufferView();
protected:
protected:
WTF_EXPORT_PRIVATE ArrayBufferView(PassRefPtr<ArrayBuffer>, unsigned byteOffset);
inline bool setImpl(ArrayBufferView*, unsigned byteOffset);
......@@ -83,15 +83,12 @@ class ArrayBufferView : public RefCounted<ArrayBufferView> {
inline bool zeroRangeImpl(unsigned byteOffset, size_t rangeByteLength);
static inline void calculateOffsetAndLength(int start, int end, unsigned arraySize,
unsigned* offset, unsigned* length);
static inline void calculateOffsetAndLength(int start, int end, unsigned arraySize, unsigned* offset, unsigned* length);
// Helper to verify that a given sub-range of an ArrayBuffer is
// within range.
template <typename T>
static bool verifySubRange(PassRefPtr<ArrayBuffer> buffer,
unsigned byteOffset,
unsigned numElements)
static bool verifySubRange(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned numElements)
{
if (!buffer)
return false;
......@@ -108,10 +105,7 @@ class ArrayBufferView : public RefCounted<ArrayBufferView> {
// Input offset is in number of elements from this array's view;
// output offset is in number of bytes from the underlying buffer's view.
template <typename T>
static void clampOffsetAndNumElements(PassRefPtr<ArrayBuffer> buffer,
unsigned arrayByteOffset,
unsigned *offset,
unsigned *numElements)
static void clampOffsetAndNumElements(PassRefPtr<ArrayBuffer> buffer, unsigned arrayByteOffset, unsigned *offset, unsigned *numElements)
{
unsigned maxOffset = (UINT_MAX - arrayByteOffset) / sizeof(T);
if (*offset > maxOffset) {
......@@ -133,7 +127,7 @@ class ArrayBufferView : public RefCounted<ArrayBufferView> {
unsigned m_byteOffset : 31;
bool m_isNeuterable : 1;
private:
private:
friend class ArrayBuffer;
RefPtr<ArrayBuffer> m_buffer;
ArrayBufferView* m_prevView;
......@@ -182,8 +176,7 @@ bool ArrayBufferView::zeroRangeImpl(unsigned byteOffset, size_t rangeByteLength)
return true;
}
void ArrayBufferView::calculateOffsetAndLength(int start, int end, unsigned arraySize,
unsigned* offset, unsigned* length)
void ArrayBufferView::calculateOffsetAndLength(int start, int end, unsigned arraySize, unsigned* offset, unsigned* length)
{
if (start < 0)
start += arraySize;
......@@ -201,8 +194,8 @@ void ArrayBufferView::calculateOffsetAndLength(int start, int end, unsigned arra
*length = static_cast<unsigned>(end - start);
}
} // namespace WTF
} // namespace JSC
using WTF::ArrayBufferView;
using JSC::ArrayBufferView;
#endif // ArrayBufferView_h
......@@ -27,10 +27,10 @@
#ifndef Float32Array_h
#define Float32Array_h
#include <wtf/TypedArrayBase.h>
#include "TypedArrayBase.h"
#include <wtf/MathExtras.h>
namespace WTF {
namespace JSC {
class Float32Array : public TypedArrayBase<float> {
public:
......@@ -60,9 +60,7 @@ public:
}
private:
inline Float32Array(PassRefPtr<ArrayBuffer>,
unsigned byteOffset,
unsigned length);
inline Float32Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
// Make constructor visible to superclass.
friend class TypedArrayBase<float>;
};
......@@ -102,8 +100,8 @@ PassRefPtr<Float32Array> Float32Array::subarray(int start, int end) const
return subarrayImpl<Float32Array>(start, end);
}
} // namespace WTF
} // namespace JSC
using WTF::Float32Array;
using JSC::Float32Array;
#endif // Float32Array_h
......@@ -27,10 +27,10 @@
#ifndef Float64Array_h
#define Float64Array_h
#include <wtf/TypedArrayBase.h>
#include "TypedArrayBase.h"
#include <wtf/MathExtras.h>
namespace WTF {
namespace JSC {
class Float64Array : public TypedArrayBase<double> {
public:
......@@ -60,9 +60,8 @@ public:
}
private:
inline Float64Array(PassRefPtr<ArrayBuffer>,
unsigned byteOffset,
unsigned length);
inline Float64Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
// Make constructor visible to superclass.
friend class TypedArrayBase<double>;
};
......@@ -102,8 +101,8 @@ PassRefPtr<Float64Array> Float64Array::subarray(int start, int end) const
return subarrayImpl<Float64Array>(start, end);
}
} // namespace WTF
} // namespace JSC
using WTF::Float64Array;
using JSC::Float64Array;
#endif // Float64Array_h
......@@ -26,24 +26,24 @@
#ifndef Int16Array_h
#define Int16Array_h
#include <wtf/IntegralTypedArrayBase.h>
#include "IntegralTypedArrayBase.h"
namespace WTF {
namespace JSC {
class ArrayBuffer;
class Int16Array : public IntegralTypedArrayBase<short> {
class Int16Array : public IntegralTypedArrayBase<int16_t> {
public:
static inline PassRefPtr<Int16Array> create(unsigned length);
static inline PassRefPtr<Int16Array> create(const short* array, unsigned length);
static inline PassRefPtr<Int16Array> create(const int16_t* array, unsigned length);
static inline PassRefPtr<Int16Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
// Should only be used when it is known the entire array will be filled. Do
// not return these results directly to JavaScript without filling first.
static inline PassRefPtr<Int16Array> createUninitialized(unsigned length);
using TypedArrayBase<short>::set;
using IntegralTypedArrayBase<short>::set;
using TypedArrayBase<int16_t>::set;
using IntegralTypedArrayBase<int16_t>::set;
inline PassRefPtr<Int16Array> subarray(int start) const;
inline PassRefPtr<Int16Array> subarray(int start, int end) const;
......@@ -54,35 +54,34 @@ public:
}
private:
inline Int16Array(PassRefPtr<ArrayBuffer>,
unsigned byteOffset,
unsigned length);
inline Int16Array(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
// Make constructor visible to superclass.
friend class TypedArrayBase<short>;
friend class TypedArrayBase<int16_t>;
};
PassRefPtr<Int16Array> Int16Array::create(unsigned length)
{
return TypedArrayBase<short>::create<Int16Array>(length);
return TypedArrayBase<int16_t>::create<Int16Array>(length);
}
PassRefPtr<Int16Array> Int16Array::create(const short* array, unsigned length)
PassRefPtr<Int16Array> Int16Array::create(const int16_t* array, unsigned length)
{
return TypedArrayBase<short>::create<Int16Array>(array, length);
return TypedArrayBase<int16_t>::create<Int16Array>(array, length);
}
PassRefPtr<Int16Array> Int16Array::create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
{
return TypedArrayBase<short>::create<Int16Array>(buffer, byteOffset, length);
return TypedArrayBase<int16_t>::create<Int16Array>(buffer, byteOffset, length);
}
PassRefPtr<Int16Array> Int16Array::createUninitialized(unsigned length)
{
return TypedArrayBase<short>::createUninitialized<Int16Array>(length);
return TypedArrayBase<int16_t>::createUninitialized<Int16Array>(length);