TODO (3019B)
1 Misc ideas: 2 - use custom printf to avoid compatibility issues with floating point numbers 3 - consistent naming for preprocessor defines 4 - unify coding style and naming conventions 5 - use names from the ECMA spec in library implementation 6 - use byte code emitters with typed arguments (for clarity) 7 - use 2 bytecode DynBufs in JSFunctionDef, one for reading, one for writing 8 and use the same wrappers in all phases 9 - use more generic method for line numbers in resolve_variables and resolve_labels 10 - use custom timezone support to avoid C library compatibility issues 11 12 Memory: 13 - use memory pools for objects, etc? 14 - test border cases for max number of atoms, object properties, string length 15 - add emergency malloc mode for out of memory exceptions. 16 - test all DynBuf memory errors 17 - test all js_realloc memory errors 18 - improve JS_ComputeMemoryUsage() with more info 19 20 Built-in standard library: 21 - BSD sockets 22 - modules: use realpath in module name normalizer and put it in quickjs-libc 23 - modules: if no ".", use a well known module loading path ? 24 - get rid of __loadScript, use more common name 25 26 REPL: 27 - debugger 28 - readline: support MS Windows terminal 29 - readline: handle dynamic terminal resizing 30 - readline: handle double width unicode characters 31 - multiline editing 32 - runtime object and function inspectors 33 - interactive object browser 34 - use more generic approach to display evaluation results 35 - improve directive handling: dispatch, colorize, completion... 36 - save history 37 - close all predefined methods in repl.js and jscalc.js 38 39 Optimization ideas: 40 - 64-bit atoms in 64-bit mode ? 41 - 64-bit small bigint in 64-bit mode ? 42 - reuse stack slots for disjoint scopes, if strip 43 - add heuristic to avoid some cycles in closures 44 - small String (0-2 charcodes) with immediate storage 45 - perform static string concatenation at compile time 46 - optimize string concatenation with ropes or miniropes? 47 - add implicit numeric strings for Uint32 numbers? 48 - optimize `s += a + b`, `s += a.b` and similar simple expressions 49 - ensure string canonical representation and optimise comparisons and hashes? 50 - remove JSObject.first_weak_ref, use bit+context based hashed array for weak references 51 - property access optimization on the global object, functions, 52 prototypes and special non extensible objects. 53 - create object literals with the correct length by backpatching length argument 54 - remove redundant set_loc_uninitialized/check_uninitialized opcodes 55 - peephole optim: push_atom_value, to_propkey -> push_atom_value 56 - peephole optim: put_loc x, get_loc_check x -> set_loc x 57 - convert slow array to fast array when all properties != length are numeric 58 - optimize destructuring assignments for global and local variables 59 - implement some form of tail-call-optimization 60 - optimize OP_apply 61 - optimize f(...b) 62 63 Test262o: 0/11262 errors, 463 excluded 64 Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch) 65 66 Result: 8/76947 errors, 1497 excluded, 8117 skipped 67 Test262 commit: 6cbb6da9473c56d95358d8e679c5a6d2b4574efb