Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to parse map objects with js engine v8 source code

Shulou Source: shulou.com Published: 2022-06-01 16:06:51 09月17日 Update

Js engine v8 source code how to parse map object, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Let's start by introducing the Map class. Let's look at the class definition first.

/ / All heap objects have a Map that describes their structure.

/ / A Map contains information about:

/ /-Size information about the object

/ /-How to iterate over an object (for garbage collection)

Class Map: public HeapObject {

Public:

/ / instance size.

Inline int instance_size ()

Inline void set_instance_size (int value)

/ / instance type.

Inline InstanceType instance_type ()

Inline void set_instance_type (InstanceType value)

/ / tells how many unused property fields are available in the instance.

/ (only used for JSObject in fast mode)

Inline int unused_property_fields ()

Inline void set_unused_property_fields (int value)

/ / bit field.

Inline byte bit_field ()

Inline void set_bit_field (byte value)

/ / Tells whether this object has a special lookup behavior.

Void set_special_lookup () {

Set_bit_field (bit_field ()) | (1

Tags: Attributes objects bytes tags content functions addresses questions engines source code more faceted offset analysis help solutions easy easy code memory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia vpn Redmi Linux Apple