Mercurial > hg > truffle
comparison README_GRAAL.txt @ 11644:e9fc19eb3efb
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 13 Sep 2013 23:12:10 +0200 |
parents | a8132e3fd0d8 |
children |
comparison
equal
deleted
inserted
replaced
11643:2bd626188d31 | 11644:e9fc19eb3efb |
---|---|
9 Building both the Java and C++ source code comprising the Graal VM | 9 Building both the Java and C++ source code comprising the Graal VM |
10 can be done with the following simple command. | 10 can be done with the following simple command. |
11 | 11 |
12 % mx build | 12 % mx build |
13 | 13 |
14 This builds the 'product' version of HotSpot with the Graal modifications. | 14 There are a number of VM configurations supported by mx which can |
15 To build the debug or fastdebug versions: | 15 be explicitly specified using the --vm option. However, you'll typically |
16 want one of these VM configurations: | |
16 | 17 |
17 mx build debug | 18 1. The 'server' configuration is a standard HotSpot VM that includes the |
18 mx build fastdebug | 19 runtime support for Graal but uses the existing compilers for normal |
20 compilation (e.g., when the interpreter threshold is hit for a method). | |
21 Compilation with Graal is only done by explicit requests to the | |
22 Graal API. This is how Truffle uses Graal. | |
23 | |
24 2. The 'graal' configuration is a VM where all compilation is performed | |
25 by Graal and no other compilers are built into the VM binary. This | |
26 VM will bootstrap Graal itself at startup unless the -XX:-BootstrapGraal | |
27 VM option is given. | |
28 | |
29 Unless you use the --vm option with the build command, you will be presented | |
30 with a dialogue to choose one of the above VM configurations for the build | |
31 as well as have the option to make it your default for subsequent commands | |
32 that need a VM specified. | |
33 | |
34 To build the debug or fastdebug builds: | |
35 | |
36 % mx --vmbuild debug build | |
37 % mx --vmbuild fastdebug build | |
19 | 38 |
20 Running Graal | 39 Running Graal |
21 ------------- | 40 ------------- |
22 | 41 |
23 To run the VM, use 'mx vm' in place of the standard 'java' command: | 42 To run the VM, use 'mx vm' in place of the standard 'java' command: |
24 | 43 |
25 % mx vm ... | 44 % mx vm ... |
26 | 45 |
27 To select the fastdebug or debug versions of the VM: | 46 To select the fastdebug or debug builds of the VM: |
28 | 47 |
29 % mx --fastdebug vm ... | 48 % mx --vmbuild fastdebug vm ... |
30 % mx --debug vm ... | 49 % mx --vmbuild debug vm ... |
31 | 50 |
32 Graal has an optional bootstrap step where it compiles itself before | 51 Other VM Configurations |
33 compiling any application code. This bootstrap step currently takes about 7 seconds | 52 ----------------------- |
34 on a fast x64 machine. It's useful to disable this bootstrap step when running small | |
35 programs with the -XX:-BootstrapGraal options. For example: | |
36 | 53 |
37 % mx vm -XX:-BootstrapGraal ... | 54 In addition to the VM configurations described above, there are |
55 VM configurations that omit all VM support for Graal: | |
38 | 56 |
57 % mx --vm server-nograal build | |
58 % mx --vm server-nograal vm -version | |
59 java version "1.7.0_25" | |
60 Java(TM) SE Runtime Environment (build 1.7.0_25-b15) | |
61 OpenJDK 64-Bit Server VM (build 25.0-b43-internal, mixed mode) | |
39 | 62 |
40 Other Build Configurations | 63 % mx --vm client-nograal build |
41 -------------------------- | 64 % mx --vm client-nograal vm -version |
65 java version "1.7.0_25" | |
66 Java(TM) SE Runtime Environment (build 1.7.0_25-b15) | |
67 OpenJDK 64-Bit Cleint VM (build 25.0-b43-internal, mixed mode) | |
42 | 68 |
43 By default the build commands above create a HotSpot binary where Graal | 69 These configurations aim to match as closely as possible the |
44 is the only compiler. This binary is the Graal VM binary and identifies as | 70 VM(s) included in the OpenJDK binaries one can download. |
45 such with the -version option: | |
46 | |
47 % mx vm -XX:-BootstrapGraal -version | |
48 java version "1.7.0_07" | |
49 Java(TM) SE Runtime Environment (build 1.7.0_07-b10) | |
50 OpenJDK 64-Bit Graal VM (build 25.0-b10-internal, mixed mode) | |
51 | |
52 It's also possible to build and execute the standard HotSpot binaries | |
53 using the --vm option: | |
54 | |
55 % mx --vm server build | |
56 % mx --vm server vm -version | |
57 java version "1.7.0_07" | |
58 Java(TM) SE Runtime Environment (build 1.7.0_07-b10) | |
59 OpenJDK 64-Bit Server VM (build 25.0-b10-internal, mixed mode) | |
60 | |
61 These standard binaries still include the code necessary to support use of the | |
62 Graal compiler for explicit compilation requests. However, in this configuration | |
63 the Graal compiler will not service VM issued compilation requests (e.g., upon | |
64 counter overflow in the interpreter). | |
65 | |
66 To build a HotSpot binary that completely omits all VM support for Graal, | |
67 define an environment variable OMIT_GRAAL (its value does not matter) and build | |
68 with the --vm option as above (doing a clean first if necessary): | |
69 | |
70 % env OMIT_GRAAL= mx --vm server build |