-
Notifications
You must be signed in to change notification settings - Fork 2
/
info.html
80 lines (80 loc) · 4.28 KB
/
info.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!doctype HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Cache IR Health Report</title>
<meta name="" content="CacheIR Health Report Help and Information">
<link rel="stylesheet" href="styles-info.css">
</head>
<body>
<h1>
<a href="index.html">CACHEIR HEALTH REPORT</a>
</h1>
<h2>
INFORMATION AND HELP PAGE FOR CACHEIR HEALTH REPORT TOOL
</h2>
<h3>
HOW TO GENERATE AND USE A HEALTH REPORT:
</h3>
<p>
<ol>
<li>Add the below line to your mozconfig to support CacheIR Health Report:</li>
<div class="example"><code>ac_add_options --enable-jitspew</code></div>
<li><a href="https://firefox-source-docs.mozilla.org/js/build.html"> Build SpiderMonkey's JavaScript shell</a>.</li>
<li>Use environment variable: SPEW=CacheIRHealthReport. <div><b>note: The SPEW environment variable is not used in optimized browser builds, enabling jitspew allows generating a report in optimized builds.</b></div></li>
<li>There are four ways to generate a CacheIR Health Report:</li>
<ul>
<li>Build and run the browser with the two aforementioned evironment and mozconfig
options. <b><div>note: for this option you must set security.sandbox.content.level to 1 in about:config</b></div></li>
<div class="example"><code>SPEW=CacheIRHealthReport ./mach run</code></div>
<li>Running a JS program will produce a health report.</li>
<div class="example"><code>SPEW=CacheIRHealthReport dist/bin/js jsprogram.js</code></div>
<li>In the shell you can call cacheIRHealthReport() and a report will be generated for all scripts in the current zone.</li>
<div class="example"><code>cacheIRHealthReport()</code></div>
<li>You may also call cacheIRHealthReport() on a particular function to see the health report associated with that function's script.</li>
<div class="example"><code>cacheIRHealthReport(foo)</code></div>
</ul>
<li>The health report will be named "spew_output.[PID].0", unless otherwise specified, and will be in the same directory you ran the browser or shell from.</li>
<li>Go to <a href="https://carolinecullen.github.io/cacheirhealthreport/">CacheIR Health Report</a> and input the file from the previous step into the tool.</li>
</ol>
</p>
<h3>
TIPS:
</h3>
<p>
<ul>
<li>To reduce the size of spewed data, <a href="https://searchfox.org/mozilla-central/source/js/src/jit/JitSpewer.cpp#95-97">IONFILTER</a> is an environment variable you may use to select specific functions or filenames. This may be helpful when a website you would like to see a report for is producing very large spew output files.</li>
</ul>
</p>
<h3>
WHY IS THIS SCRIPT UNHAPPY?:
</h3>
<p>
There are a few reasons why your script is unhappy:
<ol>
<li>A CacheIR stub was created for a JS_Op has a sum of costs for each of the CacheIROps in that stub that is very high.</li>
<li>More than one non-zero hit count stub was attached to the inline cache. This is costly because we will not Warp-transpile these stubs.</li>
<li>An inline cache entry is either megamorphic or generic.</li>
</ol>
</p>
<h3>
WHAT IS THE SPEWING CONTEXT?:
</h3>
<p>
There are a few ways contexts that we spew health reports:
<ol>
<li>Shell - The cacheIRHealthReport shell function was called.</li>
<li>Transition - The inline cache transitioned into either megamorphic or generic mode.</li>
<li>Trial Inlining - The trial inlining hit count threshold of 500 was reached.</li>
</ol>
</p>
<h3>
RESOURCES:
</h3>
<p>
<a href="https://searchfox.org/mozilla-central/source/js/src/jit/CacheIRHealth.h#21-37">Motivation and Description of CacheIR Health Report</a><br>
<a href="https://searchfox.org/mozilla-central/source/js/src/jit/CacheIROps.yaml#26-49">How we decide scoring for particular CacheIROps</a><br>
<a href="https://searchfox.org/mozilla-central/source/js/src/util/StructuredSpewer.h#42-63">How to specify a different spew file for the health report</a><br>
</p>
</body>
</html>