summaryrefslogtreecommitdiff
path: root/docs/chapter18
diff options
context:
space:
mode:
Diffstat (limited to 'docs/chapter18')
-rw-r--r--docs/chapter18/README.ja.md4
-rw-r--r--docs/chapter18/README.md6
2 files changed, 6 insertions, 4 deletions
diff --git a/docs/chapter18/README.ja.md b/docs/chapter18/README.ja.md
index d19a0f10..9b42f91e 100644
--- a/docs/chapter18/README.ja.md
+++ b/docs/chapter18/README.ja.md
@@ -86,7 +86,7 @@ val fact = { int n ->
return fact(arg);
```
-パーサーは、本体をパースする前に関数の入口を登録します。`fact` への前方参照は、宣言がその関数値を受け取ると解決されます。それによって再帰呼び出しも、外からの呼び出しと同じ入口を見つけられます。この章では戻り値の型推論はまだ悲観的です。相互再帰する定義には、[第24章](../chapter24/README.ja.md)の SCCP で導入する、より強力な解析が必要なことがあります。
+パーサーは、本体をパースする前に関数の入口を登録します。`fact` への前方参照は、宣言がその関数値を受け取ると解決されます。それによって再帰呼び出しも、外からの呼び出しと同じ入口を見つけられます。この章では戻り値の型推論はまだ悲観的です。相互再帰する定義には、[第24章](../chapter24b/README.ja.md)の SCCP で導入する、より強力な解析が必要なことがあります。
## グラフ内の関数
@@ -221,6 +221,6 @@ code.driver(CodeGen.Phase.LocalSched);
その後 [ListScheduler](../../src/main/java/com/seaofnodes/simple/ListScheduler.java) が各ブロックを順序付けます。未スケジュールの局所依存を数え、準備のできた演算を選び、依存が満たされるにつれてそのユーザーを準備済みにします。Phi は入口に、制御移動は出口に属します。ここには機械のタイミングモデルがなく、さまざまな改善の余地がありますが、この章の範囲外です。目標は、引き続き合法な実行順序です。
-[Eval2](../../src/test/java/com/seaofnodes/simple/Eval2.java) はそのスケジュールを実行し、IR の演算を、無制限の値スロットを持つ命令として扱います。各呼び出しには独自のフレームがあるため、同じノードの再帰的な呼び出しも異なる値を保持します。呼び出し時には、呼び出し元のフレームと復帰地点を保存し、呼び出される側のフレームを作り、選ばれた関数に移ります。return 時には呼び出し元を復元し、その CallEnd に値を渡します。Region では、結果を代入する前に、選ばれたすべての Phi 入力を読みます。そのため並列代入は正しさを保ちます。
+[Eval2](../../src/test/java/com/seaofnodes/simple/Eval2.java) は、この章から以前の `Evaluator` とその専用テストスケジューラを置き換えます。コンパイラが作ったスケジュールを実行し、IR の演算を、無制限の値スロットを持つ命令として扱います。各呼び出しには独自のフレームがあるため、同じノードの再帰的な呼び出しも異なる値を保持します。呼び出し時には、呼び出し元のフレームと復帰地点を保存し、呼び出される側のフレームを作り、選ばれた関数に移ります。return 時には呼び出し元を復元し、その CallEnd に値を渡します。Region では、結果を代入する前に、選ばれたすべての Phi 入力を読みます。そのため並列代入は正しさを保ちます。
これでスケジュールされた関数からなる実行可能なプログラムができましたが、演算はまだ機械に依存しません。[第19章](../chapter19/README.ja.md)では、スケジューリング前に命令選択を挿入します。これらの理想的な演算は、選んだ CPU のレジスタ制約と呼び出し規約を持つ命令になります。
diff --git a/docs/chapter18/README.md b/docs/chapter18/README.md
index cfe70bda..d8b238f8 100644
--- a/docs/chapter18/README.md
+++ b/docs/chapter18/README.md
@@ -116,7 +116,7 @@ reference to `fact` is resolved when the declaration receives its function
value. Recursive calls can then find the same entry as calls from outside.
Return-type inference is still pessimistic in this chapter; mutually recursive
definitions can require the stronger analysis introduced with SCCP in
-[Chapter 24](../chapter24/README.md).
+[Chapter 24](../chapter24b/README.md).
## Functions in the graph
@@ -363,7 +363,9 @@ belong at entry and control transfers at exit. There is room for all sorts of
improvements - there is no machine timing model here, but this is out of scope
for this chapter. The goal remains a legal execution order.
-[Eval2](../../src/test/java/com/seaofnodes/simple/Eval2.java) executes that schedule,
+[Eval2](../../src/test/java/com/seaofnodes/simple/Eval2.java) replaces the earlier
+`Evaluator` and its separate test scheduler starting in this chapter. It executes
+the compiler's schedule,
treating IR operations as instructions with an unlimited supply of value
slots. Each invocation has its own frame, so recursive invocations of the same
nodes keep distinct values. At a call it saves the caller's frame and return