[JSC] Shrink sizeof(RegExp)
Created attachment 365685 [details] Patch
Created attachment 365752 [details] Patch
Comment on attachment 365752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365752&action=review r=me with fixes. > Source/JavaScriptCore/runtime/RegExp.cpp:266 > + auto& jitCode = createRegExpJITCodeIfNecessary(); Let's rename createRegExpJITCodeIfNecessary() to ensureRegExpJITCode(). See below. > Source/JavaScriptCore/runtime/RegExp.cpp:324 > + auto& jitCode = createRegExpJITCodeIfNecessary(); Ditto: rename. > Source/JavaScriptCore/runtime/RegExp.cpp:445 > + break; Should this be a RELEASE_ASSERT_NOT_REACHED()? The pre-existing code implies that it is not expecting these cases to be possible. > Source/JavaScriptCore/runtime/RegExp.h:164 > + Yarr::YarrCodeBlock& createRegExpJITCodeIfNecessary() Let's call this ensureRegExpJITCode(). I believe that is the way we typically name this idiom.
Comment on attachment 365752 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365752&action=review Thanks! >> Source/JavaScriptCore/runtime/RegExp.cpp:266 >> + auto& jitCode = createRegExpJITCodeIfNecessary(); > > Let's rename createRegExpJITCodeIfNecessary() to ensureRegExpJITCode(). See below. Fixed. >> Source/JavaScriptCore/runtime/RegExp.cpp:324 >> + auto& jitCode = createRegExpJITCodeIfNecessary(); > > Ditto: rename. Fixed. >> Source/JavaScriptCore/runtime/RegExp.cpp:445 >> + break; > > Should this be a RELEASE_ASSERT_NOT_REACHED()? The pre-existing code implies that it is not expecting these cases to be possible. This function is only called for debugging. And I think we should dump null address instead if ParseError or NotCompiled appears. I've changed jit8BitMatchOnlyAddr etc. to take an initializer, which makes content of this array zero-filled. >> Source/JavaScriptCore/runtime/RegExp.h:164 >> + Yarr::YarrCodeBlock& createRegExpJITCodeIfNecessary() > > Let's call this ensureRegExpJITCode(). I believe that is the way we typically name this idiom. Fixed.
Committed r243408: <https://trac.webkit.org/changeset/243408>
<rdar://problem/49191251>