| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
V4's baseline JIT uses some old JavaScriptCore code to
optimize functions.
As part of the offering, it is possible to use a disassembler, if
enabled, to peek into the code that the JIT has generated for a
function.
For i386 and x86_64 udis86 is used, of which we bundle a very old
version.
To build and make use of udis86 it is necessary to generate some code
running some bundled python scripts.
The scripts are still written for a python2 target, which has long been
sunsetted, making the scripts difficult to run on more modern systems.
To allow the scripts to be run more easily, some modifications were made
to support more modern pythons versions.
In particular, print statements were modified to print functions.
Furthermore, usages of the division operator("/") were modified to the
integer division operator("//"), as the meaning of "/" was changed to
non-integer division between python 2 and 3.
Finally, a usage of the sort method was modified with self assignment to
a `sorted()` value, due to python 3 not returning a list anymore, which
has a sort method, on dict's `items` method.
The changes are expected to mostly be semantically compatible, albeit it
wasn't ascertained whether the behavior of other parts of the script
might have been silently hit when running on a more modern python
version.
Informally, the script was used with a python 3.13 version, and the
generated code was used to disassemble a few jitted function with
success during an unrelated bug investigation.
Change-Id: Ide0bcf4d29a51759f9bb9bd07d940562a8cfcc04
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|