src: simplify IsolateData shortcut accesses

PR-URL: https://github.com/nodejs/node/pull/32407
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
This commit is contained in:
Anna Henningsen authored and Myles Borins committed 2020-03-24 12:25:23 -04:00
1 parent 2fe351f6c3
commit 2bcf535a05
3 files changed
+6 -7

No files matched your search

+3 -4
View File
@@ -1243,9 +1243,8 @@ int64_t Environment::base_object_count() const {
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
#define V(TypeName, PropertyName) \
inline \
v8::Local<TypeName> IsolateData::PropertyName(v8::Isolate* isolate) const { \
/* Strings are immutable so casting away const-ness here is okay. */ \
return const_cast<IsolateData*>(this)->PropertyName ## _.Get(isolate); \
v8::Local<TypeName> IsolateData::PropertyName() const { \
return PropertyName ## _ .Get(isolate_); \
}
PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
PER_ISOLATE_SYMBOL_PROPERTIES(VY)
@@ -1260,7 +1259,7 @@ int64_t Environment::base_object_count() const {
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
#define V(TypeName, PropertyName) \
inline v8::Local<TypeName> Environment::PropertyName() const { \
return isolate_data()->PropertyName(isolate()); \
return isolate_data()->PropertyName(); \
}
PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
PER_ISOLATE_SYMBOL_PROPERTIES(VY)
+2 -2
View File
@@ -181,12 +181,12 @@ IsolateData::IsolateData(Isolate* isolate,
void IsolateData::MemoryInfo(MemoryTracker* tracker) const {
#define V(PropertyName, StringValue) \
tracker->TrackField(#PropertyName, PropertyName(isolate()));
tracker->TrackField(#PropertyName, PropertyName());
PER_ISOLATE_SYMBOL_PROPERTIES(V)
#undef V
#define V(PropertyName, StringValue) \
tracker->TrackField(#PropertyName, PropertyName(isolate()));
tracker->TrackField(#PropertyName, PropertyName());
PER_ISOLATE_STRING_PROPERTIES(V)
#undef V
+1 -1
View File
@@ -500,7 +500,7 @@ class IsolateData : public MemoryRetainer {
#define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName)
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
#define V(TypeName, PropertyName) \
inline v8::Local<TypeName> PropertyName(v8::Isolate* isolate) const;
inline v8::Local<TypeName> PropertyName() const;
PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP)
PER_ISOLATE_SYMBOL_PROPERTIES(VY)
PER_ISOLATE_STRING_PROPERTIES(VS)