[SOLVED] What do these turbofan memory zones mean?

Issue

I was playing around with the V8 engine and stumbled upon the zone stats tool. I understand the zone memory concept, but what are these different zones in zone stats memory?

When I upload a trace zone memory log into it, I see that there are for zones for turbofan:

  1. graph-zone
  2. instruction-zone
  3. pipeline-compilation-job-zone
  4. register-allocation-zone

I understand that the compilation job zone is used for compiling (maybe?correct me if I am wrong), but what are the other zones?

Solution

(V8 developer here.) Since Turbofan is a compiler, all the zones it uses are used for compiling.

It uses more than one zone so that temporary data that’s only needed for a short time can be freed afterwards, whereas the main zone sticks around until the entire compilation job is completed. This is most obvious for the "register-allocation-zone", which is used by the register allocator.

I’m not exactly sure what the differences between the other zones are, and to be honest I don’t think it’s particularly important: if you’re specifically working on reducing Turbofan’s peak memory consumption, then you probably already know (or can easily find out by reading a bit of code); and otherwise, there’s no need for you to care. The specific set of zones may also change at any time. As a JavaScript developer, these kinds of compiler internals definitely don’t concern you.

Answered By – jmrk

Answer Checked By – Candace Johnson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *