Skip to content

Commit

Permalink
remove documentation of deleted --vm-compiler option
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed Jun 16, 2016
1 parent 4d8c523 commit b2bcb07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,26 @@ mx build
mx vm
```

The first time it's run, the `mx vm` step above will present you with a dialogue asking which top tier compiler the VM should use: `server` or `jvmci`. This is only for compilations requested by the VM (e.g., when a method becomes _hot_). If you select `server`, the C2 compiler will be used otherwise Graal will be used. Truffle requested compilations will always use the `jvmci` compiler (i.e., Graal).
By default, Graal is only used for hosted compilation. To make the VM use it as the top tier JIT compiler, add the `-XX:+UseJVMCICompiler` option to the command line. To disable use of Graal altogether, use `-XX:-EnableJVMCI`.

## IDE Configuration

You can generate IDE project configurations by running:

```
mx ideinit
```

This will generate both Eclipse and NetBeans project configurations. Further information on how to import these project configurations into Eclipse can be found [here](docs/Eclipse.md).

The Graal code base includes the [Ideal Graph Visualizer](http://ssw.jku.at/General/Staff/TW/igv.html) which is very useful in terms of visualizing Graal's intermediate representation (IR). You can get a quick insight into this tool by running the commands below. The first command launches the tool and the second runs one of the unit tests included in the Graal code base with extra options to make Graal output the IR for all methods it compiles to the tool. You should wait for the GUI to appear before running the second command.

```
mx igv &
mx unittest -G:Dump= BC_athrow0
```
If you selected `jvmci` as the VM compiler above, you will see IR for compilations requested by the VM itself in addition to compilations requested by the unit test. The former are those with a prefix in the UI denoting the compiler thread and id of the compilation (e.g., `JVMCI CompilerThread0:390`).

If you added `-XX:+UseJVMCICompiler` as described above, you will see IR for compilations requested by the VM itself in addition to compilations requested by the unit test. The former are those with a prefix in the UI denoting the compiler thread and id of the compilation (e.g., `JVMCI CompilerThread0:390`).

The first time you run `mx igv`, the Ideal Graph Visualizer will be transparently built. This only works if `ant` has internet access because it needs to download the NetBeans platform packages. You therefore have to configure `ant` to use proxies if necessary (e.g., set `ANT_ARGS=-autoproxy` in your environment).

Expand Down
13 changes: 9 additions & 4 deletions docs/Debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ This pages covers the various mechanisms currently available for debugging Graal
All the parts of Graal written in Java can be debugged with a standard Java debugger. While debugging with Eclipse is described here, it should not be too hard to adapt these instructions for another debugger.

The `mx eclipseinit` command not only creates Eclipse project configurations but also creates an Eclipse launch configuration (in `mx.graal-core/eclipse-launches/graal-core-attach-localhost-8000.launch`) that can be used to debug all Graal code running in the VM. This launch configuration requires you to start the VM with the `-d` global option which puts the VM into a state waiting for a remote debugger to attach to port `8000`:

```
mx -d vm -version
mx -d vm -XX:+UseJVMCICompiler -version
Listening for transport dt_socket at address: 8000
```

Note that the `-d` option applies to any command that runs the VM, such as the `mx unittest` command:

```
mx -d vm unittest
Listening for transport dt_socket at address: 8000
```

Once you see the message above, you then run the Eclipse launch configuration:

1. From the main menu bar, select **Run > Debug Configurations...** to open the Debug Configurations dialogue.
Expand Down Expand Up @@ -203,7 +207,8 @@ This option however comes with a small but constant overhead for the lookup of t

Assuming you are interested in the phase times during the compilation of a certain method consider the following example that will intercept global timers during the compilation of the method `Long.bitCount`:
```
mx --vm-compiler jvmci dacapo
mx dacapo
-XX:+UseJVMCICompiler
-G:MethodMeter=FrontEnd
-G:Time=FrontEnd
-G:GlobalMetricsInterceptedByMethodMetrics=Timers
Expand Down Expand Up @@ -268,7 +273,7 @@ Various other VM options are of interest to see activity related to compilation:

To see the compiler data structures used while compiling `Node.updateUsages`, use the following command:
```
mx --vm-compiler jvmci vm -XX:+BootstrapJVMCI -XX:-TieredCompilation -G:Dump= -G:MethodFilter=Node.updateUsages -version
mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -G:Dump= -G:MethodFilter=Node.updateUsages -version
Bootstrapping JVMCI....Connected to the IGV on 127.0.0.1:4445
CFGPrinter: Output to file /Users/dsimon/graal/graal-core/compilations-1456505279711_1.cfg
CFGPrinter: Dumping method HotSpotMethod<Node.updateUsages(Node, Node)> to /Users/dsimon/graal/graal-core/compilations-1456505279711_1.cfg
Expand All @@ -288,6 +293,6 @@ You'll notice that no output is sent to the IGV by this command.
Alternatively, you can see the machine code using [HotSpot's PrintAssembly support](https://wiki.openjdk.java.net/display/HotSpot/PrintAssembly):
```
mx hsdis
mx --vm-compiler jvmci vm -XX:+BootstrapJVMCI -XX:-TieredCompilation -XX:CompileCommand='print,*Node.updateUsages' -version
mx vm -XX:+UseJVMCICompiler -XX:+BootstrapJVMCI -XX:-TieredCompilation -XX:CompileCommand='print,*Node.updateUsages' -version
```
The first step above installs the [hsdis](https://kenai.com/projects/base-hsdis) disassembler and only needs to be performed once.

0 comments on commit b2bcb07

Please sign in to comment.