#54287: perf: use plain pointers in stack-only gin_helper types
Merged
Created: Sep 24, 2026, 2:33:54 AM
Merged: Sep 24, 2026, 4:51:26 AM
2 comments
Target: main
Description of Change
Follow-up to #54286, which took the upstream gin versions of this. These gin_helper types are only ever constructed on the stack for one binding call or one conversion, so holding their pointers in raw_ptr<> cost a BackupRefPtr acquire/release each time with nothing to protect. They are now STACK_ALLOCATED() with plain pointers:
Invoker::args_(our fork of the code https://crrev.com/c/8455902 changes), andDispatchToCallbacktakes the callback by const ref (https://crrev.com/c/8455325)ErrorThrower::isolate_(per call, for every method taking a thrower)Handle<T>::object_(per wrappable create/return)Promise::SettleScope::isolate_(was alreadyCPPGC_STACK_ALLOCATED())ObjectBuilder::isolate_(per converted event payload)V8Serializer/V8Deserializer::isolate_(per IPC message / MessagePort post)
Heap-held holders (PromiseBase, PersistentDictionary, CallbackHolderBase, KeyWeakMap) are unchanged.
Checklist
- PR description included
Release Notes
Notes: none
Backports
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron