Title: [185532] trunk/Source
Revision
185532
Author
[email protected]
Date
2015-06-12 20:52:06 -0700 (Fri, 12 Jun 2015)

Log Message

Purge PassRefPtr in _javascript_Core - 2
https://bugs.webkit.org/show_bug.cgi?id=145834

Reviewed by Darin Adler.

Source/_javascript_Core:

As a step to remove PassRefPtr, this patch cleans up PassRefPtr as much as possible
in _javascript_Core.

* API/JSClassRef.cpp:
(OpaqueJSClass::create):
* API/JSClassRef.h:
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::callerFrame):
* debugger/DebuggerCallFrame.h:
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::jitCode):
* inspector/ScriptCallStackFactory.cpp:
(Inspector::createScriptCallStack):
(Inspector::createScriptCallStackForConsole):
(Inspector::createScriptCallStackFromException):
(Inspector::createScriptArguments):
* inspector/ScriptCallStackFactory.h:
* jit/ExecutableAllocator.cpp:
(JSC::ExecutableAllocator::allocate):
* jit/ExecutableAllocator.h:
* jit/ExecutableAllocatorFixedVMPool.cpp:
(JSC::ExecutableAllocator::allocate):
* profiler/LegacyProfiler.cpp:
(JSC::LegacyProfiler::stopProfiling):
* profiler/LegacyProfiler.h:
* runtime/DateInstanceCache.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/Executable.h:
* runtime/GenericTypedArrayView.h:
* runtime/GenericTypedArrayViewInlines.h:
(JSC::GenericTypedArrayView<Adaptor>::create):
(JSC::GenericTypedArrayView<Adaptor>::createUninitialized):

Source/WebCore:

Fix call sites depends on changing of JSC.

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSClassRef.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/API/JSClassRef.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/API/JSClassRef.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -113,7 +113,7 @@
     return adoptRef(*new OpaqueJSClass(definition, 0));
 }
 
-PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
+Ref<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
 {
     JSClassDefinition definition = *clientDefinition; // Avoid modifying client copy.
 
@@ -124,7 +124,7 @@
     // We are supposed to use JSClassRetain/Release but since we know that we currently have
     // the only reference to this class object we cheat and use a RefPtr instead.
     RefPtr<OpaqueJSClass> protoClass = adoptRef(new OpaqueJSClass(&protoDefinition, 0));
-    return adoptRef(new OpaqueJSClass(&definition, protoClass.get()));
+    return adoptRef(*new OpaqueJSClass(&definition, protoClass.get()));
 }
 
 OpaqueJSClassContextData::OpaqueJSClassContextData(JSC::VM&, OpaqueJSClass* jsClass)

Modified: trunk/Source/_javascript_Core/API/JSClassRef.h (185531 => 185532)


--- trunk/Source/_javascript_Core/API/JSClassRef.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/API/JSClassRef.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -85,7 +85,7 @@
 };
 
 struct OpaqueJSClass : public ThreadSafeRefCounted<OpaqueJSClass> {
-    static PassRefPtr<OpaqueJSClass> create(const JSClassDefinition*);
+    static Ref<OpaqueJSClass> create(const JSClassDefinition*);
     static Ref<OpaqueJSClass> createNoAutomaticPrototype(const JSClassDefinition*);
     JS_EXPORT_PRIVATE ~OpaqueJSClass();
     

Modified: trunk/Source/_javascript_Core/ChangeLog (185531 => 185532)


--- trunk/Source/_javascript_Core/ChangeLog	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-06-13 03:52:06 UTC (rev 185532)
@@ -1,3 +1,44 @@
+2015-06-12  Gyuyoung Kim  <[email protected]>
+
+        Purge PassRefPtr in _javascript_Core - 2
+        https://bugs.webkit.org/show_bug.cgi?id=145834
+
+        Reviewed by Darin Adler.
+
+        As a step to remove PassRefPtr, this patch cleans up PassRefPtr as much as possible
+        in _javascript_Core.
+
+        * API/JSClassRef.cpp:
+        (OpaqueJSClass::create):
+        * API/JSClassRef.h:
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::callerFrame):
+        * debugger/DebuggerCallFrame.h:
+        * dfg/DFGJITCompiler.h:
+        (JSC::DFG::JITCompiler::jitCode):
+        * inspector/ScriptCallStackFactory.cpp:
+        (Inspector::createScriptCallStack):
+        (Inspector::createScriptCallStackForConsole):
+        (Inspector::createScriptCallStackFromException):
+        (Inspector::createScriptArguments):
+        * inspector/ScriptCallStackFactory.h:
+        * jit/ExecutableAllocator.cpp:
+        (JSC::ExecutableAllocator::allocate):
+        * jit/ExecutableAllocator.h:
+        * jit/ExecutableAllocatorFixedVMPool.cpp:
+        (JSC::ExecutableAllocator::allocate):
+        * profiler/LegacyProfiler.cpp:
+        (JSC::LegacyProfiler::stopProfiling):
+        * profiler/LegacyProfiler.h:
+        * runtime/DateInstanceCache.h:
+        * runtime/Executable.cpp:
+        (JSC::ScriptExecutable::newCodeBlockFor):
+        * runtime/Executable.h:
+        * runtime/GenericTypedArrayView.h:
+        * runtime/GenericTypedArrayViewInlines.h:
+        (JSC::GenericTypedArrayView<Adaptor>::create):
+        (JSC::GenericTypedArrayView<Adaptor>::createUninitialized):
+
 2015-06-12  Darin Adler  <[email protected]>
 
         Fix minor ES6 compliance issue in RegExp.prototype.toString and optimize performance a little

