Title: [262949] trunk/JSTests
Revision
262949
Author
ysuz...@apple.com
Date
2020-06-12 08:45:58 -0700 (Fri, 12 Jun 2020)

Log Message

[JSC] Add sampling-profiler code-origin lookup test
https://bugs.webkit.org/show_bug.cgi?id=213108
<rdar://problem/52044072>

Reviewed by Saam Barati.

This is fixed by r262920. This patch just adds a test additionally.
We are keeping CallSiteIndex valid until corresponding JIT stub is destroyed.
This fixes SamplingProfiler too since SamplingProfiler also collects CallSiteIndex and gets corresponding CodeOrigin.
Since SamplingProfiler does this CallSiteIndex => CodeOrigin before running GC finalizer, validity of CallSiteIndex
should be kept correctly.

* stress/sampling-profiler-code-origin.js: Added.
(let.oThrow.get f):
(foo):
(return.get f):
(f):

Modified Paths

Added Paths

Diff

Modified: trunk/JSTests/ChangeLog (262948 => 262949)


--- trunk/JSTests/ChangeLog	2020-06-12 15:43:58 UTC (rev 262948)
+++ trunk/JSTests/ChangeLog	2020-06-12 15:45:58 UTC (rev 262949)
@@ -1,3 +1,23 @@
+2020-06-12  Yusuke Suzuki  <ysuz...@apple.com>
+
+        [JSC] Add sampling-profiler code-origin lookup test
+        https://bugs.webkit.org/show_bug.cgi?id=213108
+        <rdar://problem/52044072>
+
+        Reviewed by Saam Barati.
+
+        This is fixed by r262920. This patch just adds a test additionally.
+        We are keeping CallSiteIndex valid until corresponding JIT stub is destroyed.
+        This fixes SamplingProfiler too since SamplingProfiler also collects CallSiteIndex and gets corresponding CodeOrigin.
+        Since SamplingProfiler does this CallSiteIndex => CodeOrigin before running GC finalizer, validity of CallSiteIndex
+        should be kept correctly.
+
+        * stress/sampling-profiler-code-origin.js: Added.
+        (let.oThrow.get f):
+        (foo):
+        (return.get f):
+        (f):
+
 2020-06-11  Yusuke Suzuki  <ysuz...@apple.com>
 
         [JSC] Return DisposableCallSiteIndex when destroying GCAwareJITStubRoutineWithExceptionHandler

Added: trunk/JSTests/stress/sampling-profiler-code-origin.js (0 => 262949)


--- trunk/JSTests/stress/sampling-profiler-code-origin.js	                        (rev 0)
+++ trunk/JSTests/stress/sampling-profiler-code-origin.js	2020-06-12 15:45:58 UTC (rev 262949)
@@ -0,0 +1,39 @@
+//@ runDefault("--useConcurrentJIT=0", "--useConcurrentGC=0", "--useSamplingProfiler=1", "--collectSamplingProfilerDataForJSCShell=1", "--repatchBufferingCountdown=1")
+let oThrow = {
+    g: 0,
+    get f() {
+        throw new Error();
+    }
+};
+
+function foo(x, j) {
+    let o = f(x, j);
+    try {
+        o = o.f;
+    } catch (e) {
+        gc();
+        o === 0;
+    }
+}
+
+noInline(foo);
+
+function f(x, j) {
+    if (x) {
+        return oThrow;
+    }
+    if (j % 2) {
+        return {};
+    }
+    return {
+        get f() {}
+    };
+}
+
+noInline(f);
+
+for (let i = 0; i < 20000; i++) {
+    foo(false, i);
+}
+
+foo(true);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to