View the Index
Total Page:16
File Type:pdf, Size:1020Kb
INDEX Symbol public, 248, 258 !! (JavaScript), 47, 53 runtime, 248, 255, 257 super, 263 A AssemblyScript loader, 247, 248, accumulator machine, 221 251–256, 260–266 accumulator register, 220 __allocString, 255 ActionScript Virtual Machine 2 demangle, 264 (AVM2), 9 __getString, 255 Advanced RISC Machine (ARM), 9 __newString, 255 alert (JavaScript), 232, 245 async (JavaScript), 24 allocates memory, 189 ATmega328, 117 __allocString (AssemblyScript AVM2 (ActionScript Virtual loader), 255 Machine 2), 9 AND mask, 80, 106 anyfunc (WAT), 59–60 B ArrayBuffer (JavaScript), 116 base address, 126 asc, 248, 255, 257, 261, 262, 263, 267 base index, 130 --exportRuntime, 255 benchmark (benchmark.js), 216 -h, 248 mean, 217 --importMemory, 252 run, 217 -o, 257, 258 sort, 217 -O, 248 suite, 217 -Oz, 249 suite.add, 217 --sourceMap, 248 suite.on, 217 ASCII, 88, 103, 106, 108, 112, 251 biased exponent, 75 Assembly language, 6 big-endian, 84, 93 AssemblyScript, 3, 6, 197, 198, 247–268 BigInt, 25, 73 class, 262, 263, 266 binary, 70, 101, 110, 147, 148, 151, 152, declare, 250 154, 155 export, 249 Binaryen, 197, 213 f64, 257 Binaryen optimizer, 208 function, 249 bit flipping, 73, 83 garbage collection, 248 bit manipulation, 71, 79 i32, 249 bit masking, 80 installing, 248 bit rotation, 80 private, 247, 248, 258, 259, 261, bit shifting, 79 262, 267 bitwise AND, 80, 212 protected, 248, 258 bitwise OR, 82 block (HTML), 145 r0, 221 block (WAT), 37, 38, 39, 50 StackCheck, 221 body (HTML), 145, 146, 149, 150 Star, 221 Bottom-Up (Chrome profiler), 192 TestLessThan, 221 br (WAT), 39 profiler, 186–191, 207 br_if (WAT), 38, 40, 51, 52 Bottom-Up, 192 br_table (WAT), 43 Idle, 188 breakpoint (Firefox debugger), 241, Painting, 188 242 Performance tab, 188–194 button (HTML), 146, 149, 150 Processing time, 188 bytecode, 2, 3, 8, 220 Record button, 188 byte copy, 97, 100 Scripting, 188 Self Time, 192 C suite (benchmark.js), 217 Cabrera, Saule, 256 suite.add (benchmark.js), 217 Call Tree (Firefox profiler), 188, suite.on (benchmark.js), 217 194–195 Summary tab, 188 call_indirect (WAT), 61 super (AssemblyScript), 263 canvas, 157–165, 167, 168, 169, 171, 174, System, 188 176, 183, 184 Chrome V8, 220 canvas.getContext (JavaScript), Clark, Lin, 4 160 class (AssemblyScript), 262, 263, 266 canvas.height (HTML), 158 collision detection, 126 canvas.width (HTML), 158 colors (npm package), 122 C/C++, 4, 6, 55, 59, 119, connect (npm package), 140 malloc, 116 Console (Chrome), 230 new, 116 console (Firefox debugger), 236 Chrome, 2, 11, 14 console.log (JavaScript), 27, 41, 90, 92, Console, 230 105, 209, 213, 233, 254, 260, Developer tools, 230, 243 262, 264, 266 More tools, 229 console.trace (JavaScript), 233, 236, Scope window, 244 246 Profiler, 186 const (JavaScript), 124, 128 Debugger constructor, 257 Page tab, 243 copying strings, 95 Resume button, 244 copying bytes, 97, 100 Sources tab, 243 CPU, 189 Step into button, 244 CPython, 9 Step out button, 244 ctx.putImageData (JavaScript), 190, 191 Step over button, 244 wasm, 243 D Incognito window, 186 data (WAT), 85, 91, 101, 251 IR Date (JavaScript), 209 ExtraWide, 221 Date.now (JavaScript), 210, 213 JumpIfFalse, 221 Dead Code Elimination (DCE), 185, LdaSmi, 221 204, 219 LdaSmi.ExtraWide, 221 debugger, 223, 237–238, 240–245 LdaZero, 221 declare (AssemblyScript), 250 272 Index demangle (AssemblyScript loader), 264 f64.lt (WAT), 36 demangle (JavaScript), 262 f64.ne (WAT), 36 denormalized numbers, 76 f64.promote/f32 (WAT), 33 destructuring, 58, 66 f64.reinterpret/i64 (WAT), 33 Developer tools, 187, 230, 243 fetch (JavaScript), 145, 259 div (HTML), 150, 153 Firefox, 2, 11, 192–196, 229–242 document.getElementById (JavaScript), Debugger, 229–240 158, 160 breakpoint, 241, 242 Document Object Model (DOM), 139, console, 236 140, 142, 145, 147, 155, 158 Resume button, 242 double-precision floating-point, 77 Step into button, 242 drawing context, 160 Step out button, 242 DRY (Don’t Repeat Yourself), 172 Step over button, 242 Watch expressions, 241, 242 E Private Window, 192 elem (WAT), 60 Profiler, 186, 192–196 else (WAT), 34, 38, 112 Call Tree, 194, 195 Emscripten, 4, 6, 17, 197 JS Flame Chart, 194, 195 end (WAT), 34, 51 Performance menu, 194 Ethereum Virtual Machine (EVM), 9 Performance tab, 194 execution time, 188 Start Recording Performance, export (AssemblyScript), 249 194 --exportRuntime (AssemblyScript), 255 Waterfall, 194 export (WAT), 46, 57, 64, 118 Web Console, 231 ExtraWide (Chrome IR), 221 Web Developer submenu, 230 for (JavaScript), 162, 219 F floating-point, 7, 8, 71–77, 257 f32.convert_s/i32 (WAT), 33 frames per second (fps), 189–192, f32.convert_s/i64 (WAT), 33 195–198, 208–209 f32.convert_u/i32 (WAT), 33 fs (JavaScript), 216, 259 f32.convert_u/i64 (WAT), 33 func (WAT), 47 f32.demote/f64 (WAT), 33 function (AssemblyScript), 249 f32.eq (WAT), 36 function tables, 59 f32.ge (WAT), 37 f32.gt (WAT), 36, 37 G f32.le (WAT), 36 garbage collection, 189, 194, 248, 249 f32.lt (WAT), 36 __getString (AssemblyScript f32.ne (WAT), 36 loader), 255 f32.reinterpret/i32 (WAT), 33 global (WAT), 21, 56 f64 (AssemblyScript), 257 global.get (WAT), 10, 244, 154 f64.convert_s/i32 (WAT), 33 global.set (WAT), 10, 244 f64.convert_s/i64 (WAT), 33 Golang, 6 f64.convert_u/i32 (WAT), 33 gt_u (WAT), 133 f64.convert_u/i64 (WAT), 33 f64.eq (WAT), 36 H f64.ge (WAT), 37 -h (asc), 248 f64.gt (WAT), 37 H1 (HTML), 151, 154 f64.le (WAT), 36 H4 (HTML), 151, 154 Index 273 heap memory, 189 i32.mul (WAT), 29, 31, 218 hexadecimal, 70, 79, 93, 101, 105, 108, i32.ne (WAT), 36 147, 148, 151, 152, 154, 155, i32.or (WAT), 37, 80, 82, 83 160, 165, 166 i32.reinterpret/f32 (WAT), 33 high-order bit, 78 i32.rem_u (WAT), 48 HyperText Markup Language (HTML), i32.rem_u (WAT), 49, 102, 171 6, 14, 140, 141, 142, 144, 155, i32.set (WAT), 176 163, 164, 184 i32.shr_u (WAT), 79, 108, 112 block, 145 i32.store (WAT), 120, 168, 169 body, 145, 146, 149, 150 i32.store8 (WAT), 97, 103, 112 button, 146, 149, 150 i32.sub (WAT), 31 canvas, 157, 158, 159, 160 i32.tee (WAT), 176 canvas.height, 158 i32.trunc_s/f32 (WAT), 33 canvas.width, 158 i32.trunc_s/f64 (WAT), 33 div, 150, 153 i32.trunc_u/f32 (WAT), 33 H1, 151, 154 i32.trunc_u/f64 (WAT), 33 H4, 151, 154 i32.wrap/i64 (WAT), 33 id, 145, 146 i32.xor (WAT), 37, 83, 84 input, 146, 149, 150 i64.add (WAT), 17 onclick, 146, 150 i64.and (WAT), 37 onload, 146, 150 i64.div_s (WAT), 73 script, 143, 145, 148, 149, 162, i64.div_u (WAT), 73 205, 239 i64.eq (WAT), 36 span, 226 i64.eqz (WAT), 37 title, 147, 148 i64.extend_s/i32 (WAT), 33 type, 150 i64.extend_u/i32 (WAT), 33 value, 150 i64.ge_s (WAT), 37 i64.ge_u (WAT), 37 I i64.gt_s (WAT), 37 i32 (AssemblyScript), 249 i64.gt_u (WAT), 37 i32.add (WAT), 9, 10, 17, 29, 31, 176 i64.le_s (WAT), 36 i32.and (WAT), 35–37, 80, 100, 105, i64.le_u (WAT), 36 108, 110, 112, 176, 177 i64.load (WAT), 98 i32.const (WAT), 21, 31, 47, 60, 89, i64.lt_s (WAT), 36 104, 109 i64.lt_u (WAT), 36 i32.div_u (WAT), 218 i64.mul (WAT), 73 i32.eq (WAT), 36, 48 i64.ne (WAT), 36 i32.eqz (WAT), 37 i64.or (WAT), 82, 83 i32.ge_s (WAT), 37 i64.reinterpret/f64 (WAT), 33 i32.ge_u (WAT), 37, 51 i64.store (WAT), 98 (WAT), 35–36 i32.gt_s i64.sub (WAT), 73 i32.gt_u (WAT), 37 i64.trunc_s/f32 (WAT), 33 i32.le_s (WAT), 36 i64.trunc_s/f64 (WAT), 33 i32.le_u (WAT), 36, 57 i64.trunc_u/f32 (WAT), 33 i32.load (WAT), 120, 173 i64.trunc_u/f64 (WAT), 33 (WAT), 96, 103 i32.load8_u i64.xor (WAT), 37, 83 i32.lt_s (WAT), 35 id (HTML), 145, 146 i32.lt_u (WAT), 36 Idle (Chrome profiler), 188 274 Index IEEE-754, 76 loader.instantiate, 262 if (WAT), 34, 35, 38, 50, 100, 112, 136 memory, 161 if/else (WAT), 34, 36 memory.buffer, 54, 161 ImageData (JavaScript), 159, 161, 162 new, 262 immediately-invoked function putImageData, 162, 163 expression (IIFE), 24, 65, 124, requestAnimationFrame, 163, 164, 194 130, 144, 145, 259, 260 require, 15 import (WAT), 21, 54, 56, 61, 64, 67, 118 style.display, 145 --importMemory (asc), 252 TextDecoder, 90, 92, 149 Incognito window (Chrome), 186 .then, 16 inheritance, 262 Uint8Array, 20 inlining, 199 Uint8ClampedArray, 161 innerHTML (JavaScript), 149 Uint16Array, 253 input (HTML), 146, 149, 150 Uint32Array, 251 installing (AssemblyScript), 248 WebAssembly.instantiate, 16, 218, instantiate (JavaScript), 142, 145 220, 259 instantiateStreaming (JavaScript), WebAssembly.instantiateStreaming, 142, 145 145, 164 Instruction Set Architecture (ISA), 2, 9 WebAssembly.Memory, 23, 118, 124 integer, 71, 76, 77, 78, 80, 82–83 WebAssembly.Memory.buffer, 149, 165 Intermediate Representation (IR), 185, WebAssembly.Memory.grow, 119 196, 219, 219–220 WebAssembly.Table, 60 Internet Explorer, 11 JavaScript glue code, 4, 6, 155 Internet of Things (IoT), 4 JavaScript heap memory, 189 JavaScript IR bytecode, 185 J Java Virtual Machine (JVM), 9 JavaScript just-in-time (JIT), 2, 3, 8, 219 !!, 47, 53 JS Flame Chart (Firefox profiler), 194, alert, 232, 245 195 ArrayBuffer, 116 JS Heap, 188–190 async, 24 JumpIfFalse (Chrome IR), 221 canvas.getContext, 160 JVM (Java Virtual Machine), 9 console.log. See console.log (JavaScript) L console.trace, 233, 236, 246 last-in first-out (LIFO), 8 const, 124, 128 LdaSmi (Chrome IR), 221 ctx.putImageData, 190, 191 LdaSmi.ExtraWide (Chrome IR), 221 Date, 209 LdaZero (Chrome IR), 221 Date.now, 210, 213 least significant digit, 78 demangle, 262 left shifts, 199 document.getElementById, 158, 160 length-prefixed string, 93–94 fetch, 145, 259 linear memory, 21, 22, 25, 71, 88, for, 162, 219 100, 104, 116–138, 148–155, fs, 216, 259 159–176, 180 ImageData, 159, 161, 162 Linux, 11–13 innerHTML, 149 Lisp, 9 instantiate, 142, 145 little-endian,