diff --git a/cranelift/docs/heap.dot b/cranelift/docs/heap.dot new file mode 100644 index 000000000000..1c46f22b321d --- /dev/null +++ b/cranelift/docs/heap.dot @@ -0,0 +1,8 @@ +digraph { + node [ + shape=record, + fontsize=10, + fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans" + ] + "static" [label="mapped\npages|unmapped\npages|offset_guard\npages"] +} diff --git a/cranelift/docs/heap.svg b/cranelift/docs/heap.svg new file mode 100644 index 000000000000..e668f3e8deae --- /dev/null +++ b/cranelift/docs/heap.svg @@ -0,0 +1,26 @@ + + + + + + +%3 + + + +static + +mapped +pages + +unmapped +pages + +offset_guard +pages + + + diff --git a/cranelift/docs/ir.md b/cranelift/docs/ir.md index b9882151dc33..d4625621f239 100644 --- a/cranelift/docs/ir.md +++ b/cranelift/docs/ir.md @@ -95,11 +95,12 @@ execution can never fall through to the next EBB without an explicit branch. A `.clif` file consists of a sequence of independent function definitions: -.. productionlist:: - function_list : { function } - function : "function" function_name signature "{" preamble function_body "}" - preamble : { preamble_decl } - function_body : { extended_basic_block } +``` +function_list : { function } +function : "function" function_name signature "{" preamble function_body "}" +preamble : { preamble_decl } +function_body : { extended_basic_block } +``` ### Static single assignment form @@ -397,14 +398,15 @@ be known when the function call is compiled. The function signature describes how to call the function, including parameters, return values, and the calling convention: -.. productionlist:: - signature : "(" [paramlist] ")" ["->" retlist] [call_conv] - paramlist : param { "," param } - retlist : paramlist - param : type [paramext] [paramspecial] - paramext : "uext" | "sext" - paramspecial : "sret" | "link" | "fp" | "csr" | "vmctx" | "sigid" | "stack_limit" - callconv : "fast" | "cold" | "system_v" | "fastcall" | "baldrdash_system_v" | "baldrdash_windows" +``` +signature : "(" [paramlist] ")" ["->" retlist] [call_conv] +paramlist : param { "," param } +retlist : paramlist +param : type [paramext] [paramspecial] +paramext : "uext" | "sext" +paramspecial : "sret" | "link" | "fp" | "csr" | "vmctx" | "sigid" | "stack_limit" +callconv : "fast" | "cold" | "system_v" | "fastcall" | "baldrdash_system_v" | "baldrdash_windows" +``` A function's calling convention determines exactly how arguments and return values are passed, and how stack frames are managed. Since all of these details @@ -620,16 +622,7 @@ returns a pointer that is guaranteed to trap. Heap addresses can be smaller than the native pointer size, for example unsigned `i32` offsets on a 64-bit architecture. -.. digraph:: static - :align: center - :caption: Heap address space layout - - node [ - shape=record, - fontsize=10, - fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans" - ] - "static" [label="mapped\npages|unmapped\npages|offset_guard\npages"] +![Heap address space layout](./heap.svg) A heap appears as three consecutive ranges of address space: