mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Don't use GC::Root unnecessarily in Error stack traces
This was causing a fair bit of root registration churn on pages that throw lots of errors. Since there's no need for these pointers to float around freely, we can just visit them during the mark phase as usual.
This commit is contained in:
committed by
Andreas Kling
parent
6ca69d9e26
commit
2d76e21cfd
Notes:
github-actions[bot]
2025-11-30 10:55:07 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/2d76e21cfdc Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6977
@@ -21,7 +21,7 @@ struct JS_API TracebackFrame {
|
||||
Utf16String function_name;
|
||||
[[nodiscard]] SourceRange const& source_range() const;
|
||||
|
||||
GC::Root<CachedSourceRange> cached_source_range;
|
||||
GC::Ptr<CachedSourceRange> cached_source_range;
|
||||
};
|
||||
|
||||
enum CompactTraceback {
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
protected:
|
||||
explicit Error(Object& prototype);
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
private:
|
||||
virtual bool is_error_object() const final { return true; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user