Unreviewed, rename keepAlive to ensureStillAliveHere
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2020 04:57:06 +0000 (04:57 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2020 04:57:06 +0000 (04:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=209398

Based on Geoff and Mark's feedback, renaming keepAlive to ensureStillAliveHere
to make the effect of keepAlive clear.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
(JSC::FTL::DFG::LowerDFGToB3::ensureStillAliveHere):
(JSC::FTL::DFG::LowerDFGToB3::keepAlive): Deleted.
* heap/HeapCell.cpp:
(JSC::ensureStillAliveHere):
(JSC::keepAlive): Deleted.
* heap/HeapCell.h:
(JSC::ensureStillAliveHere):
(JSC::HeapCell::use const):
(JSC::keepAlive): Deleted.
* runtime/JSCJSValue.cpp:
(JSC::ensureStillAliveHere):
(JSC::keepAlive): Deleted.
* runtime/JSCJSValue.h:
(JSC::ensureStillAliveHere):
(JSC::keepAlive): Deleted.
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/heap/HeapCell.cpp
Source/JavaScriptCore/heap/HeapCell.h
Source/JavaScriptCore/runtime/JSCJSValue.cpp
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp

index f137371..ad1d7c7 100644 (file)
@@ -1,5 +1,36 @@
 2020-03-22  Yusuke Suzuki  <ysuzuki@apple.com>
 
+        Unreviewed, rename keepAlive to ensureStillAliveHere
+        https://bugs.webkit.org/show_bug.cgi?id=209398
+
+        Based on Geoff and Mark's feedback, renaming keepAlive to ensureStillAliveHere
+        to make the effect of keepAlive clear.
+
+        * ftl/FTLLowerDFGToB3.cpp:
+        (JSC::FTL::DFG::LowerDFGToB3::compileAtomicsReadModifyWrite):
+        (JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
+        (JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):
+        (JSC::FTL::DFG::LowerDFGToB3::compileArraySlice):
+        (JSC::FTL::DFG::LowerDFGToB3::ensureStillAliveHere):
+        (JSC::FTL::DFG::LowerDFGToB3::keepAlive): Deleted.
+        * heap/HeapCell.cpp:
+        (JSC::ensureStillAliveHere):
+        (JSC::keepAlive): Deleted.
+        * heap/HeapCell.h:
+        (JSC::ensureStillAliveHere):
+        (JSC::HeapCell::use const):
+        (JSC::keepAlive): Deleted.
+        * runtime/JSCJSValue.cpp:
+        (JSC::ensureStillAliveHere):
+        (JSC::keepAlive): Deleted.
+        * runtime/JSCJSValue.h:
+        (JSC::ensureStillAliveHere):
+        (JSC::keepAlive): Deleted.
+        * wasm/js/WebAssemblyModuleRecord.cpp:
+        (JSC::WebAssemblyModuleRecord::link):
+
+2020-03-22  Yusuke Suzuki  <ysuzuki@apple.com>
+
         [JSC] Add JSC::keepAlive(JSValue)
         https://bugs.webkit.org/show_bug.cgi?id=209398
 
index e747edf..d8e9eb8 100644 (file)
@@ -3840,7 +3840,7 @@ private:
         m_heaps.decorateFencedAccess(&m_heaps.typedArrayProperties, atomicValue);
 
         // We have to keep base alive since that keeps storage alive.
-        keepAlive(lowCell(baseEdge));
+        ensureStillAliveHere(lowCell(baseEdge));
         setIntTypedArrayLoadResult(result, type);
     }
     
@@ -4726,7 +4726,7 @@ private:
                 }
                 
                 // We have to keep base alive since that keeps storage alive.
-                keepAlive(base);
+                ensureStillAliveHere(base);
                 setDouble(result);
                 return;
             }
@@ -5094,7 +5094,7 @@ private:
                 }
                 
                 // We have to keep base alive since that keeps storage alive.
-                keepAlive(base);
+                ensureStillAliveHere(base);
                 return;
             }
         }
