[BigInt] Simplify boolean context evaluation by leveraging JSString::offsetOfLength() == JSBigInt::offsetOfLength()
Created attachment 357105 [details] Patch
Created attachment 357106 [details] Patch
Attachment 357106 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.h:180: JSBigInt_length is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 357106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357106&action=review > Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp:64 > + , JSBigInt_length(JSString_length) Can we add a new field called something like JSBigIntOrString_length then when we load from this in that scenario we can use that field?
Comment on attachment 357106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357106&action=review > Source/JavaScriptCore/jit/AssemblyHelpers.cpp:799 > + ASSERT(JSString::offsetOfLength() == JSBigInt::offsetOfLength()); Let’s do RELEASE_ASSERT. LLVM will remove this branch anyways
Comment on attachment 357106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357106&action=review Thank you! >> Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp:64 >> + , JSBigInt_length(JSString_length) > > Can we add a new field called something like JSBigIntOrString_length then when we load from this in that scenario we can use that field? Sounds nice. Fixed. >> Source/JavaScriptCore/jit/AssemblyHelpers.cpp:799 >> + ASSERT(JSString::offsetOfLength() == JSBigInt::offsetOfLength()); > > Let’s do RELEASE_ASSERT. LLVM will remove this branch anyways OK, changed :)
Comment on attachment 357106 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=357106&action=review >>> Source/JavaScriptCore/ftl/FTLAbstractHeapRepository.cpp:64 >>> + , JSBigInt_length(JSString_length) >> >> Can we add a new field called something like JSBigIntOrString_length then when we load from this in that scenario we can use that field? > > Sounds nice. Fixed. I added JSBigIntOrString_length field, and make JSString_length and JSBigInt_length as references& to this abstract heap.
Committed r239099: <https://trac.webkit.org/changeset/239099>
<rdar://problem/46654988>