Compilation method and device and analysis method and device

By using multiple arrays and index mechanisms to store data offset values ​​in bytecode files, the size and performance problems caused by the large amount of referenced data in bytecode files are solved, and the bit width of the reference instructions is achieved without increasing the bit width. The effect of storing more data.

CN118519637APending Publication Date: 2024-08-20HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310154098.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-17
Publication Date
2024-08-20

AI Technical Summary

Technical Problem

When existing bytecode files store a large amount of reference data, it is easy to exceed the reference bit width limit, resulting in a large file size or the need to be split into multiple files, increasing I/O overhead and performance degradation.

Method used

By using multiple arrays to store the offset value of the data, create a new array when the storage margin is insufficient, and indirectly read the offset value combined with the index of the instruction group to reduce the bit width of the reference instruction and implement it in a bytecode file. Store more data.

Benefits of technology

Without increasing the reference instruction bit width, the size of the bytecode file and the number of reads are reduced, performance is improved, and I/O overhead is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519637A_ABST
    Figure CN118519637A_ABST
Patent Text Reader

Abstract

The invention provides a compiling method, an analyzing method and a device, and relates to a byte code file which can use a plurality of constant pools to store the deviation value of data, and when the storage margin of the created constant pools is insufficient, a new constant pool is created to continue to store the deviation value of the data. In this way, it can be guaranteed that each array does not exceed the number limit of the offset value, the reference bit width of the reference instruction can be guaranteed, and therefore the size of the byte code file is reduced, and when the number of data exceeds the number limit of the offset of one array, the byte code file can be rapidly and accurately read. According to the method, the source code file can be compiled into the bytecode file by creating the new array, so that the reading times of the bytecode file can be reduced, the I / O overhead can be reduced, and the performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of electronic technology, and more specifically, to a compilation method, a parsing method and a device. Background Art

[0002] The application developer compiles the source code file into a bytecode file through a compiler, and packages the bytecode file and other files into an application installation package, and then publishes the application installation package to the application platform. The user downloads the application installation package published by the application developer on the application platform through the terminal. The terminal parses the bytecode file from the application installation package and calls the virtual machine in the terminal to execute the bytecode file, thereby completing the startup and operation of the application.

[0003] There are a large number of reference instructions in the above bytecode files. The reference bit width of the reference instruction, that is, the length of the address code of the reference instruction, directly affects the size and execution performance of the bytecode file. Usually, the reference bit width of the reference instruction is controlled by limiting the number of referenced data in the bytecode file. For example, if the number of referenced data is limited to 65536, then 65536 data can be encoded by 2 bytes, or 65536 data can be distinguished by 2 bytes, that is, a reference bit width of 2 bytes can be used.

[0004] However, for larger applications, the number of referenced data can easily exceed the limit. When the number of referenced data exceeds the limit, either divide the application into multiple bytecode files for storage or increase the reference bit width. Dividing the application into multiple bytecode files for storage will increase the number of bytecode file reads, resulting in increased input / output (I / O) overhead and performance degradation; using a long reference bit width will result in a large bytecode file size. Summary of the invention

[0005] The embodiments of the present application provide a compilation method, a parsing method and a device, which can store more data in a bytecode file without increasing the reference bit width of the reference instruction.

[0006] In a first aspect, a compiling method is provided, and the method can be executed by a compiling device. Optionally, the compiling device can be an electronic device, or a module or unit (such as a compiler or a virtual compiler) in the electronic device.

[0007] The method comprises: obtaining a source code file; compiling the source code file to obtain a bytecode file, wherein the bytecode file comprises a first instruction group and a second instruction group, wherein offset values ​​of data referenced by reference instructions in the first instruction group are stored in a first array, and offset values ​​of data referenced by reference instructions in the second instruction group are stored in a second array, wherein the second array is created when storage margin of the first array is insufficient.

[0008] In the above method, the bytecode file uses multiple arrays (such as the first array and the second array) to store the offset values ​​of the data, and when the storage margin of the created array (such as the first array) is insufficient, a new array (the second array) is created to continue to store the offset values ​​of the data, so that each array does not exceed the limit on the number of offset values, which helps to ensure the reference bit width of the reference instruction, thereby reducing the size of the bytecode file, and when the amount of data exceeds the limit on the number of offsets of an array, the source code file can be compiled into a bytecode file by creating a new array, which can reduce the number of times the bytecode file is read, helping to reduce I / O overhead and improve performance. Therefore, based on the above method, more data can be stored in the bytecode file without increasing the reference bit width of the reference instruction.

[0009] In combination with the first aspect, in a possible implementation, the bytecode file further includes a third array, the third array includes the offset value of the first array and the offset value of the second array; the first instruction group includes the index of the first array in the third array; the second instruction group includes the index of the second array in the third array. This method can indirectly read the offset value of the array storing the data offset value through the index in the instruction group. The index value of the array is smaller than the offset value of the array, so this method helps to reduce the size of the bytecode file.

[0010] In combination with the first aspect or any implementation thereof, in another possible implementation, the first instruction group includes the offset value of the first array; the second instruction group includes the offset value of the second array. In this manner, the offset value of the array storing the data offset value can be directly read in the instruction group, and the instruction parsing speed is faster.

[0011] In combination with the first aspect or any implementation thereof, in another possible implementation, the total amount of offset values ​​supported for storage by the first array and / or the second array is less than or equal to 65536; the reference bit width of the reference instruction in the first instruction group and / or the reference bit width of the reference instruction in the second instruction group is less than or equal to 2 bytes.

[0012] Among them, when the total amount of offset values ​​supported by the array for storage is less than 65536 and the reference bit width of the reference instruction is less than 2 bytes, such as when the total amount of offset values ​​supported by the array for storage is 256 and the reference bit width of the reference instruction is 1 byte, compared with when the total amount of offset values ​​supported by the array for storage is 65536 and the reference bit width of the reference instruction is 2 bytes, the size of the bytecode file can be further reduced due to the use of a reference bit width smaller than 2 bytes.

[0013] In combination with the first aspect or any implementation thereof, in another possible implementation, the bytecode file further includes a third instruction group, the offset value of the data referenced by the reference instruction in the third instruction group is stored in a fourth array, and the fourth array is dedicated to storing the offset value of the data referenced by the reference instruction in the third instruction group. In this way, the independence of data can be maintained in a runtime concurrent scenario, and memory overhead can be reduced.

[0014] In combination with the first aspect or any implementation thereof, in another possible implementation, the first instruction group and / or the second instruction group is: a function, a combination of a preset number of instructions, or a combination of instructions corresponding to debugging information.

[0015] In combination with the first aspect or any implementation manner thereof, in another possible implementation manner, the first array and / or the second array includes offset values ​​of multiple types of data.

[0016] In combination with the first aspect or any implementation manner thereof, in another possible implementation manner, the offset values ​​included in the first array are different; and / or the offset values ​​included in the second array are different.

[0017] In other words, the offset values ​​in the same array can be deduplicated, which helps reduce redundant data and thus reduce the size of the bytecode file.

[0018] In a second aspect, a parsing method is provided, and the method can be executed by a parsing device. Optionally, the parsing device can be an electronic device, or a module or unit (such as a virtual machine) in the electronic device.

[0019] The method comprises: obtaining a bytecode file, the bytecode file comprising a first instruction group and a second instruction group, wherein offset values ​​of data referenced by reference instructions in the first instruction group are stored in a first array, and offset values ​​of data referenced by reference instructions in the second instruction group are stored in a second array, wherein the second array is created when storage margin of the first array is insufficient; and parsing the bytecode file.

[0020] In a possible implementation manner, the parsing the bytecode file includes: parsing the bytecode file according to a file type of the bytecode file.

[0021] In combination with the second aspect, in a possible implementation, the bytecode file further includes a third array, the third array includes the offset value of the first array and the offset value of the second array; the first instruction group includes the index of the first array in the third array; the second instruction group includes the index of the second array in the third array. The parsing of the bytecode file includes: taking the first reference instruction in the first instruction group as an example, when parsing the first reference instruction, first read the offset of the first array from the third array according to the index of the first array in the first instruction group in the third array, then read the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the first array, and then obtain the referenced data according to the read offset.

[0022] In combination with the second aspect or any implementation thereof, in another possible implementation, the first instruction group includes an offset value of the first array; the second instruction group includes an offset value of the second array. The parsing of the bytecode file includes: taking the first reference instruction in the first instruction group as an example, when parsing the first reference instruction, first read the offset of the first array from the first instruction group, then read the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the first array, and then obtain the referenced data according to the read offset.

[0023] In combination with the second aspect or any implementation thereof, in another possible implementation, the total amount of offset values ​​supported for storage by the first array and / or the second array is less than or equal to 65536; the reference bit width of the reference instruction in the first instruction group and / or the reference bit width of the reference instruction in the second instruction group is less than or equal to 2 bytes.

[0024] In combination with the second aspect or any implementation thereof, in another possible implementation, the bytecode file also includes a third instruction group, the offset value of the data referenced by the reference instruction in the third instruction group is stored in a fourth array, and the fourth array is dedicated to storing the offset value of the data referenced by the reference instruction in the third instruction group.

[0025] In combination with the second aspect or any implementation thereof, in another possible implementation, the first instruction group and / or the second instruction group is: a function, a combination of a preset number of instructions, or a combination of instructions corresponding to debugging information.

[0026] In combination with the second aspect or any implementation manner thereof, in another possible implementation manner, the first array and / or the second array includes offset values ​​of multiple types of data.

[0027] In combination with the second aspect or any implementation thereof, in another possible implementation, the offset values ​​included in the first array are different; and / or the offset values ​​included in the second array are different.

[0028] According to a third aspect, an electronic device is provided, which includes a module / unit for executing the method of the first aspect or any possible design thereof, or includes a module / unit for executing the method of the second aspect or any possible design thereof; these modules / units can be implemented by hardware, or corresponding software can be implemented by hardware.

[0029] In a fourth aspect, a chip is provided, which is coupled to a memory in an electronic device and is used to call a computer program stored in the memory and execute the above-mentioned first aspect or any possible design of the technical solution, or to call a computer program stored in the memory and execute the above-mentioned second aspect or any possible design of the technical solution; wherein "coupling" means that two components are directly or indirectly combined with each other.

[0030] In a fifth aspect, a computer-readable storage medium is provided, which includes a computer program. When the computer program runs on an electronic device, the electronic device executes a technical solution as described in the first aspect and any possible design thereof, or executes a technical solution as described in the second aspect and any possible design thereof.

[0031] In a sixth aspect, a computer program is provided, which includes instructions. When the instructions are run on a computer, the computer executes a technical solution as described in the first aspect and any possible design thereof, or executes a technical solution as described in the second aspect and any possible design thereof.

[0032] In a seventh aspect, a processing system is provided, the system comprising any one of the above-mentioned electronic devices.

[0033] It should be noted that the beneficial effects of the second to seventh aspects can refer to the beneficial effects of the first aspect or its implementation method and will not be described in detail. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.

[0035] Figure 2 This is a schematic diagram of the compilation process.

[0036] Figure 3 It is an application scenario of virtual machine technology.

[0037] Figure 4 It is a schematic diagram of direct and indirect quotations.

[0038] Figure 5 This is a schematic diagram of a layout of class files.

[0039] Figure 6 It is the process referenced by the parsing instructions of the class file.

[0040] Figure 7 This is a schematic diagram of a layout of dex files.

[0041] Figure 8 It is an example of the bytecode file format of an embodiment of the present application.

[0042] Fig. 9 It is another example of the bytecode file format of an embodiment of the present application.

[0043] Fig.10 It is a schematic flow chart of the compilation method provided in the embodiment of the present application.

[0044] Fig.11 It is a schematic flow chart of the analysis method provided in the embodiment of the present application.

[0045] Fig.12 It is a schematic diagram of the composition of the device 10 provided in an embodiment of the present application.

[0046] Fig.13 It is a schematic diagram of the composition of the device 20 provided in the embodiment of the present application. DETAILED DESCRIPTION

[0047] To facilitate understanding of the embodiments of the present application, the following explanations are made before introducing the embodiments of the present application: in the embodiments of the present application, the first, second, third and various numbers are only distinguished for the convenience of description and are not used to limit the scope of the embodiments of the present application, for example, to distinguish different arrays, etc.; the definitions of many characteristics listed in the present application are only used to explain the functions of the characteristics in an illustrative manner, and the details thereof can refer to the prior art; the words "exemplary", "for example", "exemplarily", "as (another) example" and the like are used to indicate examples, illustrations or explanations, and any embodiment or design scheme described as an "example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of the word "example" is intended to present the concept in a specific way; the terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized; "plurality" refers to two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural.

[0048] The compilation method and / or parsing method provided in the embodiments of the present application can be implemented by electronic devices, and the present application does not limit the specific type and implementation form of the electronic device. For example, the electronic device can be a desktop computer, a smart phone, a tablet computer, a laptop computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a vehicle-mounted device, a wearable device, a foldable device, and other electronic devices. It can also be applied to mobile devices such as car computers and robots. Electronic devices include but are not limited to those equipped with Electronic devices running Harmony OS or other operating systems.

[0049] For example, Figure 1 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0050] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0051] Among them, the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units may be independent components or integrated into one or more processors. In some embodiments, the electronic device 101 may also include one or more processors 110. Among them, the controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be set in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a high-speed cache memory. The memory may save instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 101 in processing data or executing instructions.

[0052] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that complies with the USB standard specification, and can specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 101, and can also be used to transmit data between the electronic device 101 and a peripheral device. The USB interface 130 can also be used to connect headphones to play audio through the headphones.

[0053] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0054] The internal memory 121 can be used to store one or more computer programs, which include instructions. The processor 110 can run the above instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store data (such as photos, contacts, etc.) created during the use of the electronic device 101. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, a flash memory component, a universal flash storage (UFS), an embedded multimedia card (eMMC), etc. In some embodiments, the processor 110 can enable the electronic device 101 to execute the method provided in the embodiment of the present application, as well as other applications and data processing by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor 110. The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0055] Before introducing the embodiments of the present application, several concepts related to the embodiments of the present application are first introduced.

[0056] 1. Virtual Machine Technology

[0057] Files in computers are generally stored in binary format. With the actual demand for compatibility between different programming languages ​​and different architectures, virtual machine technology came into being, such as the Java Virtual Machine (JVM) and the Android Runtime (ART).

[0058] In virtual machine technology, a compiler (also called a virtual machine compiler) takes a source code file as input and converts the source code file into a bytecode file; a virtual machine takes a bytecode file as input and executes the instructions in the bytecode file. The compiler can be a computer program stored in a developer terminal, and the virtual machine is an executable program on a user terminal (such as a mobile phone, smart watch, or tablet computer). The developer terminal and / or the user terminal can be an electronic device, such as Figure 1 The electronic device 100 shown. The above bytecode file may also be called a binary file or a virtual machine file, etc. For the convenience of description, it is collectively referred to as a bytecode file below.

[0059] Compilation is the process of converting or translating one file (source file) into another file (target file). The process of converting a source code file into a bytecode file is called compilation. Figure 2 As shown, compilation can include the following main steps:

[0060] 1) Parser: parses the source file into an intermediate representation (IR);

[0061] 2) Optimization: Optimize the intermediate expressions obtained through parsing, such as dead code elimination, loop unrolling, function inlining, code sinking, etc.

[0062] 3) Emitter: Generates a file based on the target file format after optimizing the intermediate expression.

[0063] In some implementations, the technical solution provided by the embodiments of the present application can be applied in the emitter stage.

[0064] For example, Figure 3 Figure 1 shows an application scenario of virtual machine technology. Figure 3 As shown, the application developer compiles the source code file into a bytecode file through a compiler, and packages the bytecode file and other files (such as pictures, text, audio, and video, etc.) into an application installation package, and then publishes the application installation package to the application platform. The user downloads the application installation package published by the application developer on the application platform through the terminal, and the terminal parses the bytecode file from the application installation package and calls the virtual machine in the terminal to execute the bytecode file, thereby completing the startup and operation of the application.

