Browse Source

Fix Grammar and Links in Docs (#2984)

* Fix grammar and improve flow in `debugging.md`

* Fix architecture image's background

* Update link to JavaScript shell

* Readd original drawio diagram
pull/2995/head
Veera 12 months ago committed by GitHub
parent
commit
7b5b6b305c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      docs/debugging.md
  2. BIN
      docs/img/boa_architecture.png
  3. 4
      docs/vm.md

7
docs/debugging.md

@ -37,15 +37,14 @@ cargo run -- --dump-ast # AST dump format is Debug by default.
## Bytecode generation and Execution
Once the AST has been generated boa will compile it into bytecode.
The bytecode is then executed by the vm.
Once the AST has been generated, boa will compile it into bytecode, which is then executed by the VM.
You can print the bytecode and the executed instructions with the command-line flag `--trace`.
For more detailed information about the vm and the trace output look [here](./vm.md).
For more detailed information about the VM and the trace output look [here](./vm.md).
## Instruction flowgraph
We can to get the vm instructions flowgraph, which is a visual representation of the instruction flow.
We can also get the VM instructions flowgraph, which is a visual representation of the instruction flow.
The `Start` (in green) and `End` (in red) node in the graph represents the start and end point of execution.
They are not instructions, just markers.

BIN
docs/img/boa_architecture.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

4
docs/vm.md

@ -2,7 +2,7 @@
## Architecture
![image](img/boa_architecture.drawio.png)
![image](img/boa_architecture.png)
## Understanding the trace output
@ -71,7 +71,7 @@ The above output contains the following information:
### Comparing ByteCode output
If you wanted another engine's bytecode output for the same JS, SpiderMonkey's bytecode output is the best to use. You can follow the setup [here](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell). You will need to build from source because the pre-built binarys don't include the debugging utilities which we need.
If you wanted another engine's bytecode output for the same JS, SpiderMonkey's bytecode output is the best to use. You can follow the setup [here](https://udn.realityripple.com/docs/Mozilla/Projects/SpiderMonkey/Introduction_to_the_JavaScript_shell). You will need to build from source because the pre-built binarys don't include the debugging utilities which we need.
I named the binary `js_shell` as `js` conflicts with NodeJS. Once up and running you should be able to use `js_shell -f tests/js/test.js`. You will get no output to begin with, this is because you need to run `dis()` or `dis([func])` in the code. Once you've done that you should get some output like so:

Loading…
Cancel
Save