@@ -5609,7 +5609,7 @@ private:
         }
 
         // Keep the sourceArray alive at least until after anything that can GC.
-        keepAlive(sourceArray);
+        ensureStillAliveHere(sourceArray);
 
         LBasicBlock loop = m_out.newBlock();
         LBasicBlock continuation = m_out.newBlock();
@@ -18344,7 +18344,7 @@ private:
         return true;
     }
 
-    void keepAlive(LValue value)
+    void ensureStillAliveHere(LValue value)
     {
         PatchpointValue* patchpoint = m_out.patchpoint(Void);
         patchpoint->effects = Effects::none();
index b806c8e..59ff9d7 100644 (file)
@@ -44,7 +44,7 @@ bool HeapCell::isLive()
 
 #if !COMPILER(GCC_COMPATIBLE)
 // This makes the argument opaque from the compiler.
-NEVER_INLINE void keepAlive(const void*)
+NEVER_INLINE void ensureStillAliveHere(const void*)
 {
 }
 #endif
index a89f227..8d3ba22 100644 (file)
@@ -38,12 +38,12 @@ class VM;
 struct CellAttributes;
 
 #if COMPILER(GCC_COMPATIBLE)
-ALWAYS_INLINE void keepAlive(const void* pointer)
+ALWAYS_INLINE void ensureStillAliveHere(const void* pointer)
 {
     asm volatile ("" : : "r"(pointer) : "memory");
 }
 #else
-JS_EXPORT_PRIVATE void keepAlive(const void*);
+JS_EXPORT_PRIVATE void ensureStillAliveHere(const void*);
 #endif
 
 class HeapCell {
@@ -95,7 +95,7 @@ public:
     // but not the object itself.
     ALWAYS_INLINE void use() const
     {
-        keepAlive(this);
+        ensureStillAliveHere(this);
     }
 };
 
index e590c1a..6400ee8 100644 (file)
@@ -429,7 +429,7 @@ String JSValue::toWTFStringSlowCase(JSGlobalObject* globalObject) const
 
 #if !COMPILER(GCC_COMPATIBLE)
 // This makes the argument opaque from the compiler.
-NEVER_INLINE void keepAlive(JSValue)
+NEVER_INLINE void ensureStillAliveHere(JSValue)
 {
 }
 #endif
index fb06f1f..3b65173 100644 (file)
@@ -638,7 +638,7 @@ bool isThisValueAltered(const PutPropertySlot&, JSObject* baseObject);
 bool sameValue(JSGlobalObject*, JSValue a, JSValue b);
 
 #if COMPILER(GCC_COMPATIBLE)
-ALWAYS_INLINE void keepAlive(JSValue value)
+ALWAYS_INLINE void ensureStillAliveHere(JSValue value)
 {
 #if USE(JSVALUE64)
     asm volatile ("" : : "r"(bitwise_cast<uint64_t>(value)) : "memory");
@@ -647,7 +647,7 @@ ALWAYS_INLINE void keepAlive(JSValue value)
 #endif
 }
 #else
-JS_EXPORT_PRIVATE void keepAlive(JSValue);
+JS_EXPORT_PRIVATE void ensureStillAliveHere(JSValue);
 #endif
 
 } // namespace JSC
index 133358b..796c868 100644 (file)
@@ -428,7 +428,7 @@ void WebAssemblyModuleRecord::link(JSGlobalObject* globalObject, JSValue, JSObje
                 JSWebAssemblyGlobal* globalValue = JSWebAssemblyGlobal::tryCreate(globalObject, vm, globalObject->webAssemblyGlobalStructure(), WTFMove(globalRef));
                 scope.assertNoException();
                 m_instance->linkGlobal(vm, globalIndex, globalValue);
-                keepAlive(bitwise_cast<void*>(initialBits)); // Ensure this is kept alive while creating JSWebAssemblyGlobal.
+                ensureStillAliveHere(bitwise_cast<void*>(initialBits)); // Ensure this is kept alive while creating JSWebAssemblyGlobal.
                 break;
             }
             }