[0065] 2. Reference instructions

[0066] In the bytecode files mentioned above, there are a large number of instructions that reference data, which can be collectively referred to as reference instructions. Common reference instructions include the following two categories:

[0067] 1) Instructions for loading constant strings

[0068] For example, the ldc instruction in the JVM bytecode file (i.e., class file), the const_string instruction in the ART bytecode file (i.e., dex file), etc.

[0069] 2) Function call instruction

[0070] For example, the invokevirtual instruction in the class file, the invoke-virtual instruction in the dex file, etc.

[0071] Reference bit width of reference instruction: The reference instruction consists of two parts: operation code and address code. The operation code is used to indicate the operation performed or function possessed by the reference instruction, and the address code is used to indicate the location of the data used by the reference instruction. The length of the address code of the reference instruction can also be called the reference bit width of the instruction.

[0072] 3. Direct and indirect quotations

[0073] Since reference instructions exist in large quantities in bytecode files, the encoding method of referenced data in reference instructions will directly affect the size and execution performance of bytecode files. In the current bytecode file format, there are two encoding methods for reference instructions, namely direct reference and indirect reference.

[0074] Figure 4 It is a schematic diagram of direct and indirect quotations. Figure 4 Figure (a) shows a direct reference, that is, a direct reference through the offset of the data in the bytecode file. For example, the offset of the data is 0x1A2B3C4D, and the reference instruction can be CALL 0x1A2B3C4D, that is, the reference instruction references the data through the offset of the data. Figure 4 Figure (b) shows an indirect reference. In this method, there is an array in the bytecode file that records the offset of all data. The data can be indirectly referenced by the index of the data offset in the array. For example, the array offset is 0x0011, the array includes 6 offsets, the data offset is 0x1A2B3C4D, the data offset index in the array is 0x1, and the reference instruction can be CALL0x1.

[0075] Direct references are often used in executable program file formats, such as the executable and linkable format (ELF) file format. The advantage of direct references is that the speed of accessing data is relatively faster, but the disadvantage is that the reference bit width is very long, such as ELF needs to use 4 bytes to encode data. Therefore, the size of the bytecode file generated using direct reference encoding is often very large.

[0076] Indirect references can reduce the reference bit width. For example, the JVM class file format and ART dex file format both use a reference bit width of 2 bytes to reference data. Indirect references sacrifice some data access performance to reduce the size of bytecode files.

[0077] 4. JVM bytecode file format

[0078] The JVM bytecode file format is the class file format, which uses indirect references and controls the reference bit width by strictly limiting the number of data.

[0079] Figure 5 A schematic diagram showing a layout of a class file. Figure 5 The offset 0, offset 1, offset 2, offset 3... offset 10... etc. in the class file are the offsets of the data. The array composed of these offsets is also called a constant pool in the class file format. Each class file includes a constant pool. The file header of the class file format includes the offset of the constant pool, which is located at a fixed offset in the class file. The class file format stipulates that the number of offsets in a constant pool cannot exceed 65536 (that is, the maximum value that can be encoded by 2 bytes). The reference bit width of the reference instruction in the class file format is 2 bytes, such as Figure 5 Invokevirtual0x0002 and invokevirtual 0x000a are shown, where 0x0002 is the index of offset 2 in the constant pool, and 0x000a is the index of offset 10 in the constant pool.

[0080] Each class in the JVM source code file (ie, java file) will be compiled into a class file, that is, the number of class files compiled from each java file is equal to the number of classes in the java file. However, if the number of data in a class in the JVM source code file exceeds 65536, that is, exceeds the limit on the number of offsets in the constant pool, the class will not be compiled to generate a class file or will be compiled into multiple class files so that the reference bit width of the reference instruction remains at 2 bytes.

[0081] Figure 6 The following figure shows the process of parsing instruction references in class files. Take the reference instruction invokevirtual 0x0002 as an example. Figure 6 As shown, when parsing invokevirtual 0x0002, first read the offset of the constant pool from the file header, then read offset 2 with an index value of 0x0002 from the array pointed to by the offset of the constant pool, and then get the referenced data according to offset 2.

[0082] 5. ART bytecode file format

[0083] The ART bytecode file format is the dex file format. Similar to the class file format, the dex file format also uses indirect references and controls the reference bit width of the introduction instruction by limiting the amount of data in a constant pool. The number of offsets in a constant pool cannot exceed 65536 (the maximum value that can be encoded by 2 bytes). Unlike the class file format, the ART source code file will be compiled into a dex file.

[0084] However, if the amount of data in the ART source code file exceeds 65536, that is, exceeds the limit on the number of offsets in the constant pool, the developer needs to configure additional compilation options during compilation to make the generated dex file adapt to this scenario:

[0085] 1) If the number of classes or functions exceeds 65536, the ART source code file will be compiled into multiple dex files so that the reference bit width of the reference instruction remains at 2 bytes;

[0086] 2) If the number of strings exceeds 65536, one way to deal with it is to compile the ART source code file into multiple dex files. Another way to deal with it is to relax the limit on the number of offsets in the constant pool to 65536*65536 (that is, the maximum value that can be encoded by 4 bytes). At the same time, the reference bit width of the reference instruction can be relaxed to 4 bytes, that is, for data within 65536, the reference bit width of the reference instruction is 2 bytes, and for data outside 65536, the reference bit width of the reference instruction is 4 bytes.

