Skip to content

Commit 63cc069

Browse files
addaleaxaduh95
authored andcommitted
src: mark realm leaf classes final
Since these classes use virtual methods extensively, adding `final` should allow compilers to optimize accesses better. PR-URL: #59355 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
1 parent fde9434 commit 63cc069

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/node_realm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Realm : public MemoryRetainer {
157157
CleanupQueue cleanup_queue_;
158158
};
159159

160-
class PrincipalRealm : public Realm {
160+
class PrincipalRealm final : public Realm {
161161
public:
162162
PrincipalRealm(Environment* env,
163163
v8::Local<v8::Context> context,

src/node_shadow_realm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace node {
1010
namespace shadow_realm {
1111

12-
class ShadowRealm : public Realm {
12+
class ShadowRealm final : public Realm {
1313
public:
1414
static ShadowRealm* New(Environment* env);
1515

0 commit comments

Comments
 (0)