index.html 4.51 KB
Newer Older
zeynepCankara's avatar
zeynepCankara committed
1 2 3 4 5 6 7 8 9 10 11 12
<!DOCTYPE html>
<!-- Copyright 2020 the V8 project authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>Indicium</title>
  <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>
  <!-- <link rel="icon" type="image/png" href="/images/favicon.png"/> -->
13
  <script type="module" src="index.mjs"></script>
14
  <link rel="stylesheet" type="text/css" href="./index.css">
15 16
  <style>
    .theme-switch-wrapper {
17
      display: inline-block;
18 19 20 21 22
      align-items: center;
    }

    .theme-switch {
      display: inline-block;
23
      height: 16px;
24
      position: relative;
25
      width: 38px;
26 27 28 29 30 31 32 33 34 35 36 37 38 39
    }

    .theme-switch input {
      display: none;
    }

    .slider {
      background-color: var(--primary-color);
      bottom: 0;
      cursor: pointer;
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
40
      border-radius: 34px;
41 42 43 44
    }

    .slider:before {
      background-color: var(--surface-color);
45 46 47 48
      position: absolute;
      height: 10px;
      width: 10px;
      bottom: 3px;
49 50
      content: "";
      left: 4px;
51
      border-radius: 50%;
52 53 54
    }

    input:checked+.slider:before {
55
      transform: translateX(20px);
56 57 58 59 60 61 62 63
    }

    #container.initial {
      display: none;
    }

    #container.loaded {
      display: grid;
64 65 66
      align-content: center;
      grid-template-columns: repeat(auto-fit, minmax(400px, 800px));
      grid-template-rows: repeat(auto-fit, minmax(400px, 800px));
67
      grid-auto-flow: dense;
68
      grid-gap: 1em;
69 70 71 72
    }

    #container.loaded>#timeline-panel {
      grid-column: span 2;
73
      overflow: scroll;
74
    }
75 76
    dt::after  {
      content: ":";
77
    }
78 79 80 81
  </style>
  <script type="module">
    import { App } from './index.mjs';

82 83 84
    globalThis.app = new App("#log-file-reader", "#map-panel",
      "#timeline-panel", "#ic-panel", "#map-track", "#ic-track",
      "#source-panel");
85
  </script>
zeynepCankara's avatar
zeynepCankara committed
86
</head>
87

zeynepCankara's avatar
zeynepCankara committed
88
<body>
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
  <section id="file-reader">
    <log-file-reader id="log-file-reader"></log-file-reader>
  </section>

  <section id="container" class="initial">
    <timeline-panel id="timeline-panel">
      <timeline-track id="map-track"></timeline-track>
      <timeline-track id="ic-track"></timeline-track>
    </timeline-panel>
    <map-panel id="map-panel"></map-panel>
    <ic-panel id="ic-panel" onchange="app.handleSelectIc(event)"></ic-panel>
    <source-panel id="source-panel"></source-panel>
  </section>

  <section id="settings">
    <h2>Settings</h2>
    <span>Theme:</span>
106
    <div class="theme-switch-wrapper">
107 108 109
      <label class="theme-switch" for="theme-switch-input">
        <input type="checkbox" id="theme-switch-input" />
        <div class="slider"></div>
110 111
      </label>
    </div>
112 113 114
  </section>

  <section id="instructions">
zeynepCankara's avatar
zeynepCankara committed
115
    <h2>Instructions</h2>
116
    <p>
117 118
      Unified web interface to analyse runtime information stored in the v8 log.
    </p>
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
    For generating a v8.log file from <a href="https://v8.dev/docs/build">d8</a>:
    <ul>
      <li>
        <code>/path/do/d8 --trace-maps --trace_ic --log-source-code $FILE</code>
      </li>
    </ul>
    For generating a v8.log file from Chrome:
    <ul>
      <li>
        <code>/path/to/chrome --user-data-dir=/var/tmp/chr$RANDOM --no-sandbox
        --js-flags='--trace-ic --trace-maps --log-source-code’
        $WEBSITE_URL</code>
      </li>
    </ul>

    <h3>Log Options:</h3>
    <dl class="d8-options">
      <dt><code>--trace-maps</code></dt>
137 138
      <dd>Log<a href="https://v8.dev/blog/fast-properties" target="_blank">
          Maps</a></dd>
139
      <dt><code>--trace-ic</code></dt>
140 141 142
      <dd>Log
        <a href="https://mathiasbynens.be/notes/shapes-ics" target="_blank">
          ICs</a></dd>
143
      <dt><code>--log-source-code</code></dt>
144 145
      <dd>Log source code</dd>
    </dl>
146

147
    <h3>Keyboard Shortcuts for Navigation</h3>
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
    <dl>
      <dt><kbd>SHIFT</kbd> + <kbd>Arrow Up</kbd></dt>
      <dd>Follow Map transition forward (first child)</dd>

      <dt><kbd>SHIFT</kbd> + <kbd>Arrow Down</kbd></dt>
      <dd>Follow Map transition backwards</dd>

      <dt><kbd>Arrow Up</kbd></dt>
      <dd>Go to previous Map chunk</dd>

      <dt><kbd>Arrow Down</kbd></dt>
      <dd>Go to next Map in chunk</dd>

      <dt><kbd>Arrow Left</kbd></dt>
      <dd>Go to previous chunk</dd>

      <dt><kbd>Arrow Right</kbd></dt>
      <dd>Go to next chunk</dd>

      <dt><kbd>+</kbd></dt>
      <dd>Timeline zoom in</dd>

      <dt><kbd>-</kbd></dt>
      <dd>Timeline zoom out</dd>
    </dl>
173
  </section>
zeynepCankara's avatar
zeynepCankara committed
174
</body>
175

zeynepCankara's avatar
zeynepCankara committed
176
</html>