'What is the internal data-types in V8 Compiler

While using the heap-stats tool for V8, I found that the memory is represented by some internal terms (possibly the V8 representations) under the JS sections.

Where can i find the descriptions of what are these?

JS

Also, what do these represent?

  1. SCRIPT_SOURCE_EXTERNAL_TWO_BYTE_TYPE and SCRIPT_SOURCE_EXTERNAL_ONE_BYTE_TYPE under Code section. Are these my source code? Why are they represented in 2byte and 1 byte type separately?
  2. The data types under JS section.

Is there any documentation to find out what datatypes (in JS) they represent?



Solution 1:[1]

Where can i find the descriptions of what are these?

They're "instance types", and they're essentially the way V8 distinguishes different types of (internal) objects on its heap. Being an internal implementation detail, they're not publicly described or documented. They can (and do!) change at any time, and unless you work on V8, you're not supposed to have a reason to care about them. They're defined here and here.

SCRIPT_SOURCE_EXTERNAL_TWO_BYTE_TYPE and SCRIPT_SOURCE_EXTERNAL_ONE_BYTE_TYPE under Code section. Are these my source code?

Yes.

Why are they represented in 2byte and 1 byte type separately?

Special-casing one-byte strings is a memory-saving optimization.

The data types under JS section. Is there any documentation to find out what datatypes (in JS) they represent?

No, but in most cases it should be pretty obvious from their names, e.g. JS_ARRAY_BUFFER_TYPE is for ArrayBuffer objects.

data-types in V8 Compiler

To be nitpicky: this doesn't have anything to do with the compiler; it's a part of the internal object model.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jmrk