filmov
tv
Making a WebAssembly interpreter in Ruby, part 13: operand stack and instruction unfolding

Показать описание
00:00:00 — Waiting to start
00:00:49 — Hello
00:02:39 — Retro
00:06:36 — Extract #define_function helper
00:23:02 — Combine 32- and 64-bit implementations of `trunc[_sat]_f*_{s,u}` instructions
00:31:13 — Combine signed and unsigned implementations of `trunc[_sat]_f{32,64}_*` instructions
00:39:28 — Combine unsaturating and saturating implementations of `trunc*_f{32,64}_{s,u}` instructions
00:44:55 — Extract MatchPattern helper module
00:56:53 — Slice out `bits` and `operation` at the start of #evaluate
01:01:06 — Handle numeric instructions separately
01:06:05 — Extract #evaluate_numeric_instruction
01:12:43 — Determine numeric instruction type from name
01:19:20 — Handle `const` instructions separately
01:19:34 — Handle `load` and `store` instructions separately
01:24:22 — Combine implementations of `load` and `store` with and without static offset
01:32:41 — Check instruction type instead of whole expression
01:34:24 — Extract #evaluate_integer_instruction and #evaluate_float_instruction
01:39:47 — Group integer operations by arity
01:54:46 — Group float operations by arity
02:10:14 — Introduce an operand stack in the interpreter
02:13:33 — Push `const` values onto the stack
02:18:20 — Push the result of integer and float operations onto the stack
02:27:21 — Retrieve `add` operands from stack
02:30:27 — Retrieve operands from stack for all binary integer operations
02:32:20 — Retrieve operands from stack for all unary integer operations
02:32:53 — Ignore the result of evaluating arguments for integer operations
02:34:52 — Retrieve operands from stack for all binary floating-point operations
02:36:13 — Retrieve operands from stack for all unary floating-point operations
02:36:49 — Ignore the result of evaluating arguments for floating-point operations
02:37:44 — Retrieve operands from stack for `load` and `store` operations
02:40:38 — Push the result of `load` operations onto the stack
02:42:04 — Use stack for operands and return values for all remaining instructions
02:51:57 — Fix up remaining #evaluate callers to read its result from the stack
03:09:43 — Push the result of #invoke_function onto the stack instead of returning it
03:13:33 — Return `nil` from methods whose result is on the stack
03:17:22 — Hook up a dummy #unfold method to unfold expressions before evaluation
03:55:41 — Change #invoke_function to evaluate the entire body at once after unfolding
04:08:38 — Support unfolded instructions in #evaluate
04:21:08 — Unfold integer `add` instruction
04:28:12 — Unfold the rest of the binary integer instructions
04:33:25 — Unfold the unary integer instructions
04:36:24 — Remove unused arguments from #evaluate_float_instruction
04:40:14 — Remove unused arguments from #evaluate_integer_instruction
04:40:14 — Unfold `*.const`, `*.load` and `*.store`
04:57:38 — Simplify integer instruction unfolding condition now that all integer instructions are unfolded
05:00:18 — Unfold all floating-point instructions
05:04:49 — Wrapping up
05:08:12 — Bye