electron/shell/common/gin_helper
Charles Kerr 0492f0f745
perf: have ErrorThrower lazily lookup the current isolate (#46388)
perf: have ErrorThrower lazy-lookup the current isolate

ErrorThrower's default constructor is marked as "should rarely if ever
be used" because it's expensive to call.

Unfortunately, nearly every instance of ErrorThrower comes as an argument
in gin_helper's JS-->C++ function marshalling where a thrower is
default-constructed and then populated in gin_helper::GetNextArgument()
with an assignment operator to a temporary ErrorThrower constructed
with the gin::Arguments' isolate.

tldr: most of the time we use the slow constructor first, then throw
that work away unused by overwriting with a fast-constructed one.

This refactor avoids that cost by deferring the expensive work to
`ErrorThrower::isolate()`, where it happens only as a fallback iff
isolate_ hasn't been set.
2025-04-01 12:25:27 -05:00
..
accessor.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
arguments.cc chore: cleanup include groupings (#43478) 2024-08-26 10:44:20 -04:00
arguments.h chore: migrate base::StringPiece to std::string_view (#40915) 2024-01-10 19:00:37 -06:00
callback.cc chore: bump chromium to 135.0.7027.0 (main) (#45677) 2025-02-21 14:46:51 -08:00
callback.h refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45484) 2025-02-07 10:44:19 +09:00
cleaned_up_at_exit.cc fix: crash in gin::wrappable::secondweakcallback (#45368) 2025-01-29 10:20:37 -08:00
cleaned_up_at_exit.h fix: crash in gin::wrappable::secondweakcallback (#45368) 2025-01-29 10:20:37 -08:00
constructible.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
constructor.h refactor: make a variadic gin_helper::internal::InvokeFactory() (#45988) 2025-03-13 17:24:49 -05:00
destroyable.cc chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
destroyable.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
dictionary.h perf: avoid duplicate calculations in gin_helper::Dictionary getters (#43073) 2024-07-29 12:43:28 -05:00
error_thrower.cc perf: have ErrorThrower lazily lookup the current isolate (#46388) 2025-04-01 12:25:27 -05:00
error_thrower.h perf: have ErrorThrower lazily lookup the current isolate (#46388) 2025-04-01 12:25:27 -05:00
event.cc chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
event.h refactor: declare gin::Wrapper subclasses as final (#43527) 2024-09-04 18:40:02 -05:00
event_emitter.h perf: avoid redundant method calls in EventEmitter (#45786) 2025-02-25 19:20:33 -06:00
event_emitter_caller.cc refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45484) 2025-02-07 10:44:19 +09:00
event_emitter_caller.h refactor: do not use AdaptCallbackForRepeating() in electron_api_url_loader.cc (#45771) 2025-02-24 11:09:01 -05:00
event_emitter_template.cc chore: migrate to v8::Object::SetPrototypeV2() (#43535) 2024-09-04 20:30:54 -05:00
event_emitter_template.h refactor: simplify events (#37099) 2023-02-13 13:39:18 -08:00
function_template.cc chore: remove unused #includes (#42971) 2024-07-22 11:31:32 +02:00
function_template.h refactor: simplify Invoker::IsOK() (#45803) 2025-02-26 18:50:57 -06:00
function_template_extensions.h chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
locker.cc chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
locker.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
microtasks_scope.cc refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45484) 2025-02-07 10:44:19 +09:00
microtasks_scope.h refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45484) 2025-02-07 10:44:19 +09:00
object_template_builder.cc chore: migrate base::StringPiece to std::string_view (#40915) 2024-01-10 19:00:37 -06:00
object_template_builder.h chore: migrate base::StringPiece to std::string_view (#40915) 2024-01-10 19:00:37 -06:00
persistent_dictionary.cc chore: remove native_mate (Part 12) (#20869) 2019-10-31 16:56:00 +09:00
persistent_dictionary.h perf: avoid duplicate calculations in gin_helper::Dictionary getters (#43073) 2024-07-29 12:43:28 -05:00
pinnable.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
promise.cc refactor: only pass v8::Context to gin_helper::MicrotasksScope constructor (#45484) 2025-02-07 10:44:19 +09:00
promise.h refactor: reduce code duplication in gin_helper::Promise (#43716) 2024-09-16 23:08:40 -05:00
reply_channel.cc feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
reply_channel.h feat: service worker preload scripts for improved extensions support (#44411) 2025-01-31 09:32:45 -05:00
trackable_object.cc chore: fix clang-tidy warnings (#38079) 2023-04-26 10:09:54 -04:00
trackable_object.h refactor: return-braced-init-list pt 2 of 2 (#44870) 2024-11-29 11:44:33 -06:00
wrappable.cc refactor: remove unused gin_helper::WrappableBase::GetWrapper(v8::Isolate*) (#45793) 2025-02-25 19:50:09 -06:00
wrappable.h chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
wrappable_base.h refactor: remove unused gin_helper::WrappableBase::GetWrapper(v8::Isolate*) (#45793) 2025-02-25 19:50:09 -06:00