Purge PassRefPtr in JavaScriptCore
authorgyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 02:17:48 +0000 (02:17 +0000)
committergyuyoung.kim@webkit.org <gyuyoung.kim@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Jun 2015 02:17:48 +0000 (02:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145750

Source/JavaScriptCore:

As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.

Reviewed by Darin Adler.

* API/JSClassRef.cpp:
(OpaqueJSClass::createNoAutomaticPrototype):
* API/JSClassRef.h:
* API/JSContextRef.cpp:
* API/JSScriptRef.cpp:
(OpaqueJSScript::create):
* API/JSStringRef.cpp:
(JSStringCreateWithCharacters):
(JSStringCreateWithUTF8CString):
* API/OpaqueJSString.cpp:
(OpaqueJSString::create):
* API/OpaqueJSString.h:
(OpaqueJSString::create):
* bytecompiler/StaticPropertyAnalysis.h:
(JSC::StaticPropertyAnalysis::create):
* debugger/DebuggerCallFrame.h:
(JSC::DebuggerCallFrame::create):
* dfg/DFGToFTLDeferredCompilationCallback.cpp:
(JSC::DFG::ToFTLDeferredCompilationCallback::create):
* dfg/DFGToFTLDeferredCompilationCallback.h:
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
(JSC::DFG::Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create):
(JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::create): Deleted.
* dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::create):
(JSC::DFG::ensureGlobalDFGWorklist):
(JSC::DFG::ensureGlobalFTLWorklist):
* dfg/DFGWorklist.h:
* heap/EdenGCActivityCallback.h:
(JSC::GCActivityCallback::createEdenTimer):
* heap/FullGCActivityCallback.h:
(JSC::GCActivityCallback::createFullTimer):
* heap/GCActivityCallback.h:
* inspector/InjectedScriptHost.h:
* inspector/JavaScriptCallFrame.h:
(Inspector::JavaScriptCallFrame::create):
* inspector/ScriptArguments.cpp:
(Inspector::ScriptArguments::create):
* inspector/ScriptArguments.h:
* jit/JITStubRoutine.h:
(JSC::JITStubRoutine::createSelfManagedRoutine):
* jit/JITToDFGDeferredCompilationCallback.cpp:
(JSC::JITToDFGDeferredCompilationCallback::create):
* jit/JITToDFGDeferredCompilationCallback.h:
* jsc.cpp:
(jscmain):
* parser/NodeConstructors.h:
(JSC::ArrayPatternNode::create):
(JSC::ObjectPatternNode::create):
(JSC::BindingNode::create):
* parser/Nodes.cpp:
(JSC::FunctionParameters::create):
* parser/Nodes.h:
* parser/SourceProvider.h:
(JSC::StringSourceProvider::create):
* profiler/Profile.cpp:
(JSC::Profile::create):
* profiler/Profile.h:
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::create):
* profiler/ProfileGenerator.h:
* profiler/ProfileNode.h:
(JSC::ProfileNode::create):
* runtime/DataView.cpp:
(JSC::DataView::create):
* runtime/DataView.h:
* runtime/DateInstanceCache.h:
(JSC::DateInstanceData::create):
* runtime/JSPromiseReaction.cpp:
(JSC::createExecutePromiseReactionMicrotask):
* runtime/JSPromiseReaction.h:
* runtime/PropertyNameArray.h:
(JSC::PropertyNameArrayData::create):
* runtime/TypeSet.h:
(JSC::StructureShape::create):
(JSC::TypeSet::create):
* runtime/TypedArrayBase.h:
(JSC::TypedArrayBase::create):
(JSC::TypedArrayBase::createUninitialized):
(JSC::TypedArrayBase::subarrayImpl):
* runtime/VM.cpp:
(JSC::VM::createContextGroup):
(JSC::VM::create):
(JSC::VM::createLeaked):
* runtime/VM.h:
* yarr/RegularExpression.cpp:
(JSC::Yarr::RegularExpression::Private::create):

Source/WebCore:

Reviewed by Darin Adler.

As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.

No new tests, no behavior changes.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185346 268f45cc-cd09-0410-ab3c-d52691b4dbfc

51 files changed:
Source/JavaScriptCore/API/JSClassRef.cpp
Source/JavaScriptCore/API/JSClassRef.h
Source/JavaScriptCore/API/JSContextRef.cpp
Source/JavaScriptCore/API/JSScriptRef.cpp
Source/JavaScriptCore/API/JSStringRef.cpp
Source/JavaScriptCore/API/JSStringRefCF.cpp
Source/JavaScriptCore/API/OpaqueJSString.cpp
Source/JavaScriptCore/API/OpaqueJSString.h
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecompiler/StaticPropertyAnalysis.h
Source/JavaScriptCore/debugger/DebuggerCallFrame.h
Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.cpp
Source/JavaScriptCore/dfg/DFGToFTLDeferredCompilationCallback.h
Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp
Source/JavaScriptCore/dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h
Source/JavaScriptCore/dfg/DFGWorklist.cpp
Source/JavaScriptCore/dfg/DFGWorklist.h
Source/JavaScriptCore/heap/EdenGCActivityCallback.h
Source/JavaScriptCore/heap/FullGCActivityCallback.h
Source/JavaScriptCore/heap/GCActivityCallback.h
Source/JavaScriptCore/inspector/InjectedScriptHost.h
Source/JavaScriptCore/inspector/JavaScriptCallFrame.h
Source/JavaScriptCore/inspector/ScriptArguments.cpp
Source/JavaScriptCore/inspector/ScriptArguments.h
Source/JavaScriptCore/jit/JITStubRoutine.h
Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.cpp
Source/JavaScriptCore/jit/JITToDFGDeferredCompilationCallback.h
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/parser/NodeConstructors.h
Source/JavaScriptCore/parser/Nodes.cpp
Source/JavaScriptCore/parser/Nodes.h
Source/JavaScriptCore/parser/SourceProvider.h
Source/JavaScriptCore/profiler/Profile.cpp
Source/JavaScriptCore/profiler/Profile.h
Source/JavaScriptCore/profiler/ProfileGenerator.cpp
Source/JavaScriptCore/profiler/ProfileGenerator.h
Source/JavaScriptCore/profiler/ProfileNode.h
Source/JavaScriptCore/runtime/DataView.cpp
Source/JavaScriptCore/runtime/DataView.h
Source/JavaScriptCore/runtime/DateInstanceCache.h
Source/JavaScriptCore/runtime/JSPromiseReaction.cpp
Source/JavaScriptCore/runtime/JSPromiseReaction.h
Source/JavaScriptCore/runtime/PropertyNameArray.h
Source/JavaScriptCore/runtime/TypeSet.h
Source/JavaScriptCore/runtime/TypedArrayBase.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Source/JavaScriptCore/testRegExp.cpp
Source/JavaScriptCore/yarr/RegularExpression.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowBase.cpp

index e3547d2..a8e7cb7 100644 (file)
@@ -108,9 +108,9 @@ OpaqueJSClass::~OpaqueJSClass()
         JSClassRelease(prototypeClass);
 }
 
         JSClassRelease(prototypeClass);
 }
 
-PassRefPtr<OpaqueJSClass> OpaqueJSClass::createNoAutomaticPrototype(const JSClassDefinition* definition)
+Ref<OpaqueJSClass> OpaqueJSClass::createNoAutomaticPrototype(const JSClassDefinition* definition)
 {
 {
-    return adoptRef(new OpaqueJSClass(definition, 0));
+    return adoptRef(*new OpaqueJSClass(definition, 0));
 }
 
 PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
 }
 
 PassRefPtr<OpaqueJSClass> OpaqueJSClass::create(const JSClassDefinition* clientDefinition)
index d298a16..687d8b9 100644 (file)
@@ -86,7 +86,7 @@ public:
 
 struct OpaqueJSClass : public ThreadSafeRefCounted<OpaqueJSClass> {
     static PassRefPtr<OpaqueJSClass> create(const JSClassDefinition*);
 
 struct OpaqueJSClass : public ThreadSafeRefCounted<OpaqueJSClass> {
     static PassRefPtr<OpaqueJSClass> create(const JSClassDefinition*);
-    static PassRefPtr<OpaqueJSClass> createNoAutomaticPrototype(const JSClassDefinition*);
+    static Ref<OpaqueJSClass> createNoAutomaticPrototype(const JSClassDefinition*);
     JS_EXPORT_PRIVATE ~OpaqueJSClass();
     
     String className();
     JS_EXPORT_PRIVATE ~OpaqueJSClass();
     
     String className();
index 5889918..4976c29 100644 (file)
@@ -76,7 +76,7 @@ const GlobalObjectMethodTable JSC::javaScriptCoreAPIGlobalObjectMethodTable = {
 JSContextGroupRef JSContextGroupCreate()
 {
     initializeThreading();
 JSContextGroupRef JSContextGroupCreate()
 {
     initializeThreading();
-    return toRef(VM::createContextGroup().leakRef());
+    return toRef(&VM::createContextGroup().leakRef());
 }
 
 JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group)
 }
 
 JSContextGroupRef JSContextGroupRetain(JSContextGroupRef group)
index 99d7f31..4747d97 100644 (file)
@@ -41,9 +41,9 @@ using namespace JSC;
 
 struct OpaqueJSScript : public SourceProvider {
 public:
 
 struct OpaqueJSScript : public SourceProvider {
 public:
-    static WTF::PassRefPtr<OpaqueJSScript> create(VM* vm, const String& url, int startingLineNumber, const String& source)
+    static WTF::RefPtr<OpaqueJSScript> create(VM* vm, const String& url, int startingLineNumber, const String& source)
     {
     {
-        return WTF::adoptRef(new OpaqueJSScript(vm, url, startingLineNumber, source));
+        return WTF::adoptRef(*new OpaqueJSScript(vm, url, startingLineNumber, source));
     }
 
     virtual const String& source() const override
     }
 
     virtual const String& source() const override
index 3b75f3d..c9b380c 100644 (file)
@@ -37,7 +37,7 @@ using namespace WTF::Unicode;
 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
 {
     initializeThreading();
 JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
 {
     initializeThreading();
-    return OpaqueJSString::create(chars, numChars).leakRef();
+    return &OpaqueJSString::create(chars, numChars).leakRef();
 }
 
 JSStringRef JSStringCreateWithUTF8CString(const char* string)
 }
 
 JSStringRef JSStringCreateWithUTF8CString(const char* string)
@@ -51,12 +51,12 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
         const LChar* stringStart = reinterpret_cast<const LChar*>(string);
         if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length, &sourceIsAllASCII)) {
             if (sourceIsAllASCII)
         const LChar* stringStart = reinterpret_cast<const LChar*>(string);
         if (conversionOK == convertUTF8ToUTF16(&string, string + length, &p, p + length, &sourceIsAllASCII)) {
             if (sourceIsAllASCII)
-                return OpaqueJSString::create(stringStart, length).leakRef();
-            return OpaqueJSString::create(buffer.data(), p - buffer.data()).leakRef();
+                return &OpaqueJSString::create(stringStart, length).leakRef();
+            return &OpaqueJSString::create(buffer.data(), p - buffer.data()).leakRef();
         }
     }
 
         }
     }
 
-    return OpaqueJSString::create().leakRef();
+    return &OpaqueJSString::create().leakRef();
 }
 
 JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
 }
 
 JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
index 5241a9b..0587259 100644 (file)
@@ -41,18 +41,18 @@ JSStringRef JSStringCreateWithCFString(CFStringRef string)
     // it can hold.  (<rdar://problem/6806478>)
     size_t length = CFStringGetLength(string);
     if (!length)
     // it can hold.  (<rdar://problem/6806478>)
     size_t length = CFStringGetLength(string);
     if (!length)
-        return OpaqueJSString::create(reinterpret_cast<const LChar*>(""), 0).leakRef();
+        return &OpaqueJSString::create(reinterpret_cast<const LChar*>(""), 0).leakRef();
 
     Vector<LChar, 1024> lcharBuffer(length);
     CFIndex usedBufferLength;
     CFIndex convertedSize = CFStringGetBytes(string, CFRangeMake(0, length), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), length, &usedBufferLength);
     if (static_cast<size_t>(convertedSize) == length && static_cast<size_t>(usedBufferLength) == length)
 
     Vector<LChar, 1024> lcharBuffer(length);
     CFIndex usedBufferLength;
     CFIndex convertedSize = CFStringGetBytes(string, CFRangeMake(0, length), kCFStringEncodingISOLatin1, 0, false, lcharBuffer.data(), length, &usedBufferLength);
     if (static_cast<size_t>(convertedSize) == length && static_cast<size_t>(usedBufferLength) == length)
-        return OpaqueJSString::create(lcharBuffer.data(), length).leakRef();
+        return &OpaqueJSString::create(lcharBuffer.data(), length).leakRef();
 
     auto buffer = std::make_unique<UniChar[]>(length);
     CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get());
     static_assert(sizeof(UniChar) == sizeof(UChar), "UniChar and UChar must be same size");
 
     auto buffer = std::make_unique<UniChar[]>(length);
     CFStringGetCharacters(string, CFRangeMake(0, length), buffer.get());
     static_assert(sizeof(UniChar) == sizeof(UChar), "UniChar and UChar must be same size");
-    return OpaqueJSString::create(reinterpret_cast<UChar*>(buffer.get()), length).leakRef();
+    return &OpaqueJSString::create(reinterpret_cast<UChar*>(buffer.get()), length).leakRef();
 }
 
 CFStringRef JSStringCopyCFString(CFAllocatorRef allocator, JSStringRef string)
 }
 
 CFStringRef JSStringCopyCFString(CFAllocatorRef allocator, JSStringRef string)
index 7f9edb4..07a79ad 100644 (file)
@@ -34,7 +34,7 @@
 
 using namespace JSC;
 
 
 using namespace JSC;
 
-PassRefPtr<OpaqueJSString> OpaqueJSString::create(const String& string)
+RefPtr<OpaqueJSString> OpaqueJSString::create(const String& string)
 {
     if (string.isNull())
         return nullptr;
 {
     if (string.isNull())
         return nullptr;
index 03ae577..208131b 100644 (file)
@@ -36,22 +36,22 @@ namespace JSC {
 }
 
 struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
 }
 
 struct OpaqueJSString : public ThreadSafeRefCounted<OpaqueJSString> {
-    static PassRefPtr<OpaqueJSString> create()
+    static Ref<OpaqueJSString> create()
     {
     {
-        return adoptRef(new OpaqueJSString);
+        return adoptRef(*new OpaqueJSString);
     }
 
     }
 
-    static PassRefPtr<OpaqueJSString> create(const LChar* characters, unsigned length)
+    static Ref<OpaqueJSString> create(const LChar* characters, unsigned length)
     {
     {
-        return adoptRef(new OpaqueJSString(characters, length));
+        return adoptRef(*new OpaqueJSString(characters, length));
     }
 
     }
 
-    static PassRefPtr<OpaqueJSString> create(const UChar* characters, unsigned length)
+    static Ref<OpaqueJSString> create(const UChar* characters, unsigned length)
     {
     {
-        return adoptRef(new OpaqueJSString(characters, length));
+        return adoptRef(*new OpaqueJSString(characters, length));
     }
 
     }
 
-    JS_EXPORT_PRIVATE static PassRefPtr<OpaqueJSString> create(const String&);
+    JS_EXPORT_PRIVATE static RefPtr<OpaqueJSString> create(const String&);
 
     JS_EXPORT_PRIVATE ~OpaqueJSString();
 
 
     JS_EXPORT_PRIVATE ~OpaqueJSString();
 
index 622bdf7..d31a28a 100644 (file)
@@ -1,3 +1,101 @@
+2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Purge PassRefPtr in JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=145750
+
+        As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
+
+        Reviewed by Darin Adler.
+
+        * API/JSClassRef.cpp:
+        (OpaqueJSClass::createNoAutomaticPrototype):
+        * API/JSClassRef.h:
+        * API/JSContextRef.cpp:
+        * API/JSScriptRef.cpp:
+        (OpaqueJSScript::create):
+        * API/JSStringRef.cpp:
+        (JSStringCreateWithCharacters):
+        (JSStringCreateWithUTF8CString):
+        * API/OpaqueJSString.cpp:
+        (OpaqueJSString::create):
+        * API/OpaqueJSString.h:
+        (OpaqueJSString::create):
+        * bytecompiler/StaticPropertyAnalysis.h:
+        (JSC::StaticPropertyAnalysis::create):
+        * debugger/DebuggerCallFrame.h:
+        (JSC::DebuggerCallFrame::create):
+        * dfg/DFGToFTLDeferredCompilationCallback.cpp:
+        (JSC::DFG::ToFTLDeferredCompilationCallback::create):
+        * dfg/DFGToFTLDeferredCompilationCallback.h:
+        * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.cpp:
+        (JSC::DFG::Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create):
+        (JSC::DFG::ToFTLForOSREntryDeferredCompilationCallback::create): Deleted.
+        * dfg/DFGToFTLForOSREntryDeferredCompilationCallback.h:
+        * dfg/DFGWorklist.cpp:
+        (JSC::DFG::Worklist::create):
+        (JSC::DFG::ensureGlobalDFGWorklist):
+        (JSC::DFG::ensureGlobalFTLWorklist):
+        * dfg/DFGWorklist.h:
+        * heap/EdenGCActivityCallback.h:
+        (JSC::GCActivityCallback::createEdenTimer):
+        * heap/FullGCActivityCallback.h:
+        (JSC::GCActivityCallback::createFullTimer):
+        * heap/GCActivityCallback.h:
+        * inspector/InjectedScriptHost.h:
+        * inspector/JavaScriptCallFrame.h:
+        (Inspector::JavaScriptCallFrame::create):
+        * inspector/ScriptArguments.cpp:
+        (Inspector::ScriptArguments::create):
+        * inspector/ScriptArguments.h:
+        * jit/JITStubRoutine.h:
+        (JSC::JITStubRoutine::createSelfManagedRoutine):
+        * jit/JITToDFGDeferredCompilationCallback.cpp:
+        (JSC::JITToDFGDeferredCompilationCallback::create):
+        * jit/JITToDFGDeferredCompilationCallback.h:
+        * jsc.cpp:
+        (jscmain):
+        * parser/NodeConstructors.h:
+        (JSC::ArrayPatternNode::create):
+        (JSC::ObjectPatternNode::create):
+        (JSC::BindingNode::create):
+        * parser/Nodes.cpp:
+        (JSC::FunctionParameters::create):
+        * parser/Nodes.h:
+        * parser/SourceProvider.h:
+        (JSC::StringSourceProvider::create):
+        * profiler/Profile.cpp:
+        (JSC::Profile::create):
+        * profiler/Profile.h:
+        * profiler/ProfileGenerator.cpp:
+        (JSC::ProfileGenerator::create):
+        * profiler/ProfileGenerator.h:
+        * profiler/ProfileNode.h:
+        (JSC::ProfileNode::create):
+        * runtime/DataView.cpp:
+        (JSC::DataView::create):
+        * runtime/DataView.h:
+        * runtime/DateInstanceCache.h:
+        (JSC::DateInstanceData::create):
+        * runtime/JSPromiseReaction.cpp:
+        (JSC::createExecutePromiseReactionMicrotask):
+        * runtime/JSPromiseReaction.h:
+        * runtime/PropertyNameArray.h:
+        (JSC::PropertyNameArrayData::create):
+        * runtime/TypeSet.h:
+        (JSC::StructureShape::create):
+        (JSC::TypeSet::create):
+        * runtime/TypedArrayBase.h:
+        (JSC::TypedArrayBase::create):
+        (JSC::TypedArrayBase::createUninitialized):
+        (JSC::TypedArrayBase::subarrayImpl):
+        * runtime/VM.cpp:
+        (JSC::VM::createContextGroup):
+        (JSC::VM::create):
+        (JSC::VM::createLeaked):
+        * runtime/VM.h:
+        * yarr/RegularExpression.cpp:
+        (JSC::Yarr::RegularExpression::Private::create):
+
 2015-06-08  Filip Pizlo  <fpizlo@apple.com>
 
         It should be possible to hoist all constants in DFG SSA
 2015-06-08  Filip Pizlo  <fpizlo@apple.com>
 
         It should be possible to hoist all constants in DFG SSA
index 293c224..5a9918d 100644 (file)
@@ -35,9 +35,9 @@ namespace JSC {
 // Reference count indicates number of live registers that alias this object.
 class StaticPropertyAnalysis : public RefCounted<StaticPropertyAnalysis> {
 public:
 // Reference count indicates number of live registers that alias this object.
 class StaticPropertyAnalysis : public RefCounted<StaticPropertyAnalysis> {
 public:
-    static PassRefPtr<StaticPropertyAnalysis> create(Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow>* instructions, unsigned target)
+    static Ref<StaticPropertyAnalysis> create(Vector<UnlinkedInstruction, 0, UnsafeVectorOverflow>* instructions, unsigned target)
     {
     {
-        return adoptRef(new StaticPropertyAnalysis(instructions, target)); 
+        return adoptRef(*new StaticPropertyAnalysis(instructions, target)); 
     }
 
     void addPropertyIndex(unsigned propertyIndex) { m_propertyIndexes.add(propertyIndex); }
     }
 
     void addPropertyIndex(unsigned propertyIndex) { m_propertyIndexes.add(propertyIndex); }
index 5c7d75a..df61c6a 100644 (file)
@@ -46,9 +46,9 @@ class DebuggerCallFrame : public RefCounted<DebuggerCallFrame> {
 public:
     enum Type { ProgramType, FunctionType };
 
 public:
     enum Type { ProgramType, FunctionType };
 
-    static PassRefPtr<DebuggerCallFrame> create(CallFrame* callFrame)
+    static Ref<DebuggerCallFrame> create(CallFrame* callFrame)
     {
     {
-        return adoptRef(new DebuggerCallFrame(callFrame));
+        return adoptRef(*new DebuggerCallFrame(callFrame));
     }
 
     JS_EXPORT_PRIVATE explicit DebuggerCallFrame(CallFrame*);
     }
 
     JS_EXPORT_PRIVATE explicit DebuggerCallFrame(CallFrame*);
index d0162b7..dd8108a 100644 (file)
@@ -43,10 +43,9 @@ ToFTLDeferredCompilationCallback::ToFTLDeferredCompilationCallback(
 
 ToFTLDeferredCompilationCallback::~ToFTLDeferredCompilationCallback() { }
 
 
 ToFTLDeferredCompilationCallback::~ToFTLDeferredCompilationCallback() { }
 
-PassRefPtr<ToFTLDeferredCompilationCallback> ToFTLDeferredCompilationCallback::create(
-    PassRefPtr<CodeBlock> dfgCodeBlock)
+Ref<ToFTLDeferredCompilationCallback> ToFTLDeferredCompilationCallback::create(PassRefPtr<CodeBlock> dfgCodeBlock)
 {
 {
-    return adoptRef(new ToFTLDeferredCompilationCallback(dfgCodeBlock));
+    return adoptRef(*new ToFTLDeferredCompilationCallback(dfgCodeBlock));
 }
 
 void ToFTLDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
 }
 
 void ToFTLDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
index f1ac4a6..3e0ea02 100644 (file)
@@ -45,8 +45,7 @@ protected:
 public:
     virtual ~ToFTLDeferredCompilationCallback();
 
 public:
     virtual ~ToFTLDeferredCompilationCallback();
 
-    static PassRefPtr<ToFTLDeferredCompilationCallback> create(
-        PassRefPtr<CodeBlock> dfgCodeBlock);
+    static Ref<ToFTLDeferredCompilationCallback> create(PassRefPtr<CodeBlock> dfgCodeBlock);
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*);
     virtual void compilationDidComplete(CodeBlock*, CompilationResult);
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*);
     virtual void compilationDidComplete(CodeBlock*, CompilationResult);
index 47c4fbb..70cc825 100644 (file)
@@ -45,11 +45,10 @@ ToFTLForOSREntryDeferredCompilationCallback::~ToFTLForOSREntryDeferredCompilatio
 {
 }
 
 {
 }
 
-PassRefPtr<ToFTLForOSREntryDeferredCompilationCallback>
-ToFTLForOSREntryDeferredCompilationCallback::create(
+Ref<ToFTLForOSREntryDeferredCompilationCallback>ToFTLForOSREntryDeferredCompilationCallback::create(
     PassRefPtr<CodeBlock> dfgCodeBlock)
 {
     PassRefPtr<CodeBlock> dfgCodeBlock)
 {
-    return adoptRef(new ToFTLForOSREntryDeferredCompilationCallback(dfgCodeBlock));
+    return adoptRef(*new ToFTLForOSREntryDeferredCompilationCallback(dfgCodeBlock));
 }
 
 void ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
 }
 
 void ToFTLForOSREntryDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
index c53df91..c9dcf6d 100644 (file)
@@ -45,8 +45,7 @@ protected:
 public:
     virtual ~ToFTLForOSREntryDeferredCompilationCallback();
 
 public:
     virtual ~ToFTLForOSREntryDeferredCompilationCallback();
 
-    static PassRefPtr<ToFTLForOSREntryDeferredCompilationCallback> create(
-        PassRefPtr<CodeBlock> dfgCodeBlock);
+    static Ref<ToFTLForOSREntryDeferredCompilationCallback> create(PassRefPtr<CodeBlock> dfgCodeBlock);
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*);
     virtual void compilationDidComplete(CodeBlock*, CompilationResult);
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*);
     virtual void compilationDidComplete(CodeBlock*, CompilationResult);
index 4aa1428..4a8f572 100644 (file)
@@ -68,9 +68,9 @@ void Worklist::finishCreation(unsigned numberOfThreads, int relativePriority)
     }
 }
 
     }
 }
 