Modified: trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -88,7 +88,7 @@
     m_position = positionForCallFrame(m_callFrame);
 }
 
-PassRefPtr<DebuggerCallFrame> DebuggerCallFrame::callerFrame()
+RefPtr<DebuggerCallFrame> DebuggerCallFrame::callerFrame()
 {
     ASSERT(isValid());
     if (!isValid())
@@ -102,7 +102,7 @@
 
     CallFrame* callerFrame = functor.getCallerFrame();
     if (!callerFrame)
-        return 0;
+        return nullptr;
 
     m_caller = DebuggerCallFrame::create(callerFrame);
     return m_caller;

Modified: trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.h (185531 => 185532)


--- trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/debugger/DebuggerCallFrame.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -53,7 +53,7 @@
 
     JS_EXPORT_PRIVATE explicit DebuggerCallFrame(CallFrame*);
 
-    JS_EXPORT_PRIVATE PassRefPtr<DebuggerCallFrame> callerFrame();
+    JS_EXPORT_PRIVATE RefPtr<DebuggerCallFrame> callerFrame();
     ExecState* exec() const { return m_callFrame; }
     JS_EXPORT_PRIVATE SourceID sourceID() const;
 

Modified: trunk/Source/_javascript_Core/dfg/DFGJITCompiler.h (185531 => 185532)


--- trunk/Source/_javascript_Core/dfg/DFGJITCompiler.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCompiler.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -313,7 +313,7 @@
         entry->m_reshufflings.shrinkToFit();
     }
     
-    PassRefPtr<JITCode> jitCode() { return m_jitCode; }
+    RefPtr<JITCode> jitCode() { return m_jitCode; }
     
     Vector<Label>& blockHeads() { return m_blockHeads; }
 

Modified: trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -84,7 +84,7 @@
     size_t m_remainingCapacityForFrameCapture;
 };
 
-PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize)
+Ref<ScriptCallStack> createScriptCallStack(JSC::ExecState* exec, size_t maxStackSize)
 {
     if (!exec)
         return ScriptCallStack::create();
@@ -98,7 +98,7 @@
     return ScriptCallStack::create(frames);
 }
 
-PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState* exec, size_t maxStackSize)
+Ref<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState* exec, size_t maxStackSize)
 {
     if (!exec)
         return ScriptCallStack::create();
@@ -129,7 +129,7 @@
     exec->clearException();
 }
 
-PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState* exec, JSC::Exception* exception, size_t maxStackSize)
+Ref<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState* exec, JSC::Exception* exception, size_t maxStackSize)
 {
     Vector<ScriptCallFrame> frames;
     RefCountedArray<StackFrame> stackTrace = exception->stack();
@@ -162,7 +162,7 @@
     return ScriptCallStack::create(frames);
 }
 
-PassRefPtr<ScriptArguments> createScriptArguments(JSC::ExecState* exec, unsigned skipArgumentCount)
+Ref<ScriptArguments> createScriptArguments(JSC::ExecState* exec, unsigned skipArgumentCount)
 {
     Vector<Deprecated::ScriptValue> arguments;
     size_t argumentCount = exec->argumentCount();

Modified: trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.h (185531 => 185532)


--- trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/inspector/ScriptCallStackFactory.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -46,10 +46,10 @@
 class ScriptCallStack;
 
 // FIXME: The subtle differences between these should be eliminated.
-JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState*, size_t maxStackSize);
-JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState*, size_t maxStackSize);
-JS_EXPORT_PRIVATE PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState*, JSC::Exception*, size_t maxStackSize);
-JS_EXPORT_PRIVATE PassRefPtr<ScriptArguments> createScriptArguments(JSC::ExecState*, unsigned skipArgumentCount);
+JS_EXPORT_PRIVATE Ref<ScriptCallStack> createScriptCallStack(JSC::ExecState*, size_t maxStackSize);
+JS_EXPORT_PRIVATE Ref<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState*, size_t maxStackSize);
+JS_EXPORT_PRIVATE Ref<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState*, JSC::Exception*, size_t maxStackSize);
+JS_EXPORT_PRIVATE Ref<ScriptArguments> createScriptArguments(JSC::ExecState*, unsigned skipArgumentCount);
 
 } // namespace Inspector
 

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -213,11 +213,11 @@
 
 }
 
-PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
+RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
 {
     RefPtr<ExecutableMemoryHandle> result = allocator()->allocate(sizeInBytes, ownerUID);
     RELEASE_ASSERT(result || effort != JITCompilationMustSucceed);
-    return result.release();
+    return result;
 }
 
 size_t ExecutableAllocator::committedByteCount()

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocator.h (185531 => 185532)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocator.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -32,7 +32,6 @@
 #include <wtf/MetaAllocatorHandle.h>
 #include <wtf/MetaAllocator.h>
 #include <wtf/PageAllocation.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/Vector.h>
 
@@ -113,7 +112,7 @@
     static void dumpProfile() { }
 #endif
 
-    PassRefPtr<ExecutableMemoryHandle> allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort);
+    RefPtr<ExecutableMemoryHandle> allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort);
 
 #if ENABLE(ASSEMBLER_WX_EXCLUSIVE)
     static void makeWritable(void* start, size_t size)

Modified: trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/jit/ExecutableAllocatorFixedVMPool.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -159,7 +159,7 @@
     return result;
 }
 
-PassRefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
+RefPtr<ExecutableMemoryHandle> ExecutableAllocator::allocate(VM&, size_t sizeInBytes, void* ownerUID, JITCompilationEffort effort)
 {
     if (effort != JITCompilationCanFail && Options::reportMustSucceedExecutableAllocations()) {
         dataLog("Allocating ", sizeInBytes, " bytes of executable memory with JITCompilationMustSucceed.\n");
@@ -178,7 +178,7 @@
         }
         return nullptr;
     }
-    return result.release();
+    return result;
 }
 
 size_t ExecutableAllocator::committedByteCount()

Modified: trunk/Source/_javascript_Core/profiler/LegacyProfiler.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/profiler/LegacyProfiler.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/profiler/LegacyProfiler.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -78,7 +78,7 @@
     m_currentProfiles.append(profileGenerator);
 }
 
-PassRefPtr<Profile> LegacyProfiler::stopProfiling(ExecState* exec, const String& title)
+RefPtr<Profile> LegacyProfiler::stopProfiling(ExecState* exec, const String& title)
 {
     if (!exec)
         return nullptr;

Modified: trunk/Source/_javascript_Core/profiler/LegacyProfiler.h (185531 => 185532)


--- trunk/Source/_javascript_Core/profiler/LegacyProfiler.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/profiler/LegacyProfiler.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -51,7 +51,7 @@
     static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String& sourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
 
     JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String& title, PassRefPtr<Stopwatch>);
-    JS_EXPORT_PRIVATE PassRefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
+    JS_EXPORT_PRIVATE RefPtr<Profile> stopProfiling(ExecState*, const WTF::String& title);
     void stopProfiling(JSGlobalObject*);
 
     // Used to ignore profile node subtrees rooted at InjectedScript calls.

Modified: trunk/Source/_javascript_Core/runtime/DateInstanceCache.h (185531 => 185532)


--- trunk/Source/_javascript_Core/runtime/DateInstanceCache.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/runtime/DateInstanceCache.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -30,7 +30,6 @@
 #include "JSDateMath.h"
 #include <array>
 #include <wtf/HashFunctions.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 
 namespace JSC {

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (185531 => 185532)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -199,7 +199,7 @@
     Heap::heap(this)->writeBarrier(this);
 }
 
