diff --git a/src/env-inl.h b/src/env-inl.h index 08df9c061ac91f..92aa400f9e09f6 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -1227,9 +1227,8 @@ int64_t Environment::base_object_count() const { #define VS(PropertyName, StringValue) V(v8::String, PropertyName) #define V(TypeName, PropertyName) \ inline \ - v8::Local IsolateData::PropertyName(v8::Isolate* isolate) const { \ - /* Strings are immutable so casting away const-ness here is okay. */ \ - return const_cast(this)->PropertyName ## _.Get(isolate); \ + v8::Local IsolateData::PropertyName() const { \ + return PropertyName ## _ .Get(isolate_); \ } PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) @@ -1244,7 +1243,7 @@ int64_t Environment::base_object_count() const { #define VS(PropertyName, StringValue) V(v8::String, PropertyName) #define V(TypeName, PropertyName) \ inline v8::Local Environment::PropertyName() const { \ - return isolate_data()->PropertyName(isolate()); \ + return isolate_data()->PropertyName(); \ } PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) diff --git a/src/env.cc b/src/env.cc index 2bdac964cb03ca..688c9466ca9229 100644 --- a/src/env.cc +++ b/src/env.cc @@ -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 diff --git a/src/env.h b/src/env.h index c04a8ef179fc99..6e7315b43b9359 100644 --- a/src/env.h +++ b/src/env.h @@ -502,7 +502,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 PropertyName(v8::Isolate* isolate) const; + inline v8::Local PropertyName() const; PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) PER_ISOLATE_STRING_PROPERTIES(VS)