-PassRefPtr<Worklist> Worklist::create(CString worklistName, unsigned numberOfThreads, int relativePriority)
+Ref<Worklist> Worklist::create(CString worklistName, unsigned numberOfThreads, int relativePriority)
 {
 {
-    RefPtr<Worklist> result = adoptRef(new Worklist(worklistName));
+    Ref<Worklist> result = adoptRef(*new Worklist(worklistName));
     result->finishCreation(numberOfThreads, relativePriority);
     return result;
 }
     result->finishCreation(numberOfThreads, relativePriority);
     return result;
 }
@@ -406,7 +406,7 @@ Worklist* ensureGlobalDFGWorklist()
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
-        theGlobalDFGWorklist = Worklist::create("DFG Worklist", Options::numberOfDFGCompilerThreads(), Options::priorityDeltaOfDFGCompilerThreads()).leakRef();
+        theGlobalDFGWorklist = &Worklist::create("DFG Worklist", Options::numberOfDFGCompilerThreads(), Options::priorityDeltaOfDFGCompilerThreads()).leakRef();
     });
     return theGlobalDFGWorklist;
 }
     });
     return theGlobalDFGWorklist;
 }
@@ -422,7 +422,7 @@ Worklist* ensureGlobalFTLWorklist()
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
 {
     static std::once_flag initializeGlobalWorklistOnceFlag;
     std::call_once(initializeGlobalWorklistOnceFlag, [] {
-        theGlobalFTLWorklist = Worklist::create("FTL Worklist", Options::numberOfFTLCompilerThreads(), Options::priorityDeltaOfFTLCompilerThreads()).leakRef();
+        theGlobalFTLWorklist = &Worklist::create("FTL Worklist", Options::numberOfFTLCompilerThreads(), Options::priorityDeltaOfFTLCompilerThreads()).leakRef();
     });
     return theGlobalFTLWorklist;
 }
     });
     return theGlobalFTLWorklist;
 }
index f61ae4a..bd6e6fa 100644 (file)
@@ -48,7 +48,7 @@ public:
 
     ~Worklist();
     
 
     ~Worklist();
     
-    static PassRefPtr<Worklist> create(CString worklistName, unsigned numberOfThreads, int relativePriority = 0);
+    static Ref<Worklist> create(CString worklistName, unsigned numberOfThreads, int relativePriority = 0);
     
     void enqueue(PassRefPtr<Plan>);
     
     
     void enqueue(PassRefPtr<Plan>);
     
index 28cfddb..214ab43 100644 (file)
@@ -49,7 +49,7 @@ protected:
     virtual double deathRate() override;
 };
 
     virtual double deathRate() override;
 };
 
-inline PassRefPtr<GCActivityCallback> GCActivityCallback::createEdenTimer(Heap* heap)
+inline RefPtr<GCActivityCallback> GCActivityCallback::createEdenTimer(Heap* heap)
 {
     return s_shouldCreateGCTimer ? adoptRef(new EdenGCActivityCallback(heap)) : nullptr;
 }
 {
     return s_shouldCreateGCTimer ? adoptRef(new EdenGCActivityCallback(heap)) : nullptr;
 }
index 88cebd9..3b1b450 100644 (file)
@@ -49,7 +49,7 @@ protected:
     virtual double deathRate() override;
 };
 
     virtual double deathRate() override;
 };
 
-inline PassRefPtr<GCActivityCallback> GCActivityCallback::createFullTimer(Heap* heap)
+inline RefPtr<GCActivityCallback> GCActivityCallback::createFullTimer(Heap* heap)
 {
     return s_shouldCreateGCTimer ? adoptRef(new FullGCActivityCallback(heap)) : nullptr;
 }
 {
     return s_shouldCreateGCTimer ? adoptRef(new FullGCActivityCallback(heap)) : nullptr;
 }
index f30c277..3d07efa 100644 (file)
@@ -30,7 +30,7 @@
 #define GCActivityCallback_h
 
 #include "HeapTimer.h"
 #define GCActivityCallback_h
 
 #include "HeapTimer.h"
-#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
 
 #if USE(CF)
 #include <CoreFoundation/CoreFoundation.h>
 
 #if USE(CF)
 #include <CoreFoundation/CoreFoundation.h>
@@ -43,8 +43,8 @@ class Heap;
 class JS_EXPORT_PRIVATE GCActivityCallback : public HeapTimer, public ThreadSafeRefCounted<GCActivityCallback> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
 class JS_EXPORT_PRIVATE GCActivityCallback : public HeapTimer, public ThreadSafeRefCounted<GCActivityCallback> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassRefPtr<GCActivityCallback> createFullTimer(Heap*);
-    static PassRefPtr<GCActivityCallback> createEdenTimer(Heap*);
+    static RefPtr<GCActivityCallback> createFullTimer(Heap*);
+    static RefPtr<GCActivityCallback> createEdenTimer(Heap*);
 
     GCActivityCallback(Heap*);
 
 
     GCActivityCallback(Heap*);
 
index af1e0cb..ae530a2 100644 (file)
@@ -36,7 +36,7 @@ namespace Inspector {
 
 class JS_EXPORT_PRIVATE InjectedScriptHost : public RefCounted<InjectedScriptHost> {
 public:
 
 class JS_EXPORT_PRIVATE InjectedScriptHost : public RefCounted<InjectedScriptHost> {
 public:
-    static PassRefPtr<InjectedScriptHost> create() { return adoptRef(new InjectedScriptHost); }
+    static Ref<InjectedScriptHost> create() { return adoptRef(*new InjectedScriptHost); }
     virtual ~InjectedScriptHost();
 
     virtual JSC::JSValue subtype(JSC::ExecState*, JSC::JSValue) { return JSC::jsUndefined(); }
     virtual ~InjectedScriptHost();
 
     virtual JSC::JSValue subtype(JSC::ExecState*, JSC::JSValue) { return JSC::jsUndefined(); }
index b344c33..5cfbb23 100644 (file)
@@ -38,9 +38,9 @@ namespace Inspector {
 
 class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
 public:
 
 class JavaScriptCallFrame : public RefCounted<JavaScriptCallFrame> {
 public:
-    static PassRefPtr<JavaScriptCallFrame> create(PassRefPtr<JSC::DebuggerCallFrame> debuggerCallFrame)
+    static Ref<JavaScriptCallFrame> create(PassRefPtr<JSC::DebuggerCallFrame> debuggerCallFrame)
     {
     {
-        return adoptRef(new JavaScriptCallFrame(debuggerCallFrame));
+        return adoptRef(*new JavaScriptCallFrame(debuggerCallFrame));
     }
 
     JavaScriptCallFrame* caller();
     }
 
     JavaScriptCallFrame* caller();
index 4100a3f..51d1fe6 100644 (file)
@@ -37,9 +37,9 @@
 
 namespace Inspector {
 
 
 namespace Inspector {
 
-PassRefPtr<ScriptArguments> ScriptArguments::create(JSC::ExecState* scriptState, Vector<Deprecated::ScriptValue>& arguments)
+Ref<ScriptArguments> ScriptArguments::create(JSC::ExecState* scriptState, Vector<Deprecated::ScriptValue>& arguments)
 {
 {
-    return adoptRef(new ScriptArguments(scriptState, arguments));
+    return adoptRef(*new ScriptArguments(scriptState, arguments));
 }
 
 ScriptArguments::ScriptArguments(JSC::ExecState* execState, Vector<Deprecated::ScriptValue>& arguments)
 }
 
 ScriptArguments::ScriptArguments(JSC::ExecState* execState, Vector<Deprecated::ScriptValue>& arguments)
index 5337e01..7200ab4 100644 (file)
@@ -51,7 +51,7 @@ namespace Inspector {
 
 class JS_EXPORT_PRIVATE ScriptArguments : public RefCounted<ScriptArguments> {
 public:
 
 class JS_EXPORT_PRIVATE ScriptArguments : public RefCounted<ScriptArguments> {
 public:
-    static PassRefPtr<ScriptArguments> create(JSC::ExecState*, Vector<Deprecated::ScriptValue>& arguments);
+    static Ref<ScriptArguments> create(JSC::ExecState*, Vector<Deprecated::ScriptValue>& arguments);
     ~ScriptArguments();
 
     const Deprecated::ScriptValue& argumentAt(size_t) const;
     ~ScriptArguments();
 
     const Deprecated::ScriptValue& argumentAt(size_t) const;
index 849492b..b2113a6 100644 (file)
@@ -60,10 +60,10 @@ public:
     
     // Use this if you want to pass a CodePtr to someone who insists on taking
     // a RefPtr<JITStubRoutine>.
     
     // Use this if you want to pass a CodePtr to someone who insists on taking
     // a RefPtr<JITStubRoutine>.
-    static PassRefPtr<JITStubRoutine> createSelfManagedRoutine(
+    static Ref<JITStubRoutine> createSelfManagedRoutine(
         MacroAssemblerCodePtr rawCodePointer)
     {
         MacroAssemblerCodePtr rawCodePointer)
     {
-        return adoptRef(new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer)));
+        return adoptRef(*new JITStubRoutine(MacroAssemblerCodeRef::createSelfManagedCodeRef(rawCodePointer)));
     }
     
     virtual ~JITStubRoutine();
     }
     
     virtual ~JITStubRoutine();
index 4786312..f7f0ab9 100644 (file)
@@ -37,9 +37,9 @@ namespace JSC {
 JITToDFGDeferredCompilationCallback::JITToDFGDeferredCompilationCallback() { }
 JITToDFGDeferredCompilationCallback::~JITToDFGDeferredCompilationCallback() { }
 
 JITToDFGDeferredCompilationCallback::JITToDFGDeferredCompilationCallback() { }
 JITToDFGDeferredCompilationCallback::~JITToDFGDeferredCompilationCallback() { }
 
-PassRefPtr<JITToDFGDeferredCompilationCallback> JITToDFGDeferredCompilationCallback::create()
+Ref<JITToDFGDeferredCompilationCallback> JITToDFGDeferredCompilationCallback::create()
 {
 {
-    return adoptRef(new JITToDFGDeferredCompilationCallback());
+    return adoptRef(*new JITToDFGDeferredCompilationCallback());
 }
 
 void JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
 }
 
 void JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously(
index 5a1c7ff..f64b979 100644 (file)
@@ -42,7 +42,7 @@ protected:
 public:
     virtual ~JITToDFGDeferredCompilationCallback();
 
 public:
     virtual ~JITToDFGDeferredCompilationCallback();
 
-    static PassRefPtr<JITToDFGDeferredCompilationCallback> create();
+    static Ref<JITToDFGDeferredCompilationCallback> create();
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*) override;
     virtual void compilationDidComplete(CodeBlock*, CompilationResult) override;
     
     virtual void compilationDidBecomeReadyAsynchronously(CodeBlock*) override;
     virtual void compilationDidComplete(CodeBlock*, CompilationResult) override;
index 8770aab..175f287 100644 (file)
@@ -1504,7 +1504,7 @@ int jscmain(int argc, char** argv)
     // Note that the options parsing can affect VM creation, and thus
     // comes first.
     CommandLine options(argc, argv);
     // Note that the options parsing can affect VM creation, and thus
     // comes first.
     CommandLine options(argc, argv);
-    VM* vm = VM::create(LargeHeap).leakRef();
+    VM* vm = &VM::create(LargeHeap).leakRef();
     int result;
     {
         JSLockHolder locker(vm);
     int result;
     {
         JSLockHolder locker(vm);
index fef0f72..7e26ec3 100644 (file)
@@ -943,9 +943,9 @@ namespace JSC {
     {
     }
     
     {
     }
     
-    inline PassRefPtr<ArrayPatternNode> ArrayPatternNode::create()
+    inline Ref<ArrayPatternNode> ArrayPatternNode::create()
     {
     {
-        return adoptRef(new ArrayPatternNode);
+        return adoptRef(*new ArrayPatternNode);
     }
     
     inline ObjectPatternNode::ObjectPatternNode()
     }
     
     inline ObjectPatternNode::ObjectPatternNode()
@@ -953,14 +953,14 @@ namespace JSC {
     {
     }
     
     {
     }
     
-    inline PassRefPtr<ObjectPatternNode> ObjectPatternNode::create()
+    inline Ref<ObjectPatternNode> ObjectPatternNode::create()
     {
     {
-        return adoptRef(new ObjectPatternNode);
+        return adoptRef(*new ObjectPatternNode);
     }
 
     }
 
-    inline PassRefPtr<BindingNode> BindingNode::create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
+    inline Ref<BindingNode> BindingNode::create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
     {
     {
-        return adoptRef(new BindingNode(boundProperty, start, end));
+        return adoptRef(*new BindingNode(boundProperty, start, end));
     }
     
     inline BindingNode::BindingNode(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
     }
     
     inline BindingNode::BindingNode(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end)
index ff9aa44..07e0d37 100644 (file)
@@ -139,7 +139,7 @@ EvalNode::EvalNode(ParserArena& parserArena, const JSTokenLocation& startLocatio
 
 // ------------------------------ FunctionBodyNode -----------------------------
 
 
 // ------------------------------ FunctionBodyNode -----------------------------
 
-PassRefPtr<FunctionParameters> FunctionParameters::create(ParameterNode* firstParameter)
+Ref<FunctionParameters> FunctionParameters::create(ParameterNode* firstParameter)
 {
     unsigned parameterCount = 0;
     for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam())
 {
     unsigned parameterCount = 0;
     for (ParameterNode* parameter = firstParameter; parameter; parameter = parameter->nextParam())
@@ -147,7 +147,7 @@ PassRefPtr<FunctionParameters> FunctionParameters::create(ParameterNode* firstPa
 
     size_t objectSize = sizeof(FunctionParameters) - sizeof(void*) + sizeof(DeconstructionPatternNode*) * parameterCount;
     void* slot = fastMalloc(objectSize);
 
     size_t objectSize = sizeof(FunctionParameters) - sizeof(void*) + sizeof(DeconstructionPatternNode*) * parameterCount;
     void* slot = fastMalloc(objectSize);
-    return adoptRef(new (slot) FunctionParameters(firstParameter, parameterCount));
+    return adoptRef(*new (slot) FunctionParameters(firstParameter, parameterCount));
 }
 
 FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size)
 }
 
 FunctionParameters::FunctionParameters(ParameterNode* firstParameter, unsigned size)
index 92f1a21..7b00c7f 100644 (file)
@@ -1634,7 +1634,7 @@ namespace JSC {
         WTF_MAKE_FAST_ALLOCATED;
         WTF_MAKE_NONCOPYABLE(FunctionParameters);
     public:
         WTF_MAKE_FAST_ALLOCATED;
         WTF_MAKE_NONCOPYABLE(FunctionParameters);
     public:
-        static PassRefPtr<FunctionParameters> create(ParameterNode*);
+        static Ref<FunctionParameters> create(ParameterNode*);
         ~FunctionParameters();
 
         unsigned size() const { return m_size; }
         ~FunctionParameters();
 
         unsigned size() const { return m_size; }
@@ -1782,7 +1782,7 @@ namespace JSC {
 
     class ArrayPatternNode : public DeconstructionPatternNode {
     public:
 
     class ArrayPatternNode : public DeconstructionPatternNode {
     public:
-        static PassRefPtr<ArrayPatternNode> create();
+        static Ref<ArrayPatternNode> create();
         void appendIndex(const JSTokenLocation&, DeconstructionPatternNode* node)
         {
             m_targetPatterns.append(node);
         void appendIndex(const JSTokenLocation&, DeconstructionPatternNode* node)
         {
             m_targetPatterns.append(node);
@@ -1800,7 +1800,7 @@ namespace JSC {
     
     class ObjectPatternNode : public DeconstructionPatternNode {
     public:
     
     class ObjectPatternNode : public DeconstructionPatternNode {
     public:
-        static PassRefPtr<ObjectPatternNode> create();
+        static Ref<ObjectPatternNode> create();
         void appendEntry(const JSTokenLocation&, const Identifier& identifier, bool wasString, DeconstructionPatternNode* pattern)
         {
             m_targetPatterns.append(Entry(identifier, wasString, pattern));
         void appendEntry(const JSTokenLocation&, const Identifier& identifier, bool wasString, DeconstructionPatternNode* pattern)
         {
             m_targetPatterns.append(Entry(identifier, wasString, pattern));
@@ -1827,7 +1827,7 @@ namespace JSC {
 
     class BindingNode : public DeconstructionPatternNode {
     public:
 
     class BindingNode : public DeconstructionPatternNode {
     public:
-        static PassRefPtr<BindingNode> create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end);
+        static Ref<BindingNode> create(const Identifier& boundProperty, const JSTextPosition& start, const JSTextPosition& end);
         const Identifier& boundProperty() const { return m_boundProperty; }
 
         const JSTextPosition& divotStart() const { return m_divotStart; }
         const Identifier& boundProperty() const { return m_boundProperty; }
 
         const JSTextPosition& divotStart() const { return m_divotStart; }
index 4fc9595..cccabf3 100644 (file)
@@ -74,9 +74,9 @@ namespace JSC {
 
     class StringSourceProvider : public SourceProvider {
     public:
 
     class StringSourceProvider : public SourceProvider {
     public:
-        static PassRefPtr<StringSourceProvider> create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition())
+        static Ref<StringSourceProvider> create(const String& source, const String& url, const TextPosition& startPosition = TextPosition::minimumPosition())
         {
         {
-            return adoptRef(new StringSourceProvider(source, url, startPosition));
+            return adoptRef(*new StringSourceProvider(source, url, startPosition));
         }
 
         virtual const String& source() const override
         }
 
         virtual const String& source() const override
index 062243b..f3d450a 100644 (file)
@@ -31,9 +31,9 @@
 
 namespace JSC {
 
 
 namespace JSC {
 
-PassRefPtr<Profile> Profile::create(const String& title, unsigned uid, double startTime)
+Ref<Profile> Profile::create(const String& title, unsigned uid, double startTime)
 {
 {
-    return adoptRef(new Profile(title, uid, startTime));
+    return adoptRef(*new Profile(title, uid, startTime));
 }
 
 Profile::Profile(const String& title, unsigned uid, double startTime)
 }
 
 Profile::Profile(const String& title, unsigned uid, double startTime)
index db19bf8..41cb670 100644 (file)
@@ -35,7 +35,7 @@ namespace JSC {
 
 class JS_EXPORT_PRIVATE Profile : public RefCounted<Profile> {
 public:
 
 class JS_EXPORT_PRIVATE Profile : public RefCounted<Profile> {
 public:
-    static PassRefPtr<Profile> create(const String& title, unsigned uid, double);
+    static Ref<Profile> create(const String& title, unsigned uid, double);
     virtual ~Profile();
 
     const String& title() const { return m_title; }
     virtual ~Profile();
 
     const String& title() const { return m_title; }
index 56cdf6f..f70e4a3 100644 (file)
@@ -39,9 +39,9 @@
 
 namespace JSC {
 
 
 namespace JSC {
 
-PassRefPtr<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
+Ref<ProfileGenerator> ProfileGenerator::create(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
 {
 {
-    return adoptRef(new ProfileGenerator(exec, title, uid, stopwatch));
+    return adoptRef(*new ProfileGenerator(exec, title, uid, stopwatch));
 }
 
 ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
 }
 
 ProfileGenerator::ProfileGenerator(ExecState* exec, const String& title, unsigned uid, PassRefPtr<Stopwatch> stopwatch)
index 3e301ae..387ed5f 100644 (file)
@@ -43,7 +43,7 @@ namespace JSC {
 
     class ProfileGenerator : public RefCounted<ProfileGenerator>  {
     public:
 
     class ProfileGenerator : public RefCounted<ProfileGenerator>  {
     public:
-        static PassRefPtr<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
+        static Ref<ProfileGenerator> create(ExecState*, const WTF::String& title, unsigned uid, PassRefPtr<Stopwatch>);
 
         // Members
         const WTF::String& title() const;
 
         // Members
         const WTF::String& title() const;
index 9ac5565..fcaee0e 100644 (file)
@@ -44,14 +44,14 @@ namespace JSC {
 
     class ProfileNode : public RefCounted<ProfileNode> {
     public:
 
     class ProfileNode : public RefCounted<ProfileNode> {
     public:
-        static PassRefPtr<ProfileNode> create(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* parentNode)
+        static Ref<ProfileNode> create(ExecState* callerCallFrame, const CallIdentifier& callIdentifier, ProfileNode* parentNode)
         {
         {
-            return adoptRef(new ProfileNode(callerCallFrame, callIdentifier, parentNode));
+            return adoptRef(*new ProfileNode(callerCallFrame, callIdentifier, parentNode));
         }
 
         }
 
-        static PassRefPtr<ProfileNode> create(ExecState* callerCallFrame, ProfileNode* node)
+        static Ref<ProfileNode> create(ExecState* callerCallFrame, ProfileNode* node)
         {
         {
-            return adoptRef(new ProfileNode(callerCallFrame, node));
+            return adoptRef(*new ProfileNode(callerCallFrame, node));
         }
 
         struct Call {
         }
 
         struct Call {
index 0c83d6e..78e743f 100644 (file)
@@ -37,13 +37,13 @@ DataView::DataView(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned
 {
 }
 
 {
 }
 
-PassRefPtr<DataView> DataView::create(
+Ref<DataView> DataView::create(
     PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned byteLength)
 {
     PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned byteLength)
 {
-    return adoptRef(new DataView(buffer, byteOffset, byteLength));
+    return adoptRef(*new DataView(buffer, byteOffset, byteLength));
 }
 
 }
 
-PassRefPtr<DataView> DataView::create(PassRefPtr<ArrayBuffer> passedBuffer)
+Ref<DataView> DataView::create(PassRefPtr<ArrayBuffer> passedBuffer)
 {
     RefPtr<ArrayBuffer> buffer = passedBuffer;
     return create(buffer, 0, buffer->byteLength());
 {
     RefPtr<ArrayBuffer> buffer = passedBuffer;
     return create(buffer, 0, buffer->byteLength());
index 4a8aa92..a01d135 100644 (file)
@@ -37,8 +37,8 @@ protected:
     DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength);
     
 public:
     DataView(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned byteLength);
     
 public:
-    JS_EXPORT_PRIVATE static PassRefPtr<DataView> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
-    static PassRefPtr<DataView> create(PassRefPtr<ArrayBuffer>);
+    JS_EXPORT_PRIVATE static Ref<DataView> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
+    static Ref<DataView> create(PassRefPtr<ArrayBuffer>);
     
     virtual unsigned byteLength() const override
     {
     
     virtual unsigned byteLength() const override
     {
index 5f8b1b2..6ebbb0d 100644 (file)
@@ -37,7 +37,7 @@ namespace JSC {
 
 class DateInstanceData : public RefCounted<DateInstanceData> {
 public:
 
 class DateInstanceData : public RefCounted<DateInstanceData> {
 public:
-    static PassRefPtr<DateInstanceData> create() { return adoptRef(new DateInstanceData); }
+    static Ref<DateInstanceData> create() { return adoptRef(*new DateInstanceData); }
 
     double m_gregorianDateTimeCachedForMS;
     GregorianDateTime m_cachedGregorianDateTime;
 
     double m_gregorianDateTimeCachedForMS;
     GregorianDateTime m_cachedGregorianDateTime;
index 1a94c71..f53cccb 100644 (file)
@@ -59,9 +59,9 @@ private:
     Strong<Unknown> m_argument;
 };
 
     Strong<Unknown> m_argument;
 };
 
-PassRefPtr<Microtask> createExecutePromiseReactionMicrotask(VM& vm, JSPromiseReaction* reaction, JSValue argument)
+Ref<Microtask> createExecutePromiseReactionMicrotask(VM& vm, JSPromiseReaction* reaction, JSValue argument)
 {
 {
-    return adoptRef(new ExecutePromiseReactionMicrotask(vm, reaction, argument));
+    return adoptRef(*new ExecutePromiseReactionMicrotask(vm, reaction, argument));
 }
 
 void ExecutePromiseReactionMicrotask::run(ExecState* exec)
 }
 
 void ExecutePromiseReactionMicrotask::run(ExecState* exec)
index 09be2df..76728f4 100644 (file)
@@ -61,7 +61,7 @@ private:
     WriteBarrier<Unknown> m_handler;
 };
 
     WriteBarrier<Unknown> m_handler;
 };
 
-PassRefPtr<Microtask> createExecutePromiseReactionMicrotask(VM&, JSPromiseReaction*, JSValue);
+Ref<Microtask> createExecutePromiseReactionMicrotask(VM&, JSPromiseReaction*, JSValue);
 
 } // namespace JSC
 
 
 } // namespace JSC
 
index 91af3a2..c2f13d8 100644 (file)
@@ -33,7 +33,7 @@ class PropertyNameArrayData : public RefCounted<PropertyNameArrayData> {
 public:
     typedef Vector<Identifier, 20> PropertyNameVector;
 
 public:
     typedef Vector<Identifier, 20> PropertyNameVector;
 
-    static PassRefPtr<PropertyNameArrayData> create() { return adoptRef(new PropertyNameArrayData); }
+    static Ref<PropertyNameArrayData> create() { return adoptRef(*new PropertyNameArrayData); }
 
     PropertyNameVector& propertyNameVector() { return m_propertyNameVector; }
 
 
     PropertyNameVector& propertyNameVector() { return m_propertyNameVector; }
 
index d8f51ea..eb29e6c 100644 (file)
@@ -53,7 +53,7 @@ class StructureShape : public RefCounted<StructureShape> {
 public:
     StructureShape();
 
 public:
     StructureShape();
 
-    static PassRefPtr<StructureShape> create() { return adoptRef(new StructureShape); }
+    static Ref<StructureShape> create() { return adoptRef(*new StructureShape); }
     String propertyHash();
     void markAsFinal();
     void addProperty(UniquedStringImpl&);
     String propertyHash();
     void markAsFinal();
     void addProperty(UniquedStringImpl&);
@@ -82,7 +82,7 @@ private:
 class TypeSet : public RefCounted<TypeSet> {
 
 public:
 class TypeSet : public RefCounted<TypeSet> {
 
 public:
-    static PassRefPtr<TypeSet> create() { return adoptRef(new TypeSet); }
+    static Ref<TypeSet> create() { return adoptRef(*new TypeSet); }
     TypeSet();
     void addTypeInformation(RuntimeType, PassRefPtr<StructureShape>, Structure*);
     void invalidateCache();
     TypeSet();
     void addTypeInformation(RuntimeType, PassRefPtr<StructureShape>, Structure*);
     void invalidateCache();
index d648fcd..ee2746d 100644 (file)
@@ -108,26 +108,26 @@ protected:
     }
 
     template <class Subclass>
     }
 
     template <class Subclass>
-    static PassRefPtr<Subclass> create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
+    static RefPtr<Subclass> create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
     {
         RefPtr<ArrayBuffer> buf(buffer);
         if (!verifySubRange<T>(buf, byteOffset, length))
     {
         RefPtr<ArrayBuffer> buf(buffer);
         if (!verifySubRange<T>(buf, byteOffset, length))
-            return 0;
+            return nullptr;
 
         return adoptRef(new Subclass(buf.release(), byteOffset, length));
     }
 
     template <class Subclass>
 
         return adoptRef(new Subclass(buf.release(), byteOffset, length));
     }
 
     template <class Subclass>
-    static PassRefPtr<Subclass> createUninitialized(unsigned length)
+    static RefPtr<Subclass> createUninitialized(unsigned length)
     {
         RefPtr<ArrayBuffer> buffer = ArrayBuffer::createUninitialized(length, sizeof(T));
         if (!buffer.get())
     {
         RefPtr<ArrayBuffer> buffer = ArrayBuffer::createUninitialized(length, sizeof(T));
         if (!buffer.get())
-            return 0;
+            return nullptr;
         return create<Subclass>(buffer.release(), 0, length);
     }
 
     template <class Subclass>
         return create<Subclass>(buffer.release(), 0, length);
     }
 
     template <class Subclass>
-    PassRefPtr<Subclass> subarrayImpl(int start, int end) const
+    RefPtr<Subclass> subarrayImpl(int start, int end) const
     {
         unsigned offset, length;
         calculateOffsetAndLength(start, end, m_length, &offset, &length);
     {
         unsigned offset, length;
         calculateOffsetAndLength(start, end, m_length, &offset, &length);
index b89d3eb..6a4b84c 100644 (file)
@@ -340,17 +340,17 @@ VM::~VM()
 #endif
 }
 
 #endif
 }
 
-PassRefPtr<VM> VM::createContextGroup(HeapType heapType)
+Ref<VM> VM::createContextGroup(HeapType heapType)
 {
 {
-    return adoptRef(new VM(APIContextGroup, heapType));
+    return adoptRef(*new VM(APIContextGroup, heapType));
 }
 
 }
 
-PassRefPtr<VM> VM::create(HeapType heapType)
+Ref<VM> VM::create(HeapType heapType)
 {
 {
-    return adoptRef(new VM(Default, heapType));
+    return adoptRef(*new VM(Default, heapType));
 }
 
 }
 
-PassRefPtr<VM> VM::createLeaked(HeapType heapType)
+Ref<VM> VM::createLeaked(HeapType heapType)
 {
     return create(heapType);
 }
 {
     return create(heapType);
 }
index 478161d..1d722f9 100644 (file)
@@ -213,9 +213,9 @@ public:
     JS_EXPORT_PRIVATE static bool sharedInstanceExists();
     JS_EXPORT_PRIVATE static VM& sharedInstance();
 
     JS_EXPORT_PRIVATE static bool sharedInstanceExists();
     JS_EXPORT_PRIVATE static VM& sharedInstance();
 
-    JS_EXPORT_PRIVATE static PassRefPtr<VM> create(HeapType = SmallHeap);
-    JS_EXPORT_PRIVATE static PassRefPtr<VM> createLeaked(HeapType = SmallHeap);
-    static PassRefPtr<VM> createContextGroup(HeapType = SmallHeap);
+    JS_EXPORT_PRIVATE static Ref<VM> create(HeapType = SmallHeap);
+    JS_EXPORT_PRIVATE static Ref<VM> createLeaked(HeapType = SmallHeap);
+    static Ref<VM> createContextGroup(HeapType = SmallHeap);
     JS_EXPORT_PRIVATE ~VM();
 
 private:
     JS_EXPORT_PRIVATE ~VM();
 
 private:
index f9e2c47..d194159 100644 (file)
@@ -519,7 +519,7 @@ static void parseArguments(int argc, char** argv, CommandLine& options)
 
 int realMain(int argc, char** argv)
 {
 
 int realMain(int argc, char** argv)
 {
-    VM* vm = VM::create(LargeHeap).leakRef();
+    VM* vm = &VM::create(LargeHeap).leakRef();
     JSLockHolder locker(vm);
 
     CommandLine options;
     JSLockHolder locker(vm);
 
     CommandLine options;
index f4aaec9..0c70896 100644 (file)
@@ -37,9 +37,9 @@ namespace JSC { namespace Yarr {
 
 class RegularExpression::Private : public RefCounted<RegularExpression::Private> {
 public:
 
 class RegularExpression::Private : public RefCounted<RegularExpression::Private> {
 public:
-    static PassRefPtr<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode)
+    static Ref<Private> create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode)
     {
     {
-        return adoptRef(new Private(pattern, caseSensitivity, multilineMode));
+        return adoptRef(*new Private(pattern, caseSensitivity, multilineMode));
     }
 
     int lastMatchLength;
     }
 
     int lastMatchLength;
index 92dd8e9..7e05605 100644 (file)
@@ -1,3 +1,17 @@
+2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
+
+        Purge PassRefPtr in JavaScriptCore
+        https://bugs.webkit.org/show_bug.cgi?id=145750
+
+        Reviewed by Darin Adler.
+
+        As a step to purge PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
+
+        No new tests, no behavior changes.
+
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::commonVM):
+
 2015-06-08  Zalan Bujtas  <zalan@apple.com>
 
         Subpixel rendering: Clip-path does not work properly on subpixel positions.
 2015-06-08  Zalan Bujtas  <zalan@apple.com>
 
         Subpixel rendering: Clip-path does not work properly on subpixel positions.
index bc02b15..8dce442 100644 (file)
@@ -201,7 +201,7 @@ VM& JSDOMWindowBase::commonVM()
     static VM* vm = nullptr;
     if (!vm) {
         ScriptController::initializeThreading();
     static VM* vm = nullptr;
     if (!vm) {
         ScriptController::initializeThreading();
-        vm = VM::createLeaked(LargeHeap).leakRef();
+        vm = &VM::createLeaked(LargeHeap).leakRef();
 #if !PLATFORM(IOS)
         vm->setExclusiveThread(std::this_thread::get_id());
 #else
 #if !PLATFORM(IOS)
         vm->setExclusiveThread(std::this_thread::get_id());
 #else