Benedikt Meurer | e8783db | 2024-08-21 12:16:03 | [diff] [blame] | 1 | # Chromium DevTools checklist for WebAssembly features |
| 2 | |
| 3 | [https://goo.gle/devtools-wasm-checklist](https://goo.gle/devtools-wasm-checklist) |
| 4 | |
| 5 | Implementation of new WebAssembly features should take into account the developer experience in Chromium from the |
| 6 | get-go to ensure a great first impression when it is shipped to developers. This document attempts to list all the |
| 7 | relevant aspects of the developer tools that constitute basic functionality, which should be available when the new |
| 8 | features launch (see [shipping criteria for WebAssembly |
| 9 | features](https://v8.dev/docs/wasm-shipping-checklist#when-is-a-webassembly-feature-ready-to-be-shipped)). |
| 10 | |
| 11 | It intentionally doesn't cover extended functionality, which is optional but often desirable, and in some cases |
| 12 | also required for a launch. This includes debugging capabilities specific to the feature in question. |
| 13 | |
| 14 | This document is the WebAssembly counterpart to the [Chromium DevTools support checklist for JavaScript language |
| 15 | features](https://goo.gle/v8-checklist), which is specifically about JavaScript language features, |
| 16 | |
Benedikt Meurer | 4385a56 | 2024-08-21 13:19:52 | [diff] [blame] | 17 | *** note |
| 18 | **IMPORTANT:** Please take a look at the [DevTools UI feature checklist](./ui.md) prior |
| 19 | to changing or extending the DevTools user interface (UI). |
| 20 | *** |
| 21 | |
Benedikt Meurer | e8783db | 2024-08-21 12:16:03 | [diff] [blame] | 22 | [TOC] |
| 23 | |
| 24 | ## Breakpoints and stepping |
| 25 | |
| 26 | Chromium DevTools handles breakpoints and stepping via the Liftoff tier in V8. |
| 27 | |
| 28 | ### Affected |
| 29 | |
| 30 | All features that introduce new instructions or change the semantics of existing instructions. These will need to be |
| 31 | explicitly supported in the Liftoff compiler. |
| 32 | |
| 33 | ### How to test |
| 34 | |
| 35 | [User journeys for breakpoints and stepping](https://docs.google.com/document/d/1XBlUbyYfPsn1OuCpq2F-O7E3zvsfa94ZFsiIcnq2w7I#bookmark=id.gxratadmkb83) |
| 36 | |
| 37 | Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools, |
| 38 | select the Sources panel and locate your `.wasm` file in the Page tree. Now try to set a breakpoint in the function with the new |
| 39 | instruction(s), make sure this breakpoint is hit when the function is run the next time, and also very important, check that this also |
| 40 | works upon reload when the relevant code runs during startup. Likewise try to step into the function, through it and out of the function. |
| 41 | |
| 42 | |
| 43 | ## Scope view |
| 44 | |
| 45 | The Scope view is part of the Sources panel of the Chromium DevTools, which shows when paused on a breakpoint or during stepping. |
| 46 | |
| 47 | ### Affected |
| 48 | |
| 49 | All features that affect instructions or introduce new instructions or types. |
| 50 | |
| 51 | ### How to test |
| 52 | |
| 53 | [User journeys for the scope view](https://docs.google.com/document/d/1XBlUbyYfPsn1OuCpq2F-O7E3zvsfa94ZFsiIcnq2w7I#bookmark=id.9ki5pf2b90dj) |
| 54 | |
| 55 | Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools, |
| 56 | select the Sources panel and locate your `.wasm` file in the Page tree. Set a breakpoint inside the function with the new / changed |
| 57 | instruction(s) and hit the breakpoint by invoking the function. Now when paused on the function make sure that the Scope view shows |
| 58 | reasonable / correct information. |
| 59 | |
| 60 | |
| 61 | ## Syntax highlighting |
| 62 | |
| 63 | Chromium DevTools provides syntax highlighting for WebAssembly disassembly. |
| 64 | |
| 65 | ### Affected |
| 66 | |
| 67 | All features that affect the disassembly in any way, specifically features that introduce new instructions, new types, or change the |
| 68 | disassembly of existing instructions. |
| 69 | |
| 70 | ### How to test |
| 71 | |
| 72 | [User journeys for syntax highlighting](https://docs.google.com/document/d/1XBlUbyYfPsn1OuCpq2F-O7E3zvsfa94ZFsiIcnq2w7I#bookmark=id.sfk1pjqn7d2d) |
| 73 | |
| 74 | Create a `.wasm` file that uses the new feature and serve it from a (local) test page, open Chromium DevTools, select the Source panel and |
| 75 | locate your `.wasm` file in the Page tree. The syntax highlighting of the disassembly should look alright. The syntax highlighting is handled |
| 76 | by [CodeMirror](https://codemirror.net/), inside of Chromium DevTools. |
| 77 | |
| 78 | |
| 79 | ## Performance profiling |
| 80 | |
| 81 | Chromium DevTools allows developers to take performance traces of their applications via the Performance panel. |
| 82 | |
| 83 | ### Affected |
| 84 | |
| 85 | All features that introduce new instructions or affect the way that WebAssembly functions are executed. |
| 86 | |
| 87 | ### How to test |
| 88 | |
| 89 | [User journeys for performance profiling](https://docs.google.com/document/d/1XBlUbyYfPsn1OuCpq2F-O7E3zvsfa94ZFsiIcnq2w7I/#bookmark=id.huv4j7664qhx) |
| 90 | |
| 91 | Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools, select |
| 92 | the Performance panel. Now run the function a with some significant payload for a reasonable amount of time and take a performance profile. |