Skip to content

Commit

Permalink
Fix Grammar and Links in Docs (#2984)
Browse files Browse the repository at this point in the history
* Fix grammar and improve flow in `debugging.md`

* Fix architecture image's background

* Update link to JavaScript shell

* Readd original drawio diagram
  • Loading branch information
veera-sivarajan authored Jun 3, 2023
1 parent 2fa9c65 commit 7b5b6b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions docs/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file added docs/img/boa_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Architecture

![image](img/boa_architecture.drawio.png)
![image](img/boa_architecture.png)

## Understanding the trace output

Expand Down Expand Up @@ -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:

Expand Down

0 comments on commit 7b5b6b3

Please sign in to comment.