Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2f60a32f8733
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e00552eaaa41
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Nov 17, 2016

  1. [Truffle] Mention jt ruby instead of jt run.

    * Notably, it uses exec() which is more practical.
    * 'run' is mostly designed for internal usage within jt now.
    eregon authored and chrisseaton committed Nov 17, 2016
    Copy the full SHA
    7044e47 View commit details
  2. Copy the full SHA
    e00552e View commit details
Showing with 19 additions and 13 deletions.
  1. +19 −13 truffle/README.md
32 changes: 19 additions & 13 deletions truffle/README.md
Original file line number Diff line number Diff line change
@@ -32,8 +32,9 @@ you can also Tweet to @chrisgseaton, or email chris.seaton@oracle.com.

## User Documentation

The JRuby wiki includes general user documentation for JRuby+Truffle. This
file is documentation for working on the development of JRuby+Truffle.
The [JRuby wiki](https://github.com/jruby/jruby/wiki/Truffle) includes general
user documentation for JRuby+Truffle. This file is documentation for working on
the development of JRuby+Truffle.

## Developer Documentation

@@ -79,7 +80,7 @@ Ruby. The ecosystem tests test commands related to Ruby. The gems tests test a
small number of key Ruby 3rd party modules.

The basic test to run every time you make changes is a subset of specs which
run in reasonable time.
runs in reasonable time.

```
$ jt test fast
@@ -96,14 +97,14 @@ don't normally run them locally unless we're working on that functionality.

### Running

`jt run` runs JRuby+Truffle. You can use it exactly as you'd run the MRI `ruby`
`jt ruby` runs JRuby+Truffle. You can use it exactly as you'd run the MRI `ruby`
command. Although it does set a couple of extra options to help you when
developing, such as loading the core lirbary from disk rather than the JAR. `jt
run` prints the real command it's running as it starts.
ruby` prints the real command it's running as it starts.

```
$ ruby ...
$ jt run ...
$ jt ruby ...
```

Note that running Ruby without any arguments does not start a shell. You should
@@ -115,14 +116,14 @@ system Ruby or a GraalVM tarball.
Specify JVM options with `-J-option`.

```
$ jt run -J-Xmx1G test.rb
$ jt ruby -J-Xmx1G test.rb
```

JRuby+Truffle options are set with `-Xtruffle...=...`. For example
`-Xtruffle.exceptions.print_java=true` to print Java exceptions before
translating them to Ruby exceptions.

To see all options run `jt run -Xtruffle...` (literally, with the three dots).
To see all options run `jt ruby -Xtruffle...` (literally, with the three dots).

You can also set JVM options in the `JAVA_OPTS` environment variable (don't
prefix with `-J`), or the `JRUBY_OPTS` variable (do prefix with `-J`). Ruby
@@ -136,27 +137,27 @@ and run with the `--graal` option.

```
$ GRAALVM_BIN=../graalvm-0.18-re/bin/java
$ jt run --graal ...
$ jt ruby --graal ...
```

You can check this is working by printing the value of `Truffle::Graal.graal?`.

```
$ GRAALVM_BIN=../graalvm-0.18-re/bin/java
$ jt run --graal -e 'p Truffle::Graal.graal?'
$ jt ruby --graal -e 'p Truffle::Graal.graal?'
```

To run with Graal built from source, set `GRAAL_HOME`.

```
$ GRAAL_HOME=../../graal/graal-core-workspace/graal-core
$ jt run --graal ...
$ jt ruby --graal ...
```

Set Graal options as any other JVM option.

```
$ jt run --graal -J-Dgraal.TraceTruffleCompilation=true ...
$ jt ruby --graal -J-Dgraal.TraceTruffleCompilation=true ...
```

We have flags in `jt` to set some options, such as `--trace` for
@@ -170,7 +171,7 @@ things partially evaluate as we expect, that things optimise as we'd expect,
that on-stack-replacement works and so on.

```
$ ... jt test compiler
$ jt test compiler
```

### Benchmarking with Graal
@@ -215,3 +216,8 @@ is intended for special cases such as integrating with other Graal projects, and
we wouldn't recommend using it for normal development. If you do use it, you
should clean before using `jt` again as having built it with `mx` will change
some behaviour.

### IDEs

The majority of us use IntelliJ IDEA, but it's also [possible to use
Eclipse](https://github.com/jruby/jruby/wiki/Using-Eclipse-with-JRuby-Truffle).