Skip to content

Commit d1d1aba

Browse files
committed
[GR-32720] Fix links
PullRequest: graal/9966
2 parents 6d8a3ea + 3b2dd8f commit d1d1aba

File tree

7 files changed

+30
-25
lines changed

7 files changed

+30
-25
lines changed

docs/examples/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Here you can also find an even more sophisticated example of polyglot native exe
2020

2121
The [Java/Kotlin Native Image Example](java-kotlin-aot.md) demonstrates how to compile a Java and Kotlin application ahead-of-time, and illustrates the performance gain.
2222

23-
The [Oracle Database Example](examples/mle-oracle.md) contains instructions on how to run the Oracle Database Multilingual Engine (MLE) which is the integration of GraalVM in the Oracle
23+
The [Oracle Database Example](mle-oracle.md) contains instructions on how to run the Oracle Database Multilingual Engine (MLE) which is the integration of GraalVM in the Oracle
2424
Database 21c.

docs/reference-manual/java/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ This mode allows you to [debug the GraalVM compiler with a Java debugger](Operat
3333

3434
## Interoperability
3535

36-
In addition to running JVM-based languages on GraalVM, you can also call any other language implemented with the [Truffle language implementation framework](../truffle-framework/README.md) directly from Java.
37-
See the [Polyglot Programming](../polyglot-programming.md) and [Embedding Languages](../embed-languages.md) guides for more information about interoperability with other programming languages.
36+
In addition to running JVM-based languages on GraalVM, you can also call any other language implemented with the [Truffle language implementation framework](../../../truffle/docs/README.md) directly from Java.
37+
See the [Polyglot Programming](../polyglot-programming.md) and [Embedding Languages](../embedding/embed-languages.md) guides for more information about interoperability with other programming languages.

docs/reference-manual/languages.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ GraalVM's polyglot capabilities make it possible to mix multiple programming lan
1313
If you are mostly interested in GraalVM's support for a specific language, here you can find the most extensive documentation:
1414
* [Java](java/README.md)
1515
* [Java on Truffle](java-on-truffle/README.md)
16-
* [JavaScript and Node.js](js/README.md)
16+
* [JavaScript and Node.js](https://github.com/oracle/graaljs/blob/master/docs/user/README.md)
1717
* [LLVM Languages](llvm/README.md)
18-
* [Python](python/README.md)
19-
* [R](r/README.md)
20-
* [Ruby](ruby/README.md)
18+
* [Python](https://github.com/oracle/graalpython/blob/master/docs/user/README.md)
19+
* [R](https://github.com/oracle/fastr/blob/master/documentation/user/README.md)
20+
* [Ruby](https://github.com/oracle/truffleruby/blob/master/doc/user/README.md)
2121
* [WebAssembly](wasm/README.md)

docs/tools/graalvm-insight.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Hello from GraalVM Ruby!
146146
It is necessary to start the Ruby launcher with the `--polyglot` parameter, as the _source-tracing.js_ script remains written in JavaScript.
147147

148148
A user can instrument any language on top of GraalVM, but also the Insight scripts can be
149-
written in any of the GraalVM supported languages (implemented with the [Truffle language implementation framework](../graalvm-as-a-platform/truffle-framework/README.md)).
149+
written in any of the GraalVM supported languages (implemented with the [Truffle language implementation framework](../../truffle/docs/README.md)).
150150

151151
1. Create the _source-tracing.rb_ Ruby file:
152152
```ruby

docs/tools/vscode/micronaut/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ For more details, continue reading to the [Micronaut documentation](https://guid
112112
The Micronaut support in VSCode also allows to build and deploy Docker image to a Docker Registry.
113113
Use action View > Command Palette > Micronaut: Deploy... and select **dockerPush** to deploy dockerized Micronaut application or **dockerPushNative** to build and push docker with a native executable of Micronaut application.
114114

115-
![Micronaut Deploy Commands](images/micronaut-deploy-commands.png)
116-
117115
Besides that, you can also push a Micronaut application or a native executable to a Docker Registry from the VS Code terminal window. A particular Docker Registry can be configured in the build, see the [Micronaut Deploying Application](https://micronaut-projects.github.io/micronaut-maven-plugin/latest/examples/deploy.html) documentation.
118116

119117
### Feedback

truffle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Software of the Johannes Kepler University Linz.
1717

1818
## Using Truffle
1919

20-
If you are looking for documentation on how to use Truffle, please consult the documentation [here](../docs/truffle-framework/README.md) or [on the website](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/).
20+
If you are looking for documentation on how to use Truffle, please consult the documentation [here](docs/README.md) or [on the website](https://www.graalvm.org/graalvm-as-a-platform/language-implementation-framework/).
2121

2222
## Hacking Truffle
2323

truffle/docs/Exit.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1+
---
2+
layout: docs
3+
toc_group: truffle
4+
link_title: Context Exit
5+
permalink: /graalvm-as-a-platform/language-implementation-framework/Exit/
6+
---
7+
18
# Context Exit
29

310
Different Truffle (guest) languages may use different mechanisms for exiting. This is not optimal as a Truffle language has no way to detect and handle an exit triggered by a different language.
411

5-
As of 22.0 Truffle has support for polyglot context hard explicit exit triggered by guest languages using [TruffleContext.closeExited(Node,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleContext.html#closeExited-com.oracle.truffle.api.nodes.Node-int-).
12+
As of 22.0 Truffle has support for polyglot context hard explicit exit triggered by guest languages using [TruffleContext.closeExited(Node,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleContext.html#closeExited-com.oracle.truffle.api.nodes.Node-int-).
613
It provides a unified way for languages to trigger the exit of the underlying polyglot context. When triggered, all initialized
714
guest languages are first notified using [TruffleLanguage.exitContext(C,ExitMode,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleLanguage.html#exitContext-C-com.oracle.truffle.api.TruffleLanguage.ExitMode-int), then all context threads are stopped, and finally, the context is closed.
8-
The hard explicit exit is simply referred to as "hard exit".
15+
The hard explicit exit is simply referred to as "hard exit".
916

10-
The hard exit is only one of the three types of exit in Truffle. There are the following types of exit.
17+
The hard exit is only one of the three types of exit in Truffle. There are the following types of exit.
1118

1219
* The new hard exit introduced above
1320
* Hard exit notifications are executed with `ExitMode.HARD` as the second parameter of `TruffleLanguage.exitContext(C,ExitMode,int)`.
@@ -19,9 +26,9 @@ The hard exit is only one of the three types of exit in Truffle. There are the f
1926
* Explicit exit triggered by throwing a Truffle exception of the exception type `ExceptionType.EXIT`.
2027
* The exception is not automatically thrown in other threads by Truffle and it does not trigger exit notifications or context close on its own.
2128
* The context is still fully usable after a soft exit and the soft exit can be followed by either the natural or the hard exit.
22-
29+
2330
For completeness, a polyglot context can be also closed by cancelling it using `Context.close(true)`, `TruffleContext.closeCancelled(Node,String)`, or `TruffleContext.closeResourceExhausted(Node,String)`.
24-
The cancel operation leads to immediate stopping of all context threads and closing the context without any exit notifications.
31+
The cancel operation leads to immediate stopping of all context threads and closing the context without any exit notifications.
2532

2633
## Soft exit
2734

@@ -44,7 +51,7 @@ The natural exit occurs during a normal context close triggered by `Context.clos
4451
3. All initialized languages are finalized.
4552
* `TruffleLanguage.finalizeContext(C)` is called for all initalized languages.
4653
* Guest code runs normally during finalization.
47-
54+
4855
4. All languages are disposed.
4956
* `TruffleLanguage.disposeContext(C)` is called for all languages.
5057

@@ -66,42 +73,42 @@ a special `ThreadDeath` cancel exception depending on whether the hard exit or t
6673
2. Exit notifications for all initialized languages are executed - [TruffleLanguage.exitContext(C,ExitMode,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleLanguage.html#exitContext-C-com.oracle.truffle.api.TruffleLanguage.ExitMode-int), where `ExitMode.HARD` is used as the `ExitMode` parameter.
6774
* Guest code runs normally during exit notifications.
6875
* If the context is not cancelled during exit notifications (during step 2a) and reaches step 2b, the exit process proceeds with the next step. Otherwise, the exit notifications are interrupted and the context is immediately cancelled.
69-
76+
7077
3. All context threads are forced to stop by throwing a special `ThreadDeath` exit exception from Truffle safepoints.
7178
* To exit threads reliably, languages need to ensure that `ThreadDeath` is always immediately rethrown and guest language exception handlers and finally blocks are not run.
7279
* The embedder threads eventually throw a `PolyglotException` to the host with `PolyglotException.isExit() == true` and `PolyglotException.getExitStatus()`
7380
being equal to the exit code originally specified as the second parameter to the first call to`TruffleContext.closeExited(Node,int)`.
7481
* Note that from step 3 the exit process is similar to the cancelling process as indicated by the figure, but the cancelling process uses a special `ThreadDeath` cancel exception
75-
and the `PolyglotException` thrown to the host has `PolyglotException.isCancelled() == true` instead of `PolyglotException.isExit() == true`.
82+
and the `PolyglotException` thrown to the host has `PolyglotException.isCancelled() == true` instead of `PolyglotException.isExit() == true`.
7683

7784
4. All initialized languages are finalized.
7885
* `TruffleLanguage.finalizeContext(C)` is called for all initalized languages.
7986
* Running any guest code in `TruffleLanguage.finalizeContext(C)` will throw the special `ThreadDeath` exit exception from the first Truffle safepoint.
8087
* Languages should skip any finalization that would require running guest code. A language can find out if it can run guest code in `TruffleLanguage.finalizeContext(C)` by checking if `TruffleLanguage.exitContext(C,ExitMode,int)` was previously called with ExitMode.NATURAL,
8188
or by checking that `TruffleContext.isClosed()` returns `false`.
8289

83-
90+
8491
5. All languages are disposed.
8592
* `TruffleLanguage.disposeContext(C)` is called for all languages.
86-
93+
8794
6. The context is closed.
8895

8996
### Behavior if useSystemExit is enabled
9097

9198
1. The exit is triggered by [TruffleContext.closeExited(Node,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleContext.html#closeExited-com.oracle.truffle.api.nodes.Node-int-).
9299
* Same as with system exit disabled.
93-
100+
94101
2. Exit notifications for all initialized languages are executed - [TruffleLanguage.exitContext(C,ExitMode,int)](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleLanguage.html#exitContext-C-com.oracle.truffle.api.TruffleLanguage.ExitMode-int), where `ExitMode.HARD` is used as the `ExitMode` parameter.
95102
* Same as with system exit disabled.
96-
103+
97104
3. `System.exit(int)` is called to terminate the whole host application providing the fastest exit possible.
98105
* The exit code passed to `System.exit(int)`
99-
is the one originally specified as the second parameter to the first call to`TruffleContext.closeExited(Node,int)`.
106+
is the one originally specified as the second parameter to the first call to`TruffleContext.closeExited(Node,int)`.
100107

101108
## Example Usage
102109

103110
The [SimpleLanguage](https://github.com/graalvm/simplelanguage) demonstrates the usage of the hard context exit. The following aspects are demonstrated.
104111

105112
* [SLExitBuiltin](https://github.com/graalvm/simplelanguage/blob/master/language/src/main/java/com/oracle/truffle/sl/builtins/SLExitBuiltin.java) demonstrates triggering the context exit.
106113
* [SLRegisterShutdownHookBuiltin](https://github.com/graalvm/simplelanguage/blob/master/language/src/main/java/com/oracle/truffle/sl/builtins/SLRegisterShutdownHookBuiltin.java) demonstrates registration of shutdown hooks that are executed during the exit notification defined in [SLLanguage](https://github.com/graalvm/simplelanguage/blob/master/language/src/main/java/com/oracle/truffle/sl/SLLanguage.java).
107-
* [SLExitTest](https://github.com/graalvm/simplelanguage/blob/master/language/src/test/java/com/oracle/truffle/sl/test/SLExitTest.java) demonstrates the usage of the builtins defined above.
114+
* [SLExitTest](https://github.com/graalvm/simplelanguage/blob/master/language/src/test/java/com/oracle/truffle/sl/test/SLExitTest.java) demonstrates the usage of the builtins defined above.

0 commit comments

Comments
 (0)