[0087] Figure 7 A schematic diagram showing a layout of a dex file. Figure 7 Take the case where the number of strings exceeds 65536 as an example. The file header of the dex file format includes the offset of the constant pool, which is located at a fixed offset in the dex file. For the first 65536 offsets in the constant pool (i.e., offset 0 to offset 0xffff), the reference bit width of the reference instruction is 2 bytes, such as Figure 7 The const-string 0x0002 in the constant pool is 0x0002, where 0x0002 is the index of offset 2 in the constant pool. For the 65537th offset and subsequent offsets in the constant pool, the reference bit width of the reference instruction is 4 bytes, such as Figure 7 The const-string-jumbo 0x0001ffff in the constant pool is 0x0001ffff, where 0x0001ffff is the index of the offset 0x1ffff in the constant pool.

[0088] The process of parsing instruction references of dex files is similar to that of class files, so I will not go into details.

[0089] The data of a relatively large application can easily exceed the limit of 65536. In this case, based on the current layout of bytecode files, either the application is divided into multiple bytecode files for storage, or a long reference bit width is used (such as the direct reference above, such as Figure 7 ART string references shown in the figure). Dividing the application into multiple bytecode files for storage will increase the number of bytecode file reads, resulting in increased I / O overhead and performance degradation; using a long reference bit width will result in a large bytecode file size.

[0090] In response to the above problems, an embodiment of the present application provides a bytecode file format that can store more data in a bytecode file without increasing the reference bit width of the reference instruction.

[0091] Specifically, the bytecode file format of the embodiment of the present application supports the use of multiple constant pools to store the offset value of the data, and the length of each constant pool does not exceed the specified maximum length to control the reference bit width of the reference instruction, including a set of reference instructions containing constant pool information to indicate that the offset of the data referenced by the reference instruction in the reference unit is stored in the constant pool. In this way, when the amount of data in the source code file exceeds the length specified by a single constant pool, multiple constant pools can be used to store the offset of these data, so there is no need to compile the source code file into multiple bytecode files, which helps to reduce I / O overhead and improve performance; and because the reference bit width of the reference instruction is not increased, the size of the bytecode file is also relatively small.

[0092] In an embodiment of the present application, a group of reference instructions expected to correspond to the same constant pool is divided into a reference unit. Exemplarily, the reference unit may include at least one of the following: a function, a preset number of instruction combinations, or a combination of instructions corresponding to debugging information.

[0093] In an embodiment of the present application, a constant pool may include offset values ​​of data referenced by one or more reference units, that is, one or more reference units may correspond to a constant pool. Data in the same constant pool may be deduplicated, that is, the offset values ​​in the same constant pool are different to reduce redundant data.

[0094] The embodiment of the present application does not limit the type of data corresponding to the offset value included in the constant pool. A constant pool may include offset values ​​of multiple types of data, or may only include offset values ​​of a certain type of data. The type here may include at least one of the following: string, method, function, or class.

[0095] The multiple constant pools of the embodiment of the present application can be created in a manner that: when the storage margin of the created constant pool is insufficient, a new constant pool is created. In addition, some reference units can also correspond to separate constant pools, that is, a constant pool is dedicated to storing the offset values ​​of the data referenced by these reference units, so that the independence of the data can be maintained in the runtime concurrent scenario and the memory overhead can be reduced.

[0096] The embodiment of the present application does not limit the total amount of offset values ​​(or the length of the constant pool) supported by the constant pool for storage. Optionally, the total amount of offset values ​​supported by the constant pool for storage is less than or equal to 65536, and accordingly, the reference bit width of the reference instruction is also less than or equal to 2 bytes. For example, the total amount of offset values ​​supported by the constant pool for storage is 65536, and the reference bit width of the reference instruction is 2 bytes. For another example, the total amount of offset values ​​supported by the constant pool for storage is 256, and the reference bit width of the reference instruction is 1 byte. In other words, based on the bytecode file format of the embodiment of the present application, a length less than or equal to 65536 can be set for the constant pool, and the reference bit width of the reference instruction can also be less than or equal to 2 bytes accordingly. When the length of the constant pool is less than 65536 and the reference bit width of the reference instruction is less than 2 bytes, due to the use of a smaller reference bit width, the volume of the bytecode file can be further reduced.

[0097] A specific implementation of the bytecode file format of the embodiment of the present application is: the bytecode file includes a constant pool table, one or more constant pools, and one or more reference units, wherein the constant pool table is used to store the offset of the one or more constant pools, and each of the one or more reference units includes the index (or offset value) of its corresponding constant pool in the constant pool table, and the reference instruction in the reference unit references the data by the offset of the data in the constant pool. Optionally, the constant pool table can be stored in the file header of the bytecode file. For this implementation, the process of parsing instruction references is: first read the index of the constant pool in the constant pool table in the reference unit, the index of the constant pool in the constant pool table reads the offset of the constant pool from the constant pool table, and then reads the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the constant pool, and then obtains the referenced data according to the read offset.

[0098] Figure 8 It is an example of the bytecode file format of an embodiment of the present application. Figure 8 In the example, the reference unit is a function. Figure 8As shown, the bytecode file includes multiple constant pools such as constant pool 0 and constant pool 1, and there is a constant pool table for recording the offset of each constant pool; function 1 includes the index of constant pool 1 in the constant pool table (i.e., 0x1), which means that the offsets of the referenced data in function 1 are all stored in constant pool 1, and the reference bit width of the referenced instruction in function 1 is 2 bytes, such as 0x0002 of referenced instruction 1 and 0x0003 of referenced instruction 2, where 0x0002 and 0x0003 are the indexes of the offsets of the data in constant pool 1; function 2 includes the index of constant pool 0 in the constant pool table (i.e., 0x0), which means that the offsets of the referenced data in function 2 are all stored in constant pool 0, and the reference bit width of the referenced instruction in function 2 is 2 bytes, such as 0x0002 of referenced instruction 3 and 0x0003 of referenced instruction 4, where 0x0002 and 0x0003 are the indexes of the offsets of the data in constant pool 0.

[0099] Another specific implementation of the bytecode file format of the embodiment of the present application is: the bytecode file includes one or more constant pools, one or more reference units, wherein each of the one or more reference units includes the offset value of the corresponding constant pool, and the reference instruction in the reference unit references the data through the offset of the data in the constant pool. In this implementation, the file header of the bytecode file may not include the offset of the constant pool. For this implementation, the process of parsing instruction references can be: first read the offset of the constant pool in the reference unit, then read the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the constant pool, and then obtain the referenced data according to the read offset. Compared with the reference unit including the index of the constant pool in the constant pool table, this implementation can directly read the constant pool offset value in the reference unit, and the speed of parsing instructions is faster.

[0100] Fig. 9 is another example of the bytecode file format of the embodiment of the present application. Figure 8 The difference is that the bytecode file does not include the constant pool table, and the reference unit includes the offset of the constant pool, rather than the index of the constant pool in the constant pool table. Specifically, taking the reference unit as a function as an example, Fig. 9As shown, the bytecode file includes multiple constant pools such as constant pool 0 and constant pool 1; function 1 includes the offset of constant pool 1, which means that the offsets of the referenced data in function 1 are all stored in constant pool 1, and the reference bit width of the referenced instruction in function 1 is 2 bytes, such as 0x0002 of referenced instruction 1 and 0x0003 of referenced instruction 2, where 0x0002 and 0x0003 are the indexes of the offsets of the data in constant pool 1; function 2 includes the offset of constant pool 0, which means that the offsets of the referenced data in function 2 are all stored in constant pool 0, and the reference bit width of the referenced instruction in function 2 is 2 bytes, such as 0x0002 of referenced instruction 3 and 0x0003 of referenced instruction 4, where 0x0002 and 0x0003 are the indexes of the offsets of the data in constant pool 0.

[0101] It should be noted that the embodiment of the present application refers to the array storing the offset of data as a constant pool, and the array storing the constant pool offset as a constant pool table, but in fact they may also be called other names, and their names may change depending on the application scenario.

[0102] By adopting the bytecode file format provided by the present application, more data can be stored in a bytecode file. For most applications, by adopting the bytecode file format provided by the present application, the application can be compiled into a bytecode file, which helps to reduce I / O overhead and improve performance. In addition, by adopting the bytecode file format provided by the present application, the reference bit width of the reference instruction can be kept constant, the size of the bytecode file is relatively small, the speed of reading the reference instruction is faster, and the performance is better.

[0103] Fig.10 It is a schematic flow chart of the compilation method provided in the embodiment of the present application. Fig.10 The method 1000 shown can be executed by a compiling device, or by a module or unit (such as a compiler or a virtual machine compiler) in the compiling device. Figure 1 The electronic device shown. The instruction groups in method 1000, such as the first instruction group, the second instruction group, and the third instruction group, may correspond to the reference unit described above; the first array, the second array, and the fourth array may correspond to the constant pool described above; and the third array may correspond to the constant pool table described above.

[0104] Step 1010, obtaining source code files.

[0105] Step 1020, compile the source code file to obtain a bytecode file.

[0106] The present application embodiment does not limit the specific implementation method of compilation, such as including Figure 2The parser, optimizer and transmitter described above can generate bytecode files that meet the bytecode file format provided by this application.

[0107] The bytecode file includes a first instruction group and a second instruction group, the offset values ​​of the data referenced by the reference instructions in the first instruction group are stored in the first array, and the offset values ​​of the data referenced by the reference instructions in the second instruction group are stored in the second array, and the second array is created when the storage margin of the first array is insufficient. For example, assuming that the number of data referenced by the first instruction group is 50 and the maximum length limit of the first array is 65536, when compiling the first instruction group, the first array has stored the offsets of 65500 data, and the storage margin of the first array is 36, that is, the first array can also store 36 offsets, which is less than 50. In this case, a new second array can be created to store the offset values ​​of the data referenced by the first instruction group.

[0108] Optionally, the bytecode file further includes a third array, the third array includes the offset value of the first array and the offset value of the second array; the first instruction group includes the index of the first array in the third array; the second instruction group includes the index of the second array in the third array. For a detailed description, please refer to Figure 8 , I will not go into details here.

[0109] Optionally, the first instruction group includes the offset value of the first array; the second instruction group includes the offset value of the second array. Fig. 9 , I will not go into details here.

[0110] Optionally, the total amount of offset values ​​supported for storage by the first array and / or the second array is less than or equal to 65536; the reference bit width of the reference instruction in the first instruction group and / or the reference bit width of the reference instruction in the second instruction group is less than or equal to 2 bytes. For example, the total amount of offset values ​​supported for storage by the first array and / or the second array is 65536, and correspondingly, the reference bit width of the reference instruction therein is 2 bytes. For another example, the total amount of offset values ​​supported for storage by the first array and / or the second array is 256, and correspondingly, the reference bit width of the reference instruction therein is 1 byte.

