On Sat, May 18, 2019 at 11:29 AM Joe Smith <iexploitt...@gmail.com> wrote: > Script: > > ``` > var arr = [1,2,3,4,5]; > arr.push(10); > arr.push("HELLO"); > ``` > > Using d8.cc with v8 compiled with coverage tracking I can see that the > following functions are not hit when executing the above script. > > https://github.com/v8/v8/blob/master/src/builtins/builtins-array.cc#L299 > https://github.com/v8/v8/blob/master/src/builtins/builtins-array.cc#L365 > > Where is array.push executed if it isn't these functions within > v8/src/builtins/builtins-array.cc?
You're looking at the fallback path for Array#push() calls for irregular arrays or non-array objects. The fast path is generated ahead of time[0]. It's C++ code that generates machine code at V8 build time and it's that machine code that is executed at run-time. [0] https://github.com/v8/v8/blob/c93858abcd73a4632db955392232ba1d1d21c3af/src/builtins/builtins-array-gen.cc#L411-L536 -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/CAHQurc9e0kB6%2B8by7poz_0xg9HR5KhXG-rerx7QaQOgfH90OCw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.