-PassRefPtr<CodeBlock> ScriptExecutable::newCodeBlockFor(
+RefPtr<CodeBlock> ScriptExecutable::newCodeBlockFor(
     CodeSpecializationKind kind, JSFunction* function, JSScope* scope, JSObject*& exception)
 {
     VM* vm = scope->vm();
@@ -244,7 +244,7 @@
         exception = vm->throwException(
             globalObject->globalExec(),
             error.toErrorObject(globalObject, executable->m_source));
-        return 0;
+        return nullptr;
     }
 
     // Parsing reveals whether our function uses features that require a separate function name object in the scope chain.

Modified: trunk/Source/_javascript_Core/runtime/Executable.h (185531 => 185532)


--- trunk/Source/_javascript_Core/runtime/Executable.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/runtime/Executable.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -398,7 +398,7 @@
     }
 
     void installCode(CodeBlock*);
-    PassRefPtr<CodeBlock> newCodeBlockFor(CodeSpecializationKind, JSFunction*, JSScope*, JSObject*& exception);
+    RefPtr<CodeBlock> newCodeBlockFor(CodeSpecializationKind, JSFunction*, JSScope*, JSObject*& exception);
     PassRefPtr<CodeBlock> newReplacementCodeBlockFor(CodeSpecializationKind);
     
     JSObject* prepareForExecution(ExecState* exec, JSFunction* function, JSScope* scope, CodeSpecializationKind kind)

Modified: trunk/Source/_javascript_Core/runtime/GenericTypedArrayView.h (185531 => 185532)


--- trunk/Source/_javascript_Core/runtime/GenericTypedArrayView.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/runtime/GenericTypedArrayView.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -37,11 +37,11 @@
     GenericTypedArrayView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
 
 public:
-    static PassRefPtr<GenericTypedArrayView> create(unsigned length);
-    static PassRefPtr<GenericTypedArrayView> create(const typename Adaptor::Type* array, unsigned length);
-    static PassRefPtr<GenericTypedArrayView> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
+    static RefPtr<GenericTypedArrayView> create(unsigned length);
+    static RefPtr<GenericTypedArrayView> create(const typename Adaptor::Type* array, unsigned length);
+    static RefPtr<GenericTypedArrayView> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
     
-    static PassRefPtr<GenericTypedArrayView> createUninitialized(unsigned length);
+    static RefPtr<GenericTypedArrayView> createUninitialized(unsigned length);
     
     typename Adaptor::Type* data() const { return static_cast<typename Adaptor::Type*>(baseAddress()); }
     
@@ -98,8 +98,8 @@
             && offset + pos >= offset);
     }
     
-    PassRefPtr<GenericTypedArrayView> subarray(int start) const;
-    PassRefPtr<GenericTypedArrayView> subarray(int start, int end) const;
+    RefPtr<GenericTypedArrayView> subarray(int start) const;
+    RefPtr<GenericTypedArrayView> subarray(int start, int end) const;
     
     virtual TypedArrayType getType() const override
     {

Modified: trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h (185531 => 185532)


--- trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/_javascript_Core/runtime/GenericTypedArrayViewInlines.h	2015-06-13 03:52:06 UTC (rev 185532)
@@ -40,25 +40,25 @@
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(unsigned length)
+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(unsigned length)
 {
     RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(length, sizeof(typename Adaptor::Type));
     if (!buffer)
-        return 0;
+        return nullptr;
     return create(buffer.release(), 0, length);
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
     const typename Adaptor::Type* array, unsigned length)
 {
     RefPtr<GenericTypedArrayView> result = create(length);
     memcpy(result->data(), array, length * sizeof(typename Adaptor::Type));
-    return result.release();
+    return result;
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
+RefPtr<GenericTypedArrayView<Adaptor>> GenericTypedArrayView<Adaptor>::create(
     PassRefPtr<ArrayBuffer> passedBuffer, unsigned byteOffset, unsigned length)
 {
     RefPtr<ArrayBuffer> buffer = passedBuffer;
@@ -71,25 +71,25 @@
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>>
+RefPtr<GenericTypedArrayView<Adaptor>>
 GenericTypedArrayView<Adaptor>::createUninitialized(unsigned length)
 {
     RefPtr<ArrayBuffer> buffer =
         ArrayBuffer::createUninitialized(length, sizeof(typename Adaptor::Type));
     if (!buffer)
-        return 0;
+        return nullptr;
     return create(buffer.release(), 0, length);
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>>
+RefPtr<GenericTypedArrayView<Adaptor>>
 GenericTypedArrayView<Adaptor>::subarray(int start) const
 {
     return subarray(start, length());
 }
 
 template<typename Adaptor>
-PassRefPtr<GenericTypedArrayView<Adaptor>>
+RefPtr<GenericTypedArrayView<Adaptor>>
 GenericTypedArrayView<Adaptor>::subarray(int start, int end) const
 {
     unsigned offset, length;

Modified: trunk/Source/WebCore/ChangeLog (185531 => 185532)


--- trunk/Source/WebCore/ChangeLog	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/WebCore/ChangeLog	2015-06-13 03:52:06 UTC (rev 185532)
@@ -1,3 +1,22 @@
+2015-06-12  Gyuyoung Kim  <[email protected]>
+
+        Purge PassRefPtr in _javascript_Core - 2
+        https://bugs.webkit.org/show_bug.cgi?id=145834
+
+        Reviewed by Darin Adler.
+
+        Fix call sites depends on changing of JSC.
+
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::WebGL2RenderingContext::getParameter):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::getParameter):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::getUniform):
+        (WebCore::WebGLRenderingContextBase::getVertexAttrib):
+        (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
+        (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
+
 2015-06-12  Zalan Bujtas  <[email protected]>
 
         Be more defensive at renderer type checking when initializing flow segments.

Modified: trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp (185531 => 185532)


--- trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -2117,7 +2117,7 @@
     case GraphicsContext3D::COLOR_WRITEMASK:
         return getBooleanArrayParameter(pname);
     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
-        return WebGLGetInfo(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()));
+        return WebGLGetInfo(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()).release());
     case GraphicsContext3D::CULL_FACE:
         return getBooleanParameter(pname);
     case GraphicsContext3D::CULL_FACE_MODE:

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (185531 => 185532)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -953,7 +953,7 @@
     case GraphicsContext3D::COLOR_WRITEMASK:
         return getBooleanArrayParameter(pname);
     case GraphicsContext3D::COMPRESSED_TEXTURE_FORMATS:
-        return WebGLGetInfo(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()));
+        return WebGLGetInfo(Uint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()).release());
     case GraphicsContext3D::CULL_FACE:
         return getBooleanParameter(pname);
     case GraphicsContext3D::CULL_FACE_MODE:

Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp (185531 => 185532)


--- trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2015-06-13 03:25:00 UTC (rev 185531)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp	2015-06-13 03:52:06 UTC (rev 185532)
@@ -2498,7 +2498,7 @@
             m_context->getUniformfv(objectOrZero(program), location, value);
         if (length == 1)
             return WebGLGetInfo(value[0]);
-        return WebGLGetInfo(Float32Array::create(value, length));
+        return WebGLGetInfo(Float32Array::create(value, length).release());
     }
     case GraphicsContext3D::INT: {
         GC3Dint value[4] = {0};
@@ -2508,7 +2508,7 @@
             m_context->getUniformiv(objectOrZero(program), location, value);
         if (length == 1)
             return WebGLGetInfo(value[0]);
-        return WebGLGetInfo(Int32Array::create(value, length));
+        return WebGLGetInfo(Int32Array::create(value, length).release());
     }
     case GraphicsContext3D::BOOL: {
         GC3Dint value[4] = {0};
@@ -2607,7 +2607,7 @@
     case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_TYPE:
         return WebGLGetInfo(state.type);
     case GraphicsContext3D::CURRENT_VERTEX_ATTRIB:
-        return WebGLGetInfo(Float32Array::create(m_vertexAttribValue[index].value, 4));
+        return WebGLGetInfo(Float32Array::create(m_vertexAttribValue[index].value, 4).release());
     default:
         synthesizeGLError(GraphicsContext3D::INVALID_ENUM, "getVertexAttrib", "invalid parameter name");
         return WebGLGetInfo();
@@ -3986,7 +3986,7 @@
     default:
         notImplemented();
     }
-    return WebGLGetInfo(Float32Array::create(value, length));
+    return WebGLGetInfo(Float32Array::create(value, length).release());
 }
 
 WebGLGetInfo WebGLRenderingContextBase::getWebGLIntArrayParameter(GC3Denum pname)
@@ -4005,7 +4005,7 @@
     default:
         notImplemented();
     }
-    return WebGLGetInfo(Int32Array::create(value, length));
+    return WebGLGetInfo(Int32Array::create(value, length).release());
 }
 
 void WebGLRenderingContextBase::checkTextureCompleteness(const char* functionName, bool prepareToDraw)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to