Title: [280011] trunk/JSTests
- Revision
- 280011
- Author
- [email protected]
- Date
- 2021-07-16 17:15:32 -0700 (Fri, 16 Jul 2021)
Log Message
[JSC] Simplify sampling-profiler-regexp.js test
https://bugs.webkit.org/show_bug.cgi?id=228040
Reviewed by Saam Barati.
In this new test case, only thing we care is regexp appears on sampling-profiler regardless of whether the other functions are inlined / tail-called or not.
We change the sampling-profiler/samplingProfiler.js runTest to add a mode which searches specific signature in the call tree.
* stress/sampling-profiler-regexp.js:
(platformSupportsSamplingProfiler):
* stress/sampling-profiler/samplingProfiler.js:
(doesTreeHaveStackTrace):
(runTest):
Modified Paths
Diff
Modified: trunk/JSTests/ChangeLog (280010 => 280011)
--- trunk/JSTests/ChangeLog 2021-07-16 23:59:37 UTC (rev 280010)
+++ trunk/JSTests/ChangeLog 2021-07-17 00:15:32 UTC (rev 280011)
@@ -1,3 +1,19 @@
+2021-07-16 Yusuke Suzuki <[email protected]>
+
+ [JSC] Simplify sampling-profiler-regexp.js test
+ https://bugs.webkit.org/show_bug.cgi?id=228040
+
+ Reviewed by Saam Barati.
+
+ In this new test case, only thing we care is regexp appears on sampling-profiler regardless of whether the other functions are inlined / tail-called or not.
+ We change the sampling-profiler/samplingProfiler.js runTest to add a mode which searches specific signature in the call tree.
+
+ * stress/sampling-profiler-regexp.js:
+ (platformSupportsSamplingProfiler):
+ * stress/sampling-profiler/samplingProfiler.js:
+ (doesTreeHaveStackTrace):
+ (runTest):
+
2021-07-16 Saam Barati <[email protected]>
Grab the lock in FTL::Thunks::keyForSlowPathCallThunk
Modified: trunk/JSTests/stress/sampling-profiler/samplingProfiler.js (280010 => 280011)
--- trunk/JSTests/stress/sampling-profiler/samplingProfiler.js 2021-07-16 23:59:37 UTC (rev 280010)
+++ trunk/JSTests/stress/sampling-profiler/samplingProfiler.js 2021-07-17 00:15:32 UTC (rev 280011)
@@ -36,13 +36,37 @@
const VERBOSE = false;
-function doesTreeHaveStackTrace(tree, stackTrace, isRunFromRunTest = true) {
+function doesTreeHaveStackTrace(tree, stackTraceOrString, isRunFromRunTest = true) {
+ if (typeof stackTraceOrString === 'string') {
+ // Let's ensure that this signature exists in the stack trace.
+ function check(node) {
+ for (let name of Object.keys(node.children)) {
+ if (name === stackTraceOrString)
+ return true;
+ else {
+ if (check(node.children[name]))
+ return true;
+ }
+ }
+ return false;
+ }
+ if (!check(tree)) {
+ if (VERBOSE) {
+ print("failing");
+ print(JSON.stringify(tree));
+ }
+ return false;
+ }
+ return true;
+ }
+
// stack trace should be top-down array with the deepest
// call frame at index 0.
+ let stackTrace = null;
if (isRunFromRunTest)
- stackTrace = [...stackTrace, "runTest", "(program)"];
+ stackTrace = [...stackTraceOrString, "runTest", "(program)"];
else
- stackTrace = [...stackTrace];
+ stackTrace = [...stackTraceOrString];
let node = tree;
for (let i = stackTrace.length; i--; ) {
@@ -66,7 +90,7 @@
// This test suite assumes that "runTest" is being called
// from the global scope.
-function runTest(func, stackTrace) {
+function runTest(func, stackTraceOrString) {
const timeToFail = 50000;
let startTime = Date.now();
let root = makeNode("<root>");
@@ -76,7 +100,7 @@
func();
}
updateCallingContextTree(root);
- if (doesTreeHaveStackTrace(root, stackTrace)) {
+ if (doesTreeHaveStackTrace(root, stackTraceOrString)) {
if (VERBOSE)
print(`Time to finish: ${Date.now() - startTime}`);
return;
Modified: trunk/JSTests/stress/sampling-profiler-regexp.js (280010 => 280011)
--- trunk/JSTests/stress/sampling-profiler-regexp.js 2021-07-16 23:59:37 UTC (rev 280010)
+++ trunk/JSTests/stress/sampling-profiler-regexp.js 2021-07-17 00:15:32 UTC (rev 280011)
@@ -20,5 +20,5 @@
test(regexp);
}
- runTest(baz, ["/(.+)/gi", "", "test", "baz"]);
+ runTest(baz, "/(.+)/gi");
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes