2014-02-28  Antonio Gomes  <a1.gomes@sisa.samsung.com>

        Optimize memory initialization
        Issue #452

        Reviewed by TrustMe.

        Added a helper class called WebCLMemoryInitializer in order to
        faster zero-out global memory buffers.

        In summary, OpenCL drivers are not reliable with regards to memory initialization.
        The patch replaces the existing calloc-based memory initialization by an opencl
        kernel-based approach, where we benetif from parallelization. It is a 2-pass initialization:
        1- initialize the size%16 bytes using scalar 'char' type;
        2- initialize the remaining bytes using char16 assingment (so 16bytes per thread).

        Numbers:
        Old approach:
        Cold run: 10% of the total time running a full conformance test suite.
        Hot run: 4%                           ''

        New approach: 1.3% of the total time running a full conformance test suite.

        * Modules/webcl/WebCLBuffer.cpp:
        (WebCore::WebCLBuffer::WebCLBuffer):
        * Modules/webcl/WebCLBuffer.h:
        (WebCore::WebCLBuffer::createWeakPtrForLazyInitialization):
        * Modules/webcl/WebCLCommandQueue.cpp:
        (WebCore::WebCLCommandQueue::WebCLCommandQueue):
        * Modules/webcl/WebCLCommandQueue.h:
        (WebCore::WebCLCommandQueue::createWeakPtrForLazyInitialization):
        * Modules/webcl/WebCLContext.cpp:
        (WebCore::WebCLContext::WebCLContext):
        (WebCore::WebCLContext::createCommandQueue):
        (WebCore::WebCLContext::postCreateCommandQueue):
        (WebCore::WebCLContext::postCreateBuffer):
        (WebCore::WebCLContext::createBufferBase):
        (WebCore::WebCLContext::createBuffer):
        * Modules/webcl/WebCLContext.h:
        * Modules/webcl/WebCLDevice.cpp:
        (WebCore::WebCLDevice::getInfo):
        * Modules/webcl/WebCLMemoryInitializer.cpp: Added.
        (WebCore::WebCLMemoryInitializer::WebCLMemoryInitializer):
        (WebCore::WebCLMemoryInitializer::~WebCLMemoryInitializer):
        (WebCore::WebCLMemoryInitializer::ensureMemoryInitialization):
        (WebCore::WebCLMemoryInitializer::commandQueueCreated):
        (WebCore::WebCLMemoryInitializer::bufferCreated):
        (WebCore::WebCLMemoryInitializer::processPendingMemoryInitializationList):
        (WebCore::WebCLMemoryInitializer::validCommandQueueForMemoryInitialization):
        (WebCore::WebCLMemoryInitializer::initializeOrQueueMemoryInitializationOfMemoryObject):
        * Modules/webcl/WebCLMemoryInitializer.h: Copied from Source/WebCore/Modules/webcl/WebCLBuffer.h.
        * Modules/webcl/WebCLSampler.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/ComputeCommandQueue.h:
        * platform/opencl/ComputeCommandQueueCL.cpp:
        (WebCore::ComputeCommandQueue::enqueueTask):