public-regexp-destructor.patch (1345B)
1 diff --git a/js/src/irregexp/imported/regexp-stack.cc b/js/src/irregexp/imported/regexp-stack.cc 2 index 1978ca1894..dac5e920ec 100644 3 --- a/imported/regexp-stack.cc 4 +++ b/imported/regexp-stack.cc 5 @@ -23,6 +23,8 @@ 6 7 RegExpStack::~RegExpStack() { thread_local_.FreeAndInvalidate(); } 8 9 +#ifndef COMPILING_IRREGEXP_FOR_EXTERNAL_EMBEDDER 10 + 11 // static 12 RegExpStack* RegExpStack::New() { 13 #ifdef V8_ENABLE_SANDBOX_HARDWARE_SUPPORT 14 @@ -56,6 +58,8 @@ 15 #endif 16 } 17 18 +#endif // !COMPILING_IRREGEXP_FOR_EXTERNAL_EMBEDDER 19 + 20 char* RegExpStack::ArchiveStack(char* to) { 21 if (!thread_local_.owns_memory_) { 22 // Force dynamic stacks prior to archiving. Any growth will do. A dynamic 23 diff --git a/js/src/irregexp/imported/regexp-stack.h b/js/src/irregexp/imported/regexp-stack.h 24 index ed16c7ff2b..90b303b1b7 100644 25 --- a/imported/regexp-stack.h 26 +++ b/imported/regexp-stack.h 27 @@ -92,12 +92,10 @@ 28 // Maximal size of allocated stack area. 29 static constexpr size_t kMaximumStackSize = 64 * MB; 30 31 - private: 32 - // Currently private as we need to use New/Delete instead. 33 - // TODO(426514762): revert this change once its no longer needed. 34 RegExpStack(); 35 ~RegExpStack(); 36 37 + private: 38 // Artificial limit used when the thread-local state has been destroyed. 39 static const Address kMemoryTop = 40 static_cast<Address>(static_cast<uintptr_t>(-1));