Skip to content

Commit 7d272da

Browse files
committed
docs/embedding, docs/java, docs/java-on-truffle, docs/llvm, docs/wasm update ref links to rel paths; start sentences from a new line
1 parent 0a9f907 commit 7d272da

17 files changed

+125
-190
lines changed

docs/reference-manual/embedding/embed-languages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ beneath each code example to choose between JavaScript, R, Ruby, and Python.
3131
Ensure you set up GraalVM before you begin.
3232

3333
## Compile and Run a Polyglot Application
34-
GraalVM can run polyglot applications written in any language implemented with the [Truffle language implementation framework](/graalvm-as-a-platform/language-implementation-framework/).
34+
GraalVM can run polyglot applications written in any language implemented with the [Truffle language implementation framework](../../graalvm-as-a-platform/truffle/README.md).
3535
These languages are henceforth referenced as **guest languages**.
3636

3737
Complete the steps in this section to create a sample polyglot
@@ -543,12 +543,12 @@ public class Main {
543543
public static void main(String[] args) {
544544
try (Context outer = Context.newBuilder()
545545
.allowAllAccess(true)
546-
.build()) {
546+
.build()) {
547547
outer.eval("js", "inner = Java.type('org.graalvm.polyglot.Context').create()");
548548
outer.eval("js", "value = inner.eval('js', '({data:42})')");
549549
int result = outer.eval("js", "value.data").asInt();
550550
outer.eval("js", "inner.close()");
551-
551+
552552
System.out.println("Valid " + (result == 42));
553553
}
554554
}

docs/reference-manual/embedding/sandbox-options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The following document describes how to configure sandbox resource limits using
66

77
In general all resource limit options are prefixed with `sandbox` option group and they can be listed using the help of any language launcher provided in GraalVM e.g. `js --help:tools`.
88
Polyglot options can be provided through the language launcher, using the polyglot embedding API of the Graal SDK, or on the JVM using a system property.
9-
For better understanding of the examples it is recommended to read the [polyglot embedding guide](/reference-manual/embed-languages/) of the reference manual first.
9+
For better understanding of the examples it is recommended to read the [polyglot embedding guide](embed-languages.md) of the reference manual first.
1010

1111
Currently all sandbox options are experimental therefore in these examples it is assumed that experimental options are enabled (e.g. with `--experimental-options`).
1212
The options are a best effort approach to limiting resource usage of guest applications.

docs/reference-manual/java-on-truffle/Demos.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ GraalVM Native Image technology allows compiling applications ahead-of-time (AOT
131131
The main trade off for using Native Image is that the analysis and compilation of your program happens under the closed world assumption, meaning the static analysis needs to process all bytecode which will ever be executed in the application.
132132
This makes using some language features like dynamic class loading or reflection tricky.
133133
134-
Java on Truffle is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/).
134+
Java on Truffle is a JVM implementation of a JVM bytecode interpreter, built on the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md).
135135
It is essentially a Java application, as are the Truffle framework itself and the GraalVM JIT compiler.
136136
All three of them can be compiled ahead-of-time with `native-image`.
137137
Using Java on Truffle for some parts of your application makes it possible to isolate the required dynamic behaviour and still use the native image on the rest of your code.
@@ -144,9 +144,9 @@ It is a REPL capable of evaluating Java code and consists of two parts:
144144
This design naturally fits the point we are trying to illustrate. We can build a native executable of the JShell's UI part, and make it include Java on Truffle to run the code dynamically specified at run time.
145145

