Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 803ff7d

Browse filesBrowse files
mertcanaltinaduh95
authored andcommitted
src: cache context lookup in vectored io loops
PR-URL: #61387 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 606184f commit 803ff7d
Copy full SHA for 803ff7d

5 files changed

+8-7Lines changed: 8 additions & 7 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/env-inl.h‎

Copy file name to clipboardExpand all lines: src/env-inl.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ v8::Local<v8::Context> Environment::context() const {
898898
return principal_realm()->context();
899899
}
900900

901-
Realm* Environment::principal_realm() const {
901+
PrincipalRealm* Environment::principal_realm() const {
902902
return principal_realm_.get();
903903
}
904904

Collapse file

‎src/env.h‎

Copy file name to clipboardExpand all lines: src/env.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ class Environment final : public MemoryRetainer {
886886
// Get the context with an explicit realm instead when possible.
887887
// Deprecate soon.
888888
inline v8::Local<v8::Context> context() const;
889-
inline Realm* principal_realm() const;
889+
inline PrincipalRealm* principal_realm() const;
890890

891891
#if HAVE_INSPECTOR
892892
inline inspector::Agent* inspector_agent() const {
Collapse file

‎src/node_realm-inl.h‎

Copy file name to clipboardExpand all lines: src/node_realm-inl.h
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include "node_context_data.h"
77
#include "node_realm.h"
8+
#include "util-inl.h"
89

910
namespace node {
1011

@@ -46,6 +47,10 @@ inline v8::Isolate* Realm::isolate() const {
4647
return isolate_;
4748
}
4849

50+
inline v8::Local<v8::Context> Realm::context() const {
51+
return PersistentToLocal::Strong(context_);
52+
}
53+
4954
inline Realm::Kind Realm::kind() const {
5055
return kind_;
5156
}
Collapse file

‎src/node_realm.cc‎

Copy file name to clipboardExpand all lines: src/node_realm.cc
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,6 @@ void Realm::VerifyNoStrongBaseObjects() {
295295
});
296296
}
297297

298-
v8::Local<v8::Context> Realm::context() const {
299-
return PersistentToLocal::Strong(context_);
300-
}
301-
302298
// Per-realm strong value accessors. The per-realm values should avoid being
303299
// accessed across realms.
304300
#define V(PropertyName, TypeName) \
Collapse file

‎src/node_realm.h‎

Copy file name to clipboardExpand all lines: src/node_realm.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class Realm : public MemoryRetainer {
121121
inline Environment* env() const;
122122
inline v8::Isolate* isolate() const;
123123
inline Kind kind() const;
124-
virtual v8::Local<v8::Context> context() const;
124+
inline virtual v8::Local<v8::Context> context() const;
125125
inline bool has_run_bootstrapping_code() const;
126126

127127
// Methods created using SetMethod(), SetPrototypeMethod(), etc. inside

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.