[0111] Optionally, the bytecode file further includes a third instruction group, and the offset value of the data referenced by the reference instruction in the third instruction group is stored in a fourth array, and the fourth array is dedicated to storing the offset value of the data referenced by the reference instruction in the third instruction group. In this way, the independence of the data referenced in the third instruction group can be maintained in a runtime concurrent scenario, and memory overhead can be reduced.

[0112] Optionally, the first instruction group and / or the second instruction group is: a function, a combination of a preset number of instructions, or a combination of instructions corresponding to debugging information.

[0113] Optionally, the first array and / or the second array includes offset values ​​of multiple types of data.

[0114] Optionally, the offset values ​​included in the first array are different; and / or, the offset values ​​included in the second array are different. In other words, the offset values ​​in the same array can be deduplicated. For example, taking the compilation of the first instruction group as an example, when compiling the first instruction group, it can be detected whether the first array already includes some or all of the offset values ​​of the data referenced by the first instruction group, and if so, it can be used directly.

[0115] In addition, Figure 3 In the scenario shown, after the bytecode file is obtained, an application installation package may be further generated according to the bytecode file.

[0116] The description of the bytecode file in method 1000 can be further referred to above and will not be described in detail here.

[0117] Fig.11 It is a schematic flow chart of the analysis method provided in the embodiment of the present application. Fig.11 The method 1100 shown can be executed by the analysis device, or by a module or unit (such as a virtual machine) in the analysis device. Optionally, the analysis device is a user terminal, and the user terminal can be Figure 1 The electronic device shown. The instruction groups in method 1100, such as the first instruction group, the second instruction group, and the third instruction group, may correspond to the reference unit described above; the first array, the second array, and the fourth array may correspond to the constant pool described above; and the third array may correspond to the constant pool table described above.

[0118] Step 1110, obtaining the bytecode file.

[0119] For example, for Figure 3 In the scenario shown, the bytecode file may be obtained by parsing the application installation package.

[0120] Among them, the bytecode file includes a first instruction group and a second instruction group, the offset value of the data referenced by the reference instruction in the first instruction group is stored in a first array, and the offset value of the data referenced by the reference instruction in the second instruction group is stored in a second array, and the second array is created when the storage margin of the first array is insufficient.

[0121] Step 1120, parse the bytecode file.

[0122] Optionally, the bytecode file also includes a third array, the third array includes the offset value of the first array and the offset value of the second array; the first instruction group includes the index of the first array in the third array; the second instruction group includes the index of the second array in the third array. In this case, parsing the bytecode file may include: taking the first reference instruction in the first instruction group as an example, when parsing the first reference instruction, first read the offset of the first array from the third array according to the index of the first array in the first instruction group in the third array, then read the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the first array, and then obtain the referenced data according to the read offset.

[0123] Optionally, the first instruction group includes the offset value of the first array; the second instruction group includes the offset value of the second array. In this case, parsing the bytecode file may include: taking the first reference instruction in the first instruction group as an example, when parsing the first reference instruction, first read the offset of the first array from the first instruction group, then read the offset corresponding to the index included in the reference instruction from the array pointed to by the offset of the first array, and then obtain the referenced data according to the read offset.

[0124] The description of the bytecode file in method 1100 can be found above and will not be described in detail here.

[0125] Above, combined Fig.10 and Fig.11 The method provided by this application is described below. Fig.12 and Fig.13 An apparatus embodiment of the present application is described.

[0126] It can be understood that in order to realize the functions in the above method embodiment, Fig.12 and Fig.13 The device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0127] The embodiment of the present application can divide the functional modules of the device according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The above modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0128] Fig.12 The schematic diagram of the composition of the device 10 provided in the embodiment of the present application is shown as follows: Fig.12 As shown, the device 10 includes: an acquisition unit 11 and a processing unit 12.

[0129] When the device 10 is used to implement Fig.10 In the method shown in the figure, the acquisition unit 11 is used to obtain the source code file, that is, to execute Fig.10 Step 1000. The processing unit 12 is used to compile the source code file to obtain a bytecode file, that is, to execute Fig.10 Step 1010.

[0130] When the device 10 is used to implement Fig.11 When the method shown in the figure is used, the acquisition unit 11 is used to obtain the bytecode file, that is, to execute Fig.11 Step 1100. The processing unit 12 is used to parse the bytecode file, that is, to execute Fig.11 Step 1110.

[0131] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here. The device 10 provided in the embodiment of the present application is used to execute the method described above, so it can achieve the same effect as the method described above.

[0132] Fig.13 The schematic diagram of the composition of the device 20 provided in the embodiment of the present application is shown as follows: Fig.12 As shown, the device 20 includes a processor 21. The processor 21 is coupled to a memory 23, and the memory 23 is used to store instructions. When the device 20 is used to implement the method described above, the processor 21 is used to execute the instructions in the memory 23 to implement the functions of the processing unit 12.

[0133] Optionally, the device 20 further includes a memory 23 .

[0134] Optionally, the device 20 further includes an interface circuit 22. The processor 21 and the interface circuit 22 are coupled to each other. It is understood that the interface circuit 22 may be a transceiver or an input / output interface. When the device 20 is used to implement the method described above, the processor 21 is used to execute instructions to implement the functions of the processing unit 12, and the interface circuit 22 is used to implement the functions of the acquisition unit 11.

