`L: for (const v of [...]) { continue L; }` aborted with
Assertion `!v.isEmpty()' failed, and `continue OUTER` from a nested
loop silently terminated the script.
A `continue <label>` whose label targets a for-of loop was left to be
resolved by LabelledStatementNode after the loop body, by which point
the for-of iterator-cleanup try block had registered the jump as a
complex case. It was then morphed into a JumpComplexCase that unwound
the try block, wrongly closing the iterator and leaving an empty Value
in the result register.
A previous per-loop attempt (8fd141b2) was reverted (60b1202a) because
a single m_currentLoopLabel leaked into nested loops and broke test262.
Track all labels directly targeting a loop (m_currentLoopLabels), clear
the list when entering each loop body so nested loops never inherit it,
and let for-of/for-in resolve continues for its own labels to
continuePosition (a plain jump, identical to an unlabeled continue)
before the try block is registered as a complex case.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* shared structure `BreakpointLocationsInfo` between debuggger and ByteCodeBlock can cause memory leaks
* correctly delete each `BreakpointLocationsInfo`
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* Prepare the property and key list before object creation
* The new way reduce size of object structure with transition
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* Compute stack limit correctly through pthread API or Windows internal API
* Store stack limit in TLS(or global) not a VMInstance or ExecutionState
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* should trigger an exception when callee or target object is indeed undefined in optional chaining
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* if there is too big expression, bytecode generation can be failed
* fix some errors on 64-bit platform through using int
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
* debugger always stops at the start of new Script execution
* BreakpointLocationsInfo is added to debugger when Escargot generates bytecode for execution only
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* `initializeFunctionScript` API is added
* unlike dynamically created function, `initializeFunctionScript` supports debugger
* origin line offset is added for correct source code calculation in debugger
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* we can choose JS source code for debugging target
* selectively generating debugging byte code (breakpoint)
* add debugger init option (--skip=) to exclude certain source code from debugging
* rename debugger functions
* explicitly present the python version for debugger tool
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
* turn on parserEnable flag in ScriptParser only
* Always store breakpointLocations in debugger(debugger can be turn on later)
Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
- The debugger callbacks are implemented as class
- Using std::vector for storing data
Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
* fix debugger to add breakpoint at the first line
* fix debugger not to insert any breakpoint when compiling dynamic code
* add some assertion code to detect undesirable cases
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>