146146
Prerequisites:
147-
* [GraalVM 21.0](/downloads/)
148-
* [Native Image](/reference-manual/native-image/#install-native-image)
149-
* [Java on Truffle](/reference-manual/java-on-truffle/#install-java-on-truffle)
147+
* [GraalVM 21.0](https://www.graalvm.org/downloads/)
148+
* [Native Image](../native-image/README.md/#install-native-image)
149+
* [Java on Truffle](README.md/#install-java-on-truffle)
150150

151151

152152
1. Clone the [project](https://github.com/graalvm/graalvm-demos) with the demo applications and navigate to the `espresso-jshell` directory:

docs/reference-manual/java-on-truffle/FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ That means it can only run a Java program once it has been compiled to Java byte
1414
In the GraalVM family, this is similar to WebAssembly or the LLVM interpreter: while both can run C programs, they have to be complied by a C compiler first.
1515

1616
### Does Java running on Truffle run on HotSpot too?
17-
Like other languages implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/), it can run both as a native image or on top of HotSpot.
17+
Like other languages implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md), it can run both as a native image or on top of HotSpot.
1818
Running on top of HotSpot is currently only possible on Linux.
1919
We plan to extend this capability to macOS and Windows platforms also.
2020

docs/reference-manual/java-on-truffle/HotSwapPluginAPI.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permalink: /reference-manual/java-on-truffle/hotswap-plugin/
77

88
# Truffle on Java HotSwap Plugin API
99

10-
With Java on Truffle you can benefit from enhanced HotSwap [capabilites](/reference-manual/java-on-truffle/demos/#enhanced-hotswap-capabilities-with-java-on-truffle) that allow the code to evolve naturally during development without the need for restarting a running application.
10+
With Java on Truffle you can benefit from enhanced HotSwap [capabilites](Demos.md/#enhanced-hotswap-capabilities-with-java-on-truffle) that allow the code to evolve naturally during development without the need for restarting a running application.
1111
1212
While code reloading (HotSwap) is a powerful tool, it is not sufficient to reflect all kinds of changes, e.g., changes to annotations, framework-specific changes such as implemented services or beans.
1313
For these things the code often needs to be executed to reload configurations or contexts before the changes are fully reflected in the running instance.
@@ -18,7 +18,7 @@ The main design principle is that you can register various HotSwap listeners tha
1818
Examples include the ability to re-run a static initializer, a generic post HotSwap callback and hooks when implementations for a certain service provider changes.
1919
2020
**Note**: The HotSwap Plugin API is under development and more fine-grained registration of HotSwap listeners are likely to be added upon requests from the community.
21-
You are welcomed to send enhancement requests to help shape the API through our community support [channels](/community/).
21+
You are welcomed to send enhancement requests to help shape the API through our community support [channels](https://www.graalvm.org/community/).
2222

2323
Review the HotSwap Plugin API by going through a running example that will enable more powerful reloading support on [Micronaut](https://micronaut.io/).
2424
@@ -138,7 +138,7 @@ Here is a sample application created from the tutorial ["Creating your first Mic
138138
Example's sources can be downloaded as a ready-made Gradle project from [here](https://guides.micronaut.io/latest/micronaut-creating-first-graal-app-gradle-java.zip).
139139
Download, unzip and open the project in your IDE.
140140

141-
Before you proceed, make sure that you have Java on Truffle [installed](/reference-manual/java-on-truffle/#install-java-on-truffle) and set the GraalVM as the project SDK.
141+
Before you proceed, make sure that you have Java on Truffle [installed](README.md/#install-java-on-truffle) and set the GraalVM as the project SDK.
142142
143143
1. In your IDE navigate to the root `build.gradle` within the sample project. Add:
144144

docs/reference-manual/java-on-truffle/ImplementationDetails.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Java on Truffle is a minified Java VM that implements all core components of a V
2121
* Java Debug Wire Protocol (JDWP)
2222

2323
Java on Truffle reuses all JARs and native libraries from GraalVM.
24-
All native libraries and methods are loaded/accessed/called via [Truffle Native Function Interface (JNI)](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/NFI/).
24+
All native libraries and methods are loaded/accessed/called via [Truffle Native Function Interface (JNI)](../../graalvm-as-a-platform/truffle/NFI.md).
2525
JNI handles are implemented in Java on Truffle, e.g., all Truffle NFI methods only receive and return primitives.
2626
Some methods are substituted for performance, e.g., `Math.sqrt`, `System.arraycopy`, avoiding the expensive transition to native.
2727

@@ -33,8 +33,8 @@ This mode is not used when running in a native image since there will be no conf
3333

3434
* Java on Truffle does not implement the [JVM Tool Interface (JVMTI)](https://docs.oracle.com/en/java/javase/11/docs/specs/jvmti.html). As a result, it does not support the `-agentlib`, or `-agentpath` VM options.
3535
* Java on Truffle does not implement the `java.lang.instrument` interface. As a result it does not support the `-javaagent` VM option.
36-
* Java on Truffle currently uses the standard native libraries from the Java core library. This requires allowing a polyglot `Context` native access. Because of the way these libraries are loaded (via [Truffle NFI](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/NFI/)), running on top of HotSpot only works on Linux (with `glibc`). Running as part of a native image works on Linux, Windows, and macOS but it currently limited to one context.
36+
* Java on Truffle currently uses the standard native libraries from the Java core library. This requires allowing a polyglot `Context` native access. Because of the way these libraries are loaded (via [Truffle NFI](../../graalvm-as-a-platform/truffle/NFI.md)), running on top of HotSpot only works on Linux (with `glibc`). Running as part of a native image works on Linux, Windows, and macOS but it currently limited to one context.
3737
* Support for [Java Management Extensions (JMX)](https://docs.oracle.com/javase/tutorial/jmx/index.html) is partial and some methods might return partial data.
38-
* The [Debugger Protocol Implementation (JDWP)](https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/jdwp-spec.html) lacks some capabilities compared to HotSpot. It will correctly report the supported [capabilities](https://docs.oracle.com/javase/8/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Capabilities). In particular actions that require to enumerate all Java objects are not supported. However it does support a few hot reloading cases that HotSpot does not. See [Enhanced HotSwap Capabilities with Java on Truffle](/reference-manual/java-on-truffle/demos/#enhanced-hotswap-capabilities-with-java-on-truffle).
38+
* The [Debugger Protocol Implementation (JDWP)](https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/jdwp-spec.html) lacks some capabilities compared to HotSpot. It will correctly report the supported [capabilities](https://docs.oracle.com/javase/8/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_VirtualMachine_Capabilities). In particular actions that require to enumerate all Java objects are not supported. However it does support a few hot reloading cases that HotSpot does not. See [Enhanced HotSwap Capabilities with Java on Truffle](Demos.md/#enhanced-hotswap-capabilities-with-java-on-truffle).
3939
* When the `java.MultiThreaded` option is set to "false", [reference processing](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ref/package-summary.html) will not happen. Depending on the application, this could create resource leaks. Note that this option is set to "false" automatically if Java on Truffle runs in a context where a single-threaded language is enabled (e.g., JavaScript).
40-
* Java on Truffle does not support the [Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) yet. However, it provides a guest Java Polyglot API, described in `polyglot.jar`. For more information, see [Interoperability with Truffle Languages](/reference-manual/java-on-truffle/interoperability/).
40+
* Java on Truffle does not support the [Polyglot API](https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/package-summary.html) yet. However, it provides a guest Java Polyglot API, described in `polyglot.jar`. For more information, see [Interoperability with Truffle Languages](Interoperability.md).

docs/reference-manual/java-on-truffle/Interoperability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permalink: /reference-manual/java-on-truffle/interoperability/
77

88
# Interoperability with Truffle Languages
99

10-
Java on Truffle allows you to interface other "Truffle" languages (languages which interpreters are implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/)) to create polyglot programs -- programs written in more than one language.
10+
Java on Truffle allows you to interface other "Truffle" languages (languages which interpreters are implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md)) to create polyglot programs -- programs written in more than one language.
1111

1212
This guide describes how to load code written in foreign languages, how to export and import objects between languages, how to use Java on Truffle objects from a foreign language, how to use foreign objects from Java on Truffle, and how to embed in host Java.
1313

docs/reference-manual/java-on-truffle/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ permalink: /reference-manual/java-on-truffle/
77

88
# Java on Truffle
99

10-
Using GraalVM, you can run Java applications normally [on the JVM](/reference-manual/java/), in [Native Image](/reference-manual/native-image/), and now on Truffle.
10+
Using GraalVM, you can run Java applications normally [on the JVM](../java/README.md), in [Native Image](../native-image/README.md), and now on Truffle.
1111
Java on Truffle is an implementation of the Java Virtual Machine Specification, [Java SE 8](https://docs.oracle.com/javase/specs/jvms/se8/html/index.html) and [Java SE 11](https://docs.oracle.com/javase/specs/jvms/se11/html/index.html), built upon GraalVM as a Truffle interpreter.
1212
It is a minified Java VM that includes all core components of a VM, implements the same API as the Java Runtime Environment library (libjvm.so), and reuses all JARs and native libraries from GraalVM.
13-
See the [Implementation Details](/reference-manual/java-on-truffle/implementation/) for more information.
13+
See the [Implementation Details](ImplementationDetails.md) for more information.
1414
The project name behind this implementation is "Espresso".
1515
Its open source version is available on [GitHub](https://github.com/oracle/graal/tree/master/espresso).
1616

17-
The Java on Truffle execution mode runs Java via a Java bytecode interpreter, implemented with the [Truffle framework](/graalvm-as-a-platform/language-implementation-framework/) – an open-source library for writing interpreters for programming languages.
17+
The Java on Truffle execution mode runs Java via a Java bytecode interpreter, implemented with the [Truffle framework](../../graalvm-as-a-platform/truffle/README.md) – an open-source library for writing interpreters for programming languages.
1818
Now Java can be executed by the same principle as other languages in the GraalVM ecosystem (JavaScript, Ruby, Python, R), directly interoperate with those languages, and pass data back and forth in the same memory space.
1919
Besides complete language interoperability, with Java on Truffle you can:
2020

@@ -28,8 +28,8 @@ It is available as of version 21.0.0.
2828

2929
## Install Java on Truffle
3030

31-
To run Java on Truffle, you need to have [GraalVM installed](/docs/getting-started/#install-graalvm).
32-
The Java on Truffle runtime is not available by default, but can be easily added to GraalVM using the [GraalVM Updater tool](/reference-manual/graalvm-updater/).
31+
To run Java on Truffle, you need to have [GraalVM installed](../../getting-started/graalvm-community/get-started-graalvm-community.md).
32+
The Java on Truffle runtime is not available by default, but can be easily added to GraalVM using the [GraalVM Updater tool](../graalvm-updater.md).
3333

3434
For GraalVM Community Edition users, run the following command to install Java on Truffle from the GitHub catalog:
3535
```shell
@@ -81,7 +81,7 @@ You can still influence the performance by passing the following options to `jav
8181
* `--engine.MultiTier=true` to enable multi-tier compilation;
8282
* `--engine.Inlining=false` in combination with `--java.InlineFieldAccessors=true` to make the compilation faster, in exchange for slower performance.
8383

84-
The `--vm.XX:` syntax ensures the option is passed to the underlying [native image VM](https://www.graalvm.org/reference-manual/native-image/HostedvsRuntimeOptions).
84+
The `--vm.XX:` syntax ensures the option is passed to the underlying [native image VM](../native-image/HostedvsRuntimeOptions.md).
8585
When using the `-XX:` syntax, the VM first checks if there is such an option in the Java on Truffle runtime.
8686
If there is none, it will try to apply this option to the underlying native image VM.
8787
This might be important for options such as `MaxDirectMemorySize` which can be set independently at both levels: `-XX:MaxDirectMemorySize=256M` controls how much native memory can be reserved by the Java program running on Truffle (the guest VM), while `--vm.XX:MaxDirectMemorySize=256M` controls how much native memory can be reserved by native image (the host VM).
@@ -167,11 +167,11 @@ It should show GraalVM as project's JRE and VM options should include `-truffle
167167
## What to Read Next
168168

169169
Java on Truffle enables a seamless Java interoperability with other languages in the GraalVM ecosystem.
170-
Check the [Interoperability with Truffle Languages guide](/reference-manual/java-on-truffle/interoperability/) to learn how to load code written in foreign languages, export and import objects between languages, how to use Java-on-Truffle objects from a foreign language and vice versa to create powerful polyglot programs.
170+
Check the [Interoperability with Truffle Languages guide](Interoperability.md) to learn how to load code written in foreign languages, export and import objects between languages, how to use Java-on-Truffle objects from a foreign language and vice versa to create powerful polyglot programs.
171171

172-
To learn about the implementation approach, project's current status, and known limitations proceed to [Implementation Details](/reference-manual/java-on-truffle/implementation/).
172+
To learn about the implementation approach, project's current status, and known limitations proceed to [Implementation Details](ImplementationDetails.md).
173173

174174
You can already run some large applications like the Eclipse IDE, Scala or other languages REPLs, etc. in the Java on Truffle execution mode.
175-
We recommend having a look at the collection of [Demo Applications](/reference-manual/java-on-truffle/demos/).
175+
We recommend having a look at the collection of [Demo Applications](Demos.md).
176176

177-
If you have a question, check the available [FAQs](/reference-manual/java-on-truffle/faq/), or reach us directly over the **#espresso** channel in [GraalVM Slack](https://www.graalvm.org/slack-invitation/).
177+
If you have a question, check the available [FAQs](FAQ.md), or reach us directly over the **#espresso** channel in [GraalVM Slack](https://www.graalvm.org/slack-invitation/).

0 commit comments

Comments
 (0)