Title: [277786] trunk/Source/_javascript_Core
Revision
277786
Author
[email protected]
Date
2021-05-20 09:00:28 -0700 (Thu, 20 May 2021)

Log Message

$vm should have a function for checking if ASan is enabled similar to $vm.assertEnabled
https://bugs.webkit.org/show_bug.cgi?id=226019

Patch by Tuomas Karkkainen <[email protected]> on 2021-05-20
Reviewed by Mark Lam.

Add method $vm.asanEnabled(), which parallels $vm.assertEnabled(), and allows checking at
runtime whether the current _javascript_Core build is instrumented with AddressSanitizer.

* tools/JSDollarVM.cpp:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (277785 => 277786)


--- trunk/Source/_javascript_Core/ChangeLog	2021-05-20 15:49:23 UTC (rev 277785)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-05-20 16:00:28 UTC (rev 277786)
@@ -1,3 +1,15 @@
+2021-05-20  Tuomas Karkkainen  <[email protected]>
+
+        $vm should have a function for checking if ASan is enabled similar to $vm.assertEnabled
+        https://bugs.webkit.org/show_bug.cgi?id=226019
+
+        Reviewed by Mark Lam.
+
+        Add method $vm.asanEnabled(), which parallels $vm.assertEnabled(), and allows checking at
+        runtime whether the current _javascript_Core build is instrumented with AddressSanitizer.
+
+        * tools/JSDollarVM.cpp:
+
 2021-05-19  Mark Lam  <[email protected]>
 
         AbstractSlotVisitor::containsOpaqueRoot() should only declare didFindOpaqueRoot if the root is actually found.

Modified: trunk/Source/_javascript_Core/tools/JSDollarVM.cpp (277785 => 277786)


--- trunk/Source/_javascript_Core/tools/JSDollarVM.cpp	2021-05-20 15:49:23 UTC (rev 277785)
+++ trunk/Source/_javascript_Core/tools/JSDollarVM.cpp	2021-05-20 16:00:28 UTC (rev 277786)
@@ -1984,6 +1984,7 @@
 static JSC_DECLARE_HOST_FUNCTION(functionICUVersion);
 static JSC_DECLARE_HOST_FUNCTION(functionICUHeaderVersion);
 static JSC_DECLARE_HOST_FUNCTION(functionAssertEnabled);
+static JSC_DECLARE_HOST_FUNCTION(functionAsanEnabled);
 static JSC_DECLARE_HOST_FUNCTION(functionIsMemoryLimited);
 static JSC_DECLARE_HOST_FUNCTION(functionUseJIT);
 static JSC_DECLARE_HOST_FUNCTION(functionIsGigacageEnabled);
@@ -3527,6 +3528,12 @@
     return JSValue::encode(jsBoolean(ASSERT_ENABLED));
 }
 
+JSC_DEFINE_HOST_FUNCTION(functionAsanEnabled, (JSGlobalObject*, CallFrame*))
+{
+    DollarVMAssertScope assertScope;
+    return JSValue::encode(jsBoolean(ASAN_ENABLED));
+}
+
 JSC_DEFINE_HOST_FUNCTION(functionIsMemoryLimited, (JSGlobalObject*, CallFrame*))
 {
     DollarVMAssertScope assertScope;
@@ -3718,6 +3725,7 @@
     addFunction(vm, "icuHeaderVersion", functionICUHeaderVersion, 0);
 
     addFunction(vm, "assertEnabled", functionAssertEnabled, 0);
+    addFunction(vm, "asanEnabled", functionAsanEnabled, 0);
 
     addFunction(vm, "isMemoryLimited", functionIsMemoryLimited, 0);
     addFunction(vm, "useJIT", functionUseJIT, 0);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to