Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spec] Cleaner definition of frames #1697

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions document/core/exec/runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ It filters out entries of a specific kind in an order-preserving fashion:
pair: abstract syntax; frame
pair: abstract syntax; label
.. _syntax-frame:
.. _syntax-framestate:
.. _syntax-label:
.. _frame:
.. _label:
Expand Down Expand Up @@ -486,6 +487,8 @@ and a reference to the function's own :ref:`module instance <syntax-moduleinst>`
.. math::
\begin{array}{llll}
\production{frame} & \frame &::=&
\FRAME_n\{ \framestate \} \\
\production{frame state} & \framestate &::=&
\{ \ALOCALS~\val^\ast, \AMODULE~\moduleinst \} \\
\end{array}

Expand All @@ -499,7 +502,7 @@ Conventions

* The meta variable :math:`L` ranges over labels where clear from context.

* The meta variable :math:`F` ranges over frames where clear from context.
* The meta variable :math:`F` ranges over frame states where clear from context.

* The following auxiliary definition takes a :ref:`block type <syntax-blocktype>` and looks up the :ref:`function type <syntax-functype>` that it denotes in the current frame:

Expand Down Expand Up @@ -534,7 +537,7 @@ In order to express the reduction of :ref:`traps <trap>`, :ref:`calls <syntax-ca
\REFEXTERNADDR~\externaddr \\ &&|&
\INVOKE~\funcaddr \\ &&|&
\LABEL_n\{\instr^\ast\}~\instr^\ast~\END \\ &&|&
\FRAME_n\{\frame\}~\instr^\ast~\END \\
\FRAME_n\{\framestate\}~\instr^\ast~\END \\
\end{array}

The |TRAP| instruction represents the occurrence of a trap.
Expand Down Expand Up @@ -618,14 +621,14 @@ Configurations
A *configuration* consists of the current :ref:`store <syntax-store>` and an executing *thread*.

A thread is a computation over :ref:`instructions <syntax-instr>`
that operates relative to a current :ref:`frame <syntax-frame>` referring to the :ref:`module instance <syntax-moduleinst>` in which the computation runs, i.e., where the current function originates from.
that operates relative to the state of a current :ref:`frame <syntax-framestate>` referring to the :ref:`module instance <syntax-moduleinst>` in which the computation runs, i.e., where the current function originates from.

.. math::
\begin{array}{llcl}
\production{configuration} & \config &::=&
\store; \thread \\
\production{thread} & \thread &::=&
\frame; \instr^\ast \\
\framestate; \instr^\ast \\
\end{array}

.. note::
Expand Down
1 change: 1 addition & 0 deletions document/core/util/macros.def
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,7 @@

.. |label| mathdef:: \xref{exec/runtime}{syntax-label}{\X{label}}
.. |frame| mathdef:: \xref{exec/runtime}{syntax-frame}{\X{frame}}
.. |framestate| mathdef:: \xref{exec/runtime}{syntax-framestate}{\X{framestate}}


.. Stack, meta functions
Expand Down
Loading