mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +00:00
LibJS: Make Error stack traces lazier
Instead of eagerly populating the stack trace with a textual representation of every call frame, just store the raw source code range (code, start offset, end offset). From that, we can generate the full rich backtrace when requested, and save ourselves the trouble otherwise. This makes test-wasm take ~7 seconds on my machine instead of ~60. :^)
This commit is contained in:
parent
6c81b90e5a
commit
87ac906ee6
8 changed files with 51 additions and 20 deletions
|
@ -58,6 +58,9 @@ public:
|
|||
|
||||
[[nodiscard]] SourceRange source_range() const;
|
||||
u32 start_offset() const { return m_start_offset; }
|
||||
u32 end_offset() const { return m_end_offset; }
|
||||
|
||||
SourceCode const& source_code() const { return *m_source_code; }
|
||||
|
||||
void set_end_offset(Badge<Parser>, u32 end_offset) { m_end_offset = end_offset; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue