Hi, I was wondering whether breaking the invariant "elements transitions always go from specific to generic" will break something. I don't know. But given that Vyacheslav proposed doing this, and nobody came up with objections detailing what will break, maybe it won't break anything?
Is the goal to just optimize "Array(n).fill(something)" (that exact syntactic pattern) or more generally, make Array.prototype.fill transition to a more specific ElementsKind if certain conditions are met? On Mon, Feb 10, 2025 at 6:53 PM Benjamin Kietzman <[email protected]> wrote: > Currently, calling Array.fill will produce an array with HOLEY elements. > > > %DebugPrint(Array(1).fill(0)) > DebugPrint: 0000015DF1C8CF29: [JSArray] > - map: 0x00280f5cf721 <Map[32](HOLEY_SMI_ELEMENTS)> [FastProperties] > - prototype: 0x02f93035a851 <JSArray[0]> > - elements: 0x015df1c8cf49 <FixedArray[1]> [HOLEY_SMI_ELEMENTS] > - length: 1 > > This seems like a missed opportunity for optimization since the new array > could be upgraded to PACKED_SMI_ELEMENTS. There's a very old issue about > this https://issues.chromium.org/issues/42210138 which hasn't collected > any objections. > > I'd be a first time contributor to V8 but I'd be happy to try patching > this. All advice would be welcome! > > Ben Kietzman > > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/v8-dev/77180799-00e5-402b-b99d-727039dc409cn%40googlegroups.com > <https://groups.google.com/d/msgid/v8-dev/77180799-00e5-402b-b99d-727039dc409cn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Google Germany GmbH Erika-Mann-Straße 33 80636 München Geschäftsführer: Paul Manicle, Liana Sebastian. Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde. This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person. -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/v8-dev/CAED6dUALoJNjO2PF5K_qkCFK6DEy4s-ez36nZrf2XY5NWyMmhg%40mail.gmail.com.