[0135] The embodiment of the present application also provides an electronic device, including: a processor, a memory, an application program, and a computer program. The above-mentioned devices can be connected via one or more communication buses. Among them, the one or more computer programs are stored in the above-mentioned memory and are configured to be executed by the one or more processors, and the one or more computer programs include instructions, and the above-mentioned instructions can be used to enable the electronic device to perform each step in the above-mentioned method embodiment.

[0136] Exemplarily, the processor may be Figure 1 The processor 110 shown in the figure, the above-mentioned memory can be specifically Figure 1 An internal memory 120 and / or an external memory connected to the electronic device is shown.

[0137] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the compilation method or the parsing method described in any possible implementation method in the foregoing text is executed.

[0138] This embodiment also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the compilation method or parsing method in the above-mentioned embodiment.

[0139] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the compiling method or parsing method in the above-mentioned embodiment.

[0140] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the compilation method or parsing method in the above-mentioned method embodiments.

[0141] An embodiment of the present application also provides a processing system, which includes any one of the devices provided in the above embodiments.

[0142] The explanation of the relevant contents and beneficial effects of any of the above-mentioned devices can be referred to the corresponding method embodiments provided above, which will not be repeated here.

[0143] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0144] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0145] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0147] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0148] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A parsing method, It is characterized in that The method comprises: Acquire a bytecode file, the bytecode file comprising a first instruction group and a second instruction group, the offset values ​​of data referenced by the reference instructions in the first instruction group are stored in a first array, the offset values ​​of data referenced by the reference instructions in the second instruction group are stored in a second array, and the second array is created when the storage margin of the first array is insufficient; The bytecode file is parsed.

2. The method according to claim 1, It is characterized in that The bytecode file further includes a third array, wherein the third array includes an offset value of the first array and an offset value of the second array; The first instruction group includes an index of the first array in the third array; The second instruction group includes an index of the second array in the third array.

3. The method according to claim 1, It is characterized in that The first instruction group includes an offset value of the first array; The second instruction group includes an offset value of the second array.

4. The method according to any one of claims 1 to 3, It is characterized in that The total amount of offset values ​​supported for storage by the first array and / or the second array is less than or equal to 65536; The reference bit width of the reference instruction in the first instruction group and / or the reference bit width of the reference instruction in the second instruction group is less than or equal to 2 bytes.

5. The method according to any one of claims 1 to 4, It is characterized in that The bytecode file also includes a third instruction group, the offset values ​​of the data referenced by the reference instructions in the third instruction group are stored in a fourth array, and the fourth array is dedicated to storing the offset values ​​of the data referenced by the reference instructions in the third instruction group.

6. The method according to any one of claims 1 to 5, It is characterized in that The first instruction group and / or the second instruction group is: a function, a combination of a preset number of instructions, or a combination of instructions corresponding to debugging information.

7. The method according to any one of claims 1 to 6, It is characterized in that The first array and / or the second array includes offset values ​​of multiple types of data.

8. The method according to any one of claims 1 to 7, It is characterized in that The first array includes different offset values; and / or, The second array includes different offset values.

9. A compilation method, It is characterized in that The method comprises: Get the source code file; The source code file is compiled to obtain a bytecode file, wherein the bytecode file includes a first instruction group and a second instruction group, wherein offset values ​​of data referenced by reference instructions in the first instruction group are stored in a first array, and offset values ​​of data referenced by reference instructions in the second instruction group are stored in a second array, and the second array is created when storage margin of the first array is insufficient.

10. The method according to claim 9, It is characterized in that The bytecode file further includes a third array, wherein the third array includes an offset value of the first array and an offset value of the second array; The first instruction group includes an index of the first array in the third array; The second instruction group includes an index of the second array in the third array.

11. The method according to claim 9, It is characterized in that The first instruction group includes an offset value of the first array; The second instruction group includes an offset value of the second array.

12. The method according to any one of claims 9 to 11, It is characterized in that The total amount of offset values ​​supported for storage by the first array and / or the second array is less than or equal to 65536; The reference bit width of the reference instruction in the first instruction group and / or the reference bit width of the reference instruction in the second instruction group is less than or equal to 2 bytes.

13. The method according to any one of claims 9 to 12, It is characterized in that The bytecode file also includes a third instruction group, the offset values ​​of the data referenced by the reference instructions in the third instruction group are stored in a fourth array, and the fourth array is dedicated to storing the offset values ​​of the data referenced by the reference instructions in the third instruction group.

14. The method according to any one of claims 9 to 13, It is characterized in that The first instruction group and / or the second instruction group is: a function, a combination of a preset number of instructions, or a combination of instructions corresponding to debugging information.

15. The method according to any one of claims 9 to 14, It is characterized in that The first array and / or the second array includes offset values ​​of multiple types of data.

16. The method according to any one of claims 9 to 15, It is characterized in that The first array includes different offset values; and / or, The second array includes different offset values.

17. An electronic device, It is characterized in that include: one or more processors; One or more memories; the one or more memories store one or more computer programs, the one or more computer programs include instructions, when the instructions are executed by one or more processors, the method as described in any one of claims 1-8 is executed, or the method as described in any one of claims 9-16 is executed.

18. A chip, It is characterized in that The chip includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method as described in any one of claims 1 to 8 is executed, or the method as described in any one of claims 9 to 16 is executed.

19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the method according to any one of claims 1 to 8 is executed, or the method according to any one of claims 9 to 16 is executed.

20. A computer program product, It is characterized in that The computer program product comprises instructions for performing the method of any one of claims 1 to 8 or the method of any one of claims 9-16.