@@ -65,42 +65,42 @@ Control flow
6565
6666These manipulate the control stack and program counter. Both ``if `` and ``ifelse `` expect a ``UInt `` at the top of the data stack to represent the condition.
6767
68- ======== ========== ============================================================
69- Opcode Mnemonic Description
70- -------- ---------- ------------------------------------------------------------
71- 0x10 ``{ `` push a code block address onto the control stack
72- -- ``} `` (technically not an opcode) syntax for end of code block
73- 0x11 ``if `` ``(UInt -> ) `` pop a block from the control stack,
74- if the top of the data stack is nonzero, execute it
75- 0x12 ``ifelse `` ``(UInt -> ) `` pop two blocks from the control stack, if
76- the top of the data stack is nonzero, execute the first,
77- otherwise the second.
78- 0x13 ``return `` pop the entire control stack and return
79- ======== ========== ============================================================
68+ ======== ============ ============================================================
69+ Opcode Mnemonic Description
70+ -------- ------------ ------------------------------------------------------------
71+ 0x10 ``{ `` push a code block address onto the control stack
72+ -- ``} `` (technically not an opcode) syntax for end of code block
73+ 0x11 ``if `` ``(UInt -> ) `` pop a block from the control stack,
74+ if the top of the data stack is nonzero, execute it
75+ 0x12 ``ifelse `` ``(UInt -> ) `` pop two blocks from the control stack, if
76+ the top of the data stack is nonzero, execute the first,
77+ otherwise the second.
78+ 0x13 ``return `` pop the entire control stack and return
79+ ======== ============ ============================================================
8080
8181Literals for basic types
8282~~~~~~~~~~~~~~~~~~~~~~~~
8383
84- ======== =========== ============================================================
85- Opcode Mnemonic Description
86- -------- ----------- ------------------------------------------------------------
87- 0x20 ``123u `` ``( -> UInt) `` push an unsigned 64-bit host integer
88- 0x21 ``123 `` ``( -> Int) `` push a signed 64-bit host integer
89- 0x22 ``"abc" `` ``( -> String) `` push a UTF-8 host string
90- 0x23 ``@strlen `` ``( -> Selector) `` push one of the predefined function
91- selectors. See ``call ``.
92- ======== =========== ============================================================
84+ ======== ============= ============================================================
85+ Opcode Mnemonic Description
86+ -------- ------------- ------------------------------------------------------------
87+ 0x20 ``123u `` ``( -> UInt) `` push an unsigned 64-bit host integer
88+ 0x21 ``123 `` ``( -> Int) `` push a signed 64-bit host integer
89+ 0x22 ``"abc" `` ``( -> String) `` push a UTF-8 host string
90+ 0x23 ``@strlen `` ``( -> Selector) `` push one of the predefined function
91+ selectors. See ``call ``.
92+ ======== ============= ============================================================
9393
9494Conversion operations
9595~~~~~~~~~~~~~~~~~~~~~
9696
97- ======== =========== ================================================================
98- Opcode Mnemonic Description
99- -------- ----------- ----------------------------------------------------------------
100- 0x2a ``as_int `` ``( UInt -> Int) `` reinterpret a UInt as an Int
101- 0x2b ``as_uint `` ``( Int -> UInt) `` reinterpret an Int as a UInt
102- 0x2c ``is_null `` ``( Object -> UInt ) `` check an object for null ``(object ? 0 : 1) ``
103- ======== =========== ================================================================
97+ ======== ============= ================================================================
98+ Opcode Mnemonic Description
99+ -------- ------------- ----------------------------------------------------------------
100+ 0x2a ``as_int `` ``( UInt -> Int) `` reinterpret a UInt as an Int
101+ 0x2b ``as_uint `` ``( Int -> UInt) `` reinterpret an Int as a UInt
102+ 0x2c ``is_null `` ``( Object -> UInt ) `` check an object for null ``(object ? 0 : 1) ``
103+ ======== ============= ================================================================
104104
105105
106106Arithmetic, logic, and comparison operations
@@ -142,33 +142,33 @@ For security reasons the list of functions callable with ``call`` is predefined.
142142
143143Method is one of a predefined set of *Selectors *.
144144
145- ==== ============================ =================================================== ==================================
146- Sel. Mnemonic Stack Effect Description
147- ---- ---------------------------- --------------------------------------------------- ----------------------------------
148- 0x00 ``summary `` ``(Object @summary -> String) `` ``SBValue::GetSummary ``
149- 0x01 ``type_summary `` ``(Object @type_summary -> String) `` ``SBValue::GetTypeSummary ``
150- 0x10 ``get_num_children `` ``(Object @get_num_children -> UInt) `` ``SBValue::GetNumChildren ``
151- 0x11 ``get_child_at_index `` ``(Object UInt @get_child_at_index -> Object) `` ``SBValue::GetChildAtIndex ``
152- 0x12 ``get_child_with_name `` ``(Object String @get_child_with_name -> Object) `` ``SBValue::GetChildAtIndex ``
153- 0x13 ``get_child_index `` ``(Object String @get_child_index -> UInt) `` ``SBValue::GetChildIndex ``
154- 0x15 ``get_type `` ``(Object @get_type -> Type) `` ``SBValue::GetType ``
155- 0x16 ``get_template_argument_type `` ``(Object UInt @get_template_argument_type -> Type) `` ``SBValue::GetTemplateArgumentType ``
156- 0x17 ``cast `` ``(Object Type @cast -> Object) `` ``SBValue::Cast ``
157- 0x20 ``get_value `` ``(Object @get_value -> Object) `` ``SBValue::GetValue ``
158- 0x21 ``get_value_as_unsigned `` ``(Object @get_value_as_unsigned -> UInt) `` ``SBValue::GetValueAsUnsigned ``
159- 0x22 ``get_value_as_signed `` ``(Object @get_value_as_signed -> Int) `` ``SBValue::GetValueAsSigned ``
160- 0x23 ``get_value_as_address `` ``(Object @get_value_as_address -> UInt) `` ``SBValue::GetValueAsAddress ``
161- 0x40 ``read_memory_byte `` ``(UInt @read_memory_byte -> UInt) `` ``Target::ReadMemory ``
162- 0x41 ``read_memory_uint32 `` ``(UInt @read_memory_uint32 -> UInt) `` ``Target::ReadMemory ``
163- 0x42 ``read_memory_int32 `` ``(UInt @read_memory_int32 -> Int) `` ``Target::ReadMemory ``
164- 0x43 ``read_memory_uint64 `` ``(UInt @read_memory_uint64 -> UInt) `` ``Target::ReadMemory ``
165- 0x44 ``read_memory_int64 `` ``(UInt @read_memory_int64 -> Int) `` ``Target::ReadMemory ``
166- 0x45 ``read_memory_address `` ``(UInt @read_memory_uint64 -> UInt) `` ``Target::ReadMemory ``
167- 0x46 ``read_memory `` ``(UInt Type @read_memory -> Object) `` ``Target::ReadMemory ``
168- 0x50 ``fmt `` ``(String arg0 ... @fmt -> String) `` ``llvm::format ``
169- 0x51 ``sprintf `` ``(String arg0 ... sprintf -> String) `` ``sprintf ``
170- 0x52 ``strlen `` ``(String strlen -> String) `` ``strlen in bytes ``
171- ==== ============================ =================================================== ==================================
145+ ==== =============================== ====================================================== ==== ==================================
146+ Sel. Mnemonic Stack Effect Description
147+ ---- ------------------------------- ------------------------------------------------------ ---- ----------------------------------
148+ 0x00 ``summary `` ``(Object @summary -> String) `` ``SBValue::GetSummary ``
149+ 0x01 ``type_summary `` ``(Object @type_summary -> String) `` ``SBValue::GetTypeSummary ``
150+ 0x10 ``get_num_children `` ``(Object @get_num_children -> UInt) `` ``SBValue::GetNumChildren ``
151+ 0x11 ``get_child_at_index `` ``(Object UInt @get_child_at_index -> Object) `` ``SBValue::GetChildAtIndex ``
152+ 0x12 ``get_child_with_name `` ``(Object String @get_child_with_name -> Object) `` ``SBValue::GetChildAtIndex ``
153+ 0x13 ``get_child_index `` ``(Object String @get_child_index -> UInt) `` ``SBValue::GetChildIndex ``
154+ 0x15 ``get_type `` ``(Object @get_type -> Type) `` ``SBValue::GetType ``
155+ 0x16 ``get_template_argument_type `` ``(Object UInt @get_template_argument_type -> Type) `` ``SBValue::GetTemplateArgumentType ``
156+ 0x17 ``cast `` ``(Object Type @cast -> Object) `` ``SBValue::Cast ``
157+ 0x20 ``get_value `` ``(Object @get_value -> Object) `` ``SBValue::GetValue ``
158+ 0x21 ``get_value_as_unsigned `` ``(Object @get_value_as_unsigned -> UInt) `` ``SBValue::GetValueAsUnsigned ``
159+ 0x22 ``get_value_as_signed `` ``(Object @get_value_as_signed -> Int) `` ``SBValue::GetValueAsSigned ``
160+ 0x23 ``get_value_as_address `` ``(Object @get_value_as_address -> UInt) `` ``SBValue::GetValueAsAddress ``
161+ 0x40 ``read_memory_byte `` ``(UInt @read_memory_byte -> UInt) `` ``Target::ReadMemory ``
162+ 0x41 ``read_memory_uint32 `` ``(UInt @read_memory_uint32 -> UInt) `` ``Target::ReadMemory ``
163+ 0x42 ``read_memory_int32 `` ``(UInt @read_memory_int32 -> Int) `` ``Target::ReadMemory ``
164+ 0x43 ``read_memory_uint64 `` ``(UInt @read_memory_uint64 -> UInt) `` ``Target::ReadMemory ``
165+ 0x44 ``read_memory_int64 `` ``(UInt @read_memory_int64 -> Int) `` ``Target::ReadMemory ``
166+ 0x45 ``read_memory_address `` ``(UInt @read_memory_uint64 -> UInt) `` ``Target::ReadMemory ``
167+ 0x46 ``read_memory `` ``(UInt Type @read_memory -> Object) `` ``Target::ReadMemory ``
168+ 0x50 ``fmt `` ``(String arg0 ... @fmt -> String) `` ``llvm::format ``
169+ 0x51 ``sprintf `` ``(String arg0 ... sprintf -> String) `` ``sprintf ``
170+ 0x52 ``strlen `` ``(String strlen -> String) `` ``strlen in bytes ``
171+ ==== =============================== ====================================================== ==== ==================================
172172
173173Byte Code
174174~~~~~~~~~
@@ -212,16 +212,16 @@ This is followed by one or more dictionary values that immediately follow each o
212212
213213The possible function signatures are:
214214
215- ========= ====================== ==========================
216- Signature Mnemonic Stack Effect
217- --------- ---------------------- --------------------------
218- 0x00 ``@summary `` ``(Object -> String) ``
219- 0x01 ``@init `` ``(Object -> Object+) ``
220- 0x02 ``@get_num_children `` ``(Object+ -> UInt) ``
221- 0x03 ``@get_child_index `` ``(Object+ String -> UInt) ``
222- 0x04 ``@get_child_at_index `` ``(Object+ UInt -> Object) ``
223- 0x05 ``@get_value `` ``(Object+ -> String) ``
224- ========= ====================== ==========================
215+ ========= ========================= ==== ==========================
216+ Signature Mnemonic Stack Effect
217+ --------- ------------------------- ---- --------------------------
218+ 0x00 ``@summary `` ``(Object -> String) ``
219+ 0x01 ``@init `` ``(Object -> Object+) ``
220+ 0x02 ``@get_num_children `` ``(Object+ -> UInt) ``
221+ 0x03 ``@get_child_index `` ``(Object+ String -> UInt) ``
222+ 0x04 ``@get_child_at_index `` ``(Object+ UInt -> Object) ``
223+ 0x05 ``@get_value `` ``(Object+ -> String) ``
224+ ========= ========================= ==== ==========================
225225
226226If not specified, the init function defaults to an empty function that just passes the Object along. Its results may be cached and allow common prep work to be done for an Object that can be reused by subsequent calls to the other methods. This way subsequent calls to ``@get_child_at_index `` can avoid recomputing shared information, for example.
227227
0 commit comments