blob: 3c105424c69530d20ed94c2b146439916f1d1f1f [file] [log] [blame] [view]
Benedikt Meurere8783db2024-08-21 12:16:031# Chromium DevTools checklist for WebAssembly features
2
3[https://goo.gle/devtools-wasm-checklist](https://goo.gle/devtools-wasm-checklist)
4
5Implementation of new WebAssembly features should take into account the developer experience in Chromium from the
6get-go to ensure a great first impression when it is shipped to developers. This document attempts to list all the
7relevant aspects of the developer tools that constitute basic functionality, which should be available when the new
8features launch (see [shipping criteria for WebAssembly
9features](https://v8.dev/docs/wasm-shipping-checklist#when-is-a-webassembly-feature-ready-to-be-shipped)).
10
11It intentionally doesn't cover extended functionality, which is optional but often desirable, and in some cases
12also required for a launch. This includes debugging capabilities specific to the feature in question.
13
14This document is the WebAssembly counterpart to the [Chromium DevTools support checklist for JavaScript language
15features](https://goo.gle/v8-checklist), which is specifically about JavaScript language features,
16
Benedikt Meurer4385a562024-08-21 13:19:5217*** note
18**IMPORTANT:** Please take a look at the [DevTools UI feature checklist](./ui.md) prior
19to changing or extending the DevTools user interface (UI).
20***
21
Benedikt Meurere8783db2024-08-21 12:16:0322[TOC]
23
24## Breakpoints and stepping
25
26Chromium DevTools handles breakpoints and stepping via the Liftoff tier in V8.
27
28### Affected
29
30All features that introduce new instructions or change the semantics of existing instructions. These will need to be
31explicitly 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
37Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools,
38select the Sources panel and locate your `.wasm` file in the Page tree. Now try to set a breakpoint in the function with the new
39instruction(s), make sure this breakpoint is hit when the function is run the next time, and also very important, check that this also
40works 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
45The 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
49All 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
55Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools,
56select the Sources panel and locate your `.wasm` file in the Page tree. Set a breakpoint inside the function with the new / changed
57instruction(s) and hit the breakpoint by invoking the function. Now when paused on the function make sure that the Scope view shows
58reasonable / correct information.
59
60
61## Syntax highlighting
62
63Chromium DevTools provides syntax highlighting for WebAssembly disassembly.
64
65### Affected
66
67All features that affect the disassembly in any way, specifically features that introduce new instructions, new types, or change the
68disassembly 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
74Create a `.wasm` file that uses the new feature and serve it from a (local) test page, open Chromium DevTools, select the Source panel and
75locate your `.wasm` file in the Page tree. The syntax highlighting of the disassembly should look alright. The syntax highlighting is handled
76by [CodeMirror](https://codemirror.net/), inside of Chromium DevTools.
77
78
79## Performance profiling
80
81Chromium DevTools allows developers to take performance traces of their applications via the Performance panel.
82
83### Affected
84
85All 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
91Create a `.wasm` file with a function inside that uses the new feature and serve it from a (local) test page, open Chromium DevTools, select
92the Performance panel. Now run the function a with some significant payload for a reasonable amount of time and take a performance profile.