Visualizing The Intermediate Representation JIT Compilers
Publication
Lim, H., Kobourov, S. (2021). Visualizing JIT Compiler Graphs. In: Purchase, H.C., Rutter, I. (eds) Graph Drawing and Network Visualization. GD 2021. Lecture Notes in Computer Science(), vol 12868. Springer, Cham. https://doi.org/10.1007/978-3-030-92931-2_10
Requirements
- Pin Tool
- V8 executable - D8
- Tracer and Trace Reader
- You might need a permission to access the tracer tool.
- Python Version 3.7
Chromium Bug Report Site
Steps
- git clone https://github.com/hlim1/JITCompilerIRViz.git
- Checkout to the target Git commit of V8 version that holds a bug.
- e.g. git checkout 1006f3cd23d1cd7134452c987d10a124aab1d350
- Modify the GenerateBytecodeHandler function in v8/src/interpreter/interpreter-generator.cc to print the list of bytecodes.
- e.g. printf(“%hhx;”, bytecode); std::cout « bytecode « std::endl;
- Build V8 executable (D8) using GN by following the instruction on V8 documentation.
- list of bytecode (Hex:Ascii) will be printed during the build.
- Convert printed bytecode list to hex to json file under the format {“hex”:”Ascii”}.
- We provide bytecode_json_generator.py to generate the json file if the user used our example in the step 3.
- _python3 bytecode_json_generator.py -f _bytecode_list__
- Collect Proof-of-Concept (PoC) code from the bug report.
- Move to src file.
- cd JITCompilerIRViz/src
- Run Main.py with the options.
- python3 Main.py -f _PoC.js -e d8_executable -b bytecode_json_file -d directory_to_store_generated_temporary_files -n number_of PoCs_to_generate -o _output_csv_file_name__
- Navigate to MetroSet
- Check the CSV file was generated.
- Follow the instruction on MetroSet to generate the map.