- Allow plain value, const, temp reg as the expression value without forcing
into a const/temp which improves some bytecode.
- Also allow a non-temp reg (reg-bound identifier) for "top level assignment"
statements like "x = 123;". This kind of assignment can safely use a reg-
bound identifier as the expression value because the register in question
won't be used/mutated by the surrounding expression.
- Also allow an unresolved operation (e.g. addition) as an initial expression
value (later coerced to a side effect free plain value). This avoids an
unnecessary temporary register for assigments like "x = y + z;". For a
top level assignment the addition is resolved directly into "x" and the
assignment expression value becomes the register of "x". This is safe for
top level assignments. For other assignments a temp register is used.
- Similar improvements for assign-with-op (e.g. "x += y") so that top
level assign-with-op expressions produce better bytecode.
The top level assignment case is detected using nud/led counts. The top
level assignment optimization should be safe because:
- Assignment is parsed in a right associative manner, so that the RHS can't
contain any more assignment level expressions.
- The only relevant lower binding power construct is comma expression.
It's possible that the assignment happens inside a comma expression,
e.g. "x = y, z, y", but that's safe because the expression value of
"x = y" is ignored by the comma expression so it doesn't matter if it
mutates later on in the comma expression.
Allow simultaneous "allow const" and "require temporary register" meaning that
the only regconst rejected is a non-temp register (register-bound identifier).
- Add config guards for debug throw/pause uncaught
- Add one missing DUK_USE_DEBUGGER_SUPPORT guard in master
- Add config guards for new config options
- Use duk_debug_halt_execution() for DEBUGGER stmt, which fixes the off-by-one
line number for debugger statement when the executor gets paused
- Add internal duk_safe_to_hstring() and combined safe_to_hstring +
duk_debug_write_hstring() helpers to debugger code
- Debug command capitalization in debug messages
- Some debugger assert additions; in particular, assert that when doing a
halt or entering the message loop the debugger is attached (if this is
not a requirement, it will need special handling)
Duk_debug.js fixes for Throw notify
- Ignore unknown Notify messages, this is probably a better default than
being strict and dropping the connection.
- Add Throw notify command number (earlier GC notify was unused).
- Add minimal web UI integration to report "THROW: xxx" or "UNCAUGHT: xxx"
from Throw notifys
Add 'make rundebug' convenience duk_debug target with logging.