RU2837139C1 - Reduced instruction set of micro-operating system byte-code and device with limited resources - Google Patents
Reduced instruction set of micro-operating system byte-code and device with limited resources Download PDFInfo
- Publication number
- RU2837139C1 RU2837139C1 RU2023116227A RU2023116227A RU2837139C1 RU 2837139 C1 RU2837139 C1 RU 2837139C1 RU 2023116227 A RU2023116227 A RU 2023116227A RU 2023116227 A RU2023116227 A RU 2023116227A RU 2837139 C1 RU2837139 C1 RU 2837139C1
- Authority
- RU
- Russia
- Prior art keywords
- command
- instruction
- commands
- parameters
- data type
- Prior art date
Links
Abstract
Description
Область техникиField of technology
Настоящее изобретение относится к области техники набора команд виртуальной машины и, в частности, относится к сокращенному набору команд байт-кода микрооперационной системы и устройству с ограниченными ресурсами.The present invention relates to the field of virtual machine instruction set technology and, in particular, relates to a reduced bytecode instruction set of a micro-operating system and a resource-constrained device.
Уровень техникиState of the art
Язык программирования Java является объектно-ориентированным языком. «Класс» описывает набор данных (описания доменов), а также данные для работы с различными методами. Поля и методы классов описывают состояние и поведения объекта. Интеллектуальный SE (Secure Element (элемент безопасности)), микросхема безопасности с MCU (Micro Controller Unit (микроконтроллер)) имеют ограниченные ресурсы, и в настоящее время широко используется виртуальная машина Java Card, которая может запускать написанные на языке Java приложения. Приложения, написанные на языке Java, должны сгенерировать файл Class посредством компилятора Java, а затем преобразовать файл Class в файл Cap с помощью инструмента преобразования, предоставляемого Java Card, загрузить его в микросхему и выполнить его виртуальной машиной Java Card. Существуют проблемы с низкой производительностью выполнения набора команд Java Card на основе стека операндов по сравнению с байт-кодом набора команд на основе регистра.The Java programming language is an object-oriented language. A "class" describes a set of data (domain descriptions) and data for operation with various methods. Class fields and methods describe the state and behavior of an object. Intelligent SE (Secure Element), a security chip with MCU (Micro Controller Unit) have limited resources, and Java Card virtual machine, which can run applications written in Java, is widely used nowadays. Applications written in Java must generate a Class file through a Java compiler, and then convert the Class file to a Cap file using a conversion tool provided by Java Card, load it into the chip, and execute it by Java Card virtual machine. There are problems with the poor execution performance of the Java Card instruction set based on the operand stack compared to the bytecode of the register-based instruction set.
Раскрытие сущности изобретенияDisclosure of the essence of the invention
Принимая во внимание недостатки, существующие в предшествующем уровне техники, задача настоящего изобретения заключается в обеспечении сокращенного набора команд байт-кода микрооперационной системы и устройства с ограниченными ресурсами, такого как интеллектуальные SE, защищенные микросхемы MCU, которые могут быть использованы с различными объектно-ориентированными и архитектурно-независимыми программами, чтобы максимально уменьшить размер байт-кода, что может не только уменьшить требования к памяти микросхемы для постоянного хранения, но и повысить эффективность выполнения кода.Taking into account the shortcomings existing in the prior art, the object of the present invention is to provide a reduced set of bytecode instructions of a micro-operating system and a resource-limited device such as intelligent SE, secure MCU chips, which can be used with various object-oriented and architecture-independent programs to minimize the size of the bytecode, which can not only reduce the memory requirements of the chip for permanent storage, but also improve the efficiency of code execution.
Для решения вышеуказанной задачи техническое решение, принятое в настоящем изобретении, заключается в следующем:To solve the above problem, the technical solution adopted in the present invention is as follows:
сокращенный набор команд байт-кода микрооперационной системы, включающий в себя:a reduced set of bytecode instructions for a microoperating system, including:
первую команду, причем первая команда содержит код операции, при этом информация о параметрах первой команды выражена имплицитно в коде операции;the first command, where the first command contains the operation code, and the information about the parameters of the first command is expressed implicitly in the operation code;
вторую команду, которая представляет собой высокочастотную команду, имеющую множество форматов команд;the second command, which is a high-frequency command that has many command formats;
третью команду, которая содержит команду, имеющую различные форматы команд на основе различного количества параметров;the third command, which contains a command that has different command formats based on a different number of parameters;
четвертую команду, которая содержит команду часто используемого типа данных и команду редко используемого типа данных, причем команда часто используемого типа данных имеет множество форматов команд, а команда редко используемого типа данных имеет один формат команд;a fourth command that contains a frequently used data type command and a rarely used data type command, wherein the frequently used data type command has a plurality of command formats and the rarely used data type command has one command format;
пятую команду, которая представляет собой команду, имеющую однобайтовый индекс набора констант;the fifth command, which is a command that has a one-byte index of a set of constants;
шестую команду, которая представляет собой макрокоманду.the sixth command, which is a macro command.
Кроме того, в сокращенном наборе команд, как описано выше, первая команда содержит:Additionally, in the reduced command set as described above, the first command contains:
команду, которая имплицитно включает как операнд, так и номер регистра в коде операции;an instruction that implicitly includes both an operand and a register number in the opcode;
команду, которая имплицитно включает номер регистра в коде операции;an instruction that implicitly includes a register number in the opcode;
команду, которая имплицитно включает константный операнд в коде операции;an instruction that implicitly includes a constant operand in the opcode;
команду доступа к элементу массива, которая имплицитно включает тип элемента массива в коде операции;an array element access command that implicitly includes the array element type in the opcode;
команду, которая имплицитно включает тип и параметры вызова метода в коде операции.a command that implicitly includes the type and parameters of the method call in the opcode.
Кроме того, в сокращенном наборе команд, как описано выше, вторая команда содержит:Additionally, in the reduced command set as described above, the second command contains:
часто используемую команду арифметических операций, имеющую множество форматов операций;a frequently used arithmetic operation command that has many operation formats;
команду доступа к элементу массива в формате 4-разрядного регистра;command to access an array element in 4-bit register format;
команду создания массива, которая имплицитно включает тип элемента массива в коде операции;an array creation command that implicitly includes the array element type in the opcode;
команды ветвления, имеющую множество форматов команд на основе равных и неравных результатов сравнения.branching instructions, which have a variety of instruction formats based on equal and unequal comparison results.
Кроме того, в сокращенном наборе команд, как описано выше, третья команда содержит:Additionally, in the reduced command set as described above, the third command contains:
команду вызова статического метода, имеющую различные форматы команд, на основе различного количества параметров;a static method call command that has different command formats based on a different number of parameters;
команду вызова виртуального метода, имеющую различные форматы команд, на основе различного количества параметров;a virtual method call command that has different command formats based on a different number of parameters;
команду вызова метода частного экземпляра, имеющую различные форматы команд, на основе различного количества параметров.private instance method invocation command, which has different command formats based on different number of parameters.
Кроме того, в сокращенном наборе команд, как описано выше, четвертая команда содержит:Additionally, in the reduced command set as described above, the fourth command contains:
команду часто используемых типов данных, включающую в себя команду коротких типов данных;the frequently used data types command, which includes the short data types command;
команду редко используемых типов данных, включающую в себя команду типов данных int.the rarely used data types command, which includes the int data types command.
Кроме того, в сокращенном наборе команд, как описано выше, пятая команда содержит:Additionally, in the reduced command set as described above, the fifth command contains:
команду вызова статического метода, имеющую однобайтовый индекс набора констант;a static method call command that has a one-byte index into a set of constants;
команду вызова виртуального метода, имеющую с однобайтовый индекс набора констант;a virtual method call command that has a one-byte index into a set of constants;
команду доступа к статическому домену, имеющую однобайтовый индекс набора констант;a static domain access command that has a one-byte index into a set of constants;
команду доступа к домену экземпляра, имеющую однобайтовый индекс набора констант.an instance domain access command that has a one-byte index into a set of constants.
Кроме того, в сокращенном наборе команд, как описано выше, шестая команда содержит:Additionally, in the reduced command set as described above, the sixth command contains:
макрокоманду, сформированную на основе замены команды вызова статического метода;a macro command formed on the basis of replacing the static method call command;
макрокоманду, сформированную на основе объединения множества смежных команд.a macro command formed by combining a set of related commands.
Устройство с ограниченными ресурсами, причем на устройстве с ограниченными ресурсами запущена виртуальная машина, причем виртуальная машина выполнена с возможность исполнения сокращенного набора команд по любому из пп. 1-7.A device with limited resources, wherein a virtual machine is running on the device with limited resources, wherein the virtual machine is designed with the ability to execute a reduced set of commands according to any of paragraphs 1-7.
Положительными эффектами настоящего изобретения являются: в настоящем изобретении разработан набор команд виртуальной машины на основе регистра для устройств с ограниченными ресурсами, таких как интеллектуальные SE, защищенные микросхемы MCU, которые могут быть использованы с различными объектно-ориентированными и архитектурно-независимыми программами, чтобы максимально уменьшить размер байт-кода, что может не только уменьшить требования к памяти микросхемы для постоянного хранения, но и повысить эффективность выполнения кода.The positive effects of the present invention are: the present invention provides a register-based virtual machine instruction set for resource-constrained devices such as intelligent SEs, secure MCU chips, which can be used with various object-oriented and architecture-independent programs to reduce the size of bytecode as much as possible, which can not only reduce the memory requirements of the chip for persistent storage, but also improve the efficiency of code execution.
Краткое описание чертежейBrief description of the drawings
На фигуре проиллюстрирована схематическая диаграмма сокращенного набора команд байт-кода микрооперационной системы согласно варианту осуществления настоящего изобретения.The figure illustrates a schematic diagram of a reduced instruction set of a bytecode micro-operating system according to an embodiment of the present invention.
Подробное описание вариантов осуществленияDetailed description of embodiments
Настоящее изобретение более подробно описано ниже в сочетании с прилагаемыми чертежами и конкретными вариантами осуществления.The present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments.
Команды состоят из кода операции длиной в байт, определяющую операцию, которая должна быть выполнена, за которой следует ноль или более операндов, представляющих значение, с которым необходимо работать. Каждая ячейка в описании формата команды представляет собой байт.Регистр в команде состоит из 16 битов, которые могут представлять булевый, байтовый, короткий, ссылочный тип и обратный адрес, тип int требует двух последовательно пронумерованных пар регистров. Нулевая ссылка представляет собой значение короткого типа 0, то есть (object) null=(short) 0. Последние несколько регистров в кадре стека вызова методов используются для передачи параметров методов. В настоящем изобретении разработан набор команд виртуальной машины TGoMOS на основе регистра (здесь и далее называемый сокращенным набором команд), предназначенный для устройств с ограниченными ресурсами, таких как интеллектуальные SE, защищенные микросхемы MCU, которые могут быть использованы с различными объектно-ориентированными и архитектурно-независимыми программами, чтобы максимально уменьшить размер байт-кода, что может не только уменьшить требования к памяти микросхемы для постоянного хранения, но и повысить эффективность выполнения кода.Instructions consist of a byte-long opcode that specifies the operation to be performed, followed by zero or more operands representing the value to be operated on. Each cell in the instruction format description represents a byte. A register in an instruction consists of 16 bits that can represent a boolean, byte, short, reference type, and return address; the int type requires two consecutively numbered pairs of registers. The null reference represents the value of the short type 0, i.e. (object) null = (short) 0. The last few registers in the method call stack frame are used to pass method parameters. The present invention provides a register-based TGoMOS virtual machine instruction set (hereinafter referred to as a reduced instruction set) for resource-constrained devices such as intelligent SEs, secure MCUs, which can be used with various object-oriented and architecture-independent programs to reduce the size of bytecode as much as possible, which can not only reduce the memory requirement of the chip for persistent storage, but also improve the efficiency of code execution.
Как показано на фиг. 1, вариант осуществления настоящего изобретения обеспечивает сокращенный набор команд для байт-кода микрооперационной системы, причем сокращенный набор команд содержит: первую команду, вторую команду, третью команду, четвертую команду, пятую команду и шестую команду.As shown in Fig. 1, an embodiment of the present invention provides a reduced instruction set for a bytecode of a micro-operating system, wherein the reduced instruction set comprises: a first instruction, a second instruction, a third instruction, a fourth instruction, a fifth instruction, and a sixth instruction.
Первая команда состоит из кода операции, при этом информация о параметрах первой команды выражена имплицитно в коде операции. Первая команда включает в себя:The first command consists of an operation code, and the information about the parameters of the first command is expressed implicitly in the operation code. The first command includes:
a. команду, которая имплицитно включает как операнд, так и номер регистра в коде операции, например команду присваивания констант в табл. 1 ниже.a. An instruction that implicitly includes both an operand and a register number in the opcode, such as the constant assignment instruction in Table 1 below.
Из табл. 1 видно, что присвоение констант является очень частой операцией, и использование вышеуказанного кодирования может значительно сократить длину байт-кода способа.From Table 1 it can be seen that the assignment of constants is a very frequent operation, and the use of the above encoding can significantly reduce the length of the bytecode of the method.
b. Команду, которая имплицитно включает номер регистра в коде операции, такую как команда присваивания константы в Табл. 2, команда доступа к статическому домену в Табл. 3, необъектная команда результата, вызываемая методом возврата в Табл. 4, команда результата ссылки на объект, вызываемая методом в Табл. 5, и команда доступа к члену массива в Табл. 6.b. An instruction that implicitly includes a register number in the opcode, such as the constant assignment instruction in Table 2, the static domain access instruction in Table 3, the non-object result instruction called by the return method in Table 4, the object reference result instruction called by the method in Table 5, and the array member access instruction in Table 6.
Символ AA расширен до 16 битr0/1/2/3/4/5=AA
AA symbol extended to 16 bits
AA: Индекс набора констант для статических полейReturns the value of the static reference field to register r0-r4
AA: Index of constant set for static fields
Эта команда должна следовать за вызовом метода.Moves the non-object single word result of the most recent method call into registers r0-r4
This command must follow the method call.
Эта команда должна следовать за вызовом метода.Moves the non-object result of the most recent method call into registers r0-r1
This command must follow the method call.
getarray-b/r1 rA rB
getarray-b/r2 rA rB
getarray-b/r3 rA rB
getarray-b/r4 rA rB
getarray-b/r5 rA rBgetarray-b/r0 rA rB
getarray-b/r1 rA rB
getarray-b/r2 rA rB
getarray-b/r3 rA rB
getarray-b/r4 rA rB
getarray-b/r5 rA rB
rA: Ссылка на массив, 4-битный регистр
rB: Индекс элемента, 4-битный регистрr0-r5: Return value
rA: Array reference, 4-bit register
rB: Element index, 4-bit register
c. команду, которая имплицитно включает константный операнд в коде операции;c. an instruction that implicitly includes a constant operand in the opcode;
d. команду доступа к элементу массива, которая имплицитно включает тип элемента массива в коде операции;d. an array element access command that implicitly includes the array element type in the opcode;
e. команду, которая имплицитно включает тип и параметры вызова метода в коде операции.e. a command that implicitly includes the type and parameters of the method call in the opcode.
Сокращенный набор команд по настоящему изобретению дополнительно содержит вторую команду, и вторая команда представляет собой высокочастотную команду, имеющую множество форматов команд. Вторая команда включает в себя:The reduced instruction set of the present invention further comprises a second instruction, and the second instruction is a high-frequency instruction having a plurality of instruction formats. The second instruction includes:
a. часто используемую команду арифметических операций, имеющую множество форматов операций, такую как команда операции сложения в табл. 7, команда операции AND в табл. 8.a. A frequently used arithmetic operation command that has many operation formats, such as the addition operation command in Table 7, the AND operation command in Table 8.
Поскольку операции надстройки более распространены, предоставление множества форматов операций может уменьшить размер байт-кода. По сравнению с 4-байтовой длиной команды add rAA rBB rCC/iadd rAA rBB rCC использование других команд может уменьшить размер 1 или 2 байта.Because add operations are more common, providing multiple operation formats can reduce the bytecode size. Compared to the 4-byte length of the add rAA rBB rCC/iadd rAA rBB rCC instruction, using other instructions can reduce the size by 1 or 2 bytes.
Поскольку операции более распространены, предоставление множества форматов операций может уменьшить размер байт-кода. По сравнению с 4-байтовой длиной команды and rAA rBB rCC/iand rAA rBB rCC использование других команд может уменьшить размер 1 или 2 байта. Например, третья строка команды s2b2s rA rB имплицитно включает операнд 0xFF в коде операции, уменьшая длину команды.Because operations are more common, providing multiple operation formats can reduce the bytecode size. Compared to the 4-byte length of the and rAA rBB rCC/iand rAA rBB rCC instruction, using other instructions can reduce the size by 1 or 2 bytes. For example, the third line of the s2b2s rA rB instruction implicitly includes the 0xFF operand in the opcode, reducing the instruction length.
b. команду доступа к элементу массива в формате 4-разрядного регистра, как показано в табл. 9.b. an array element access command in 4-bit register format, as shown in Table 9.
rB: Ссылка на массив, 4-битный регистр
rC: Индекс элемента, 4-битный регистрrAA: Returns or sets the value of an 8-bit register
rB: Array reference, 4-bit register
rC: Element index, 4-bit register
rBB: Ссылка на массив, 8-битный регистр
rCC: Индекс элемента, 8-битный регистрrAA: Returns or sets the value of an 8-bit register
rBB: Array reference, 8-bit register
rCC: Element index, 8-bit register
rBB: Ссылка на массив, 8-битный регистр
rCC: Индекс элемента, 8-битный регистрrAA: Returns or sets the value of an 8-bit register pair.
rBB: Array reference, 8-bit register
rCC: Element index, 8-bit register
Из табл. 9 видно, что команды в формате 4-разрядного регистра на один байт меньше команд в 8-битном регистре, а 4-разрядный регистр для часто используемых команд (таких как getarray-o) может значительно уменьшить длину байт-кода.Table 9 shows that 4-bit register format instructions are one byte smaller than 8-bit register format instructions, and a 4-bit register for frequently used instructions (such as getarray-o) can significantly reduce the bytecode length.
c. команду создания массива, которая имплицитно включает тип элемента массива в коде операции, как показано в табл. 10.c. an array creation command that implicitly includes the array element type in the opcode, as shown in Table 10.
rA: Хранение ссылки на новые массивы
rB: Количество элементов массиваCreating an array of byte types
rA: Store reference to new arrays
rB: Number of array elements
rAA: Хранение ссылки на новые массивы
rB: Количество элементов массива
C: тип массива, значение которого приведено в таблице нижеCreating boolean, short, int and basic array types
rAA: Storing reference to new arrays
rB: Number of array elements
C: An array type whose value is given in the table below
rA: Хранение ссылки на новые массивы
rB: Количество элементов массива
CCCC: Индекс набора констант элемента массива ссылочного типаCreate a reference type array
rA: Store reference to new arrays
rB: Number of array elements
CCCC: Index of the constant set of an array element of a reference type
Из табл. 10 видно, что первая строка команды newarray-b rA rB используется чаще, а тип элемента (байт) элемента массива имплицитно включен в коде операции, который может быть уменьшен на 1 или 2 байта по сравнению с двумя другими командами.From Table 10, it can be seen that the first line of the command newarray-b rA rB is used more frequently, and the element type (byte) of the array element is implicitly included in the opcode, which can be reduced by 1 or 2 bytes compared to the other two commands.
d. Основываясь на равных и неравных результатах сравнения, команды ветвления, имеющие множество форматов команд, включая команды ветвления, которые сравниваются со значениями 0, такими как в табл. 11, и команды ветвления, которые сравниваются с двумя операндами, такими как в табл. 12.d. Based on equal and unequal comparison results, branch instructions have a variety of instruction formats, including branch instructions that compare with 0 values, such as those in Table 11, and branch instructions that compare with two operands, such as those in Table 12.
BB: 8-битное смещение ветви со знакомrAA: 8-bit register for comparison
BB: 8-bit signed branch offset
BB: 16-битное смещение ветви со знакомrAA: 8-bit register for comparison
BB: 16-bit signed branch offset
rB: Второй регистр для сравнения
CC: 8-битное смещение ветви со знакомrA: First register to compare
rB: Second register to compare
CC: 8-bit signed branch offset
Другие команды, аналогичные вышеуказанной командеCCCC: 16-bit signed branch offset
Other commands similar to the above command
В табл. 12 выше 8-битная команда смещения уменьшает длину одного байта.In Table 12 above, the 8-bit offset instruction reduces the length of one byte.
Сокращенный набор команд по настоящему изобретению дополнительно включает в себя третью команду, которая содержит команду, имеющую другой формат команд на основе различного количества параметров. Третья команда включает в себя:The reduced command set of the present invention further includes a third command that contains a command that has a different command format based on a different number of parameters. The third command includes:
a. команду вызова статического метода, имеющую различные форматы команд, на основе различного количества параметров, такую как в табл. 13;a. a static method call command that has different command formats based on different numbers of parameters, such as in Table 13;
b. команду вызова виртуального метода, имеющую различные форматы команд, на основе различного количества параметров, такую как в табл. 14;b. a virtual method call command having different command formats based on different numbers of parameters, such as in Table 14;
c. команду вызова метода частного экземпляра, имеющую различные форматы команд, на основе различного количества параметров.c. a private instance method invocation command that has different command formats based on different numbers of parameters.
AA: Индекс набора констант для статических методов
Количество параметров B
B=1 {rC}
B=0 {}0 or 1 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=1 {rC}
B=0 {}
AA: Индекс набора констант для статических методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}2 or 3 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
AA: Индекс набора констант для статических методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=1 {rC}
B=0 {}0 or 1 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=1 {rC}
B=0 {}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}2 or 3 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
AA: Индекс набора констант для виртуальных методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}
B=1 {rC}1 or 3 register parameters
AA: Index of the set of constants for virtual methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
B=1 {rC}
AA: Индекс набора констант для виртуальных методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AA: Index of the set of constants for virtual methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
Из табл. 13-14 видно, что для вызовов способа без параметров или с относительно небольшим количеством параметров вышеупомянутые команды кодирования являются относительно короткими, в частности, такие вызовы используются чаще, и размер байт-кода способа может быть значительно уменьшен.From Table 13-14 it can be seen that for method calls without parameters or with a relatively small number of parameters, the above-mentioned encoding instructions are relatively short, in particular, such calls are used more often, and the bytecode size of the method can be significantly reduced.
Сокращенный набор команд по настоящему изобретению дополнительно включает в себя четвертую команду, которая включает в себя команду часто используемого типа данных и команду редко используемого типа данных, при этом команда часто используемого типа данных имеет множество форматов команд, а команда редко используемого типа данных имеет формат команд. Часто используемые типы данных команды включают в себя короткие типы данных команды, а редко используемые типы данных команды включают в себя типы данных int команды.The reduced instruction set of the present invention further includes a fourth instruction that includes an instruction of a frequently used data type and an instruction of a rarely used data type, wherein the instruction of the frequently used data type has a plurality of instruction formats, and the instruction of the rarely used data type has an instruction format. The frequently used instruction data types include short instruction data types, and the rarely used instruction data types include int instruction data types.
Сокращенный набор команд по настоящему изобретению дополнительно содержит пятую команду, которая представляет собой команду, имеющую однобайтовый индекс набора констант.Пятая команды включает в себя:The reduced instruction set of the present invention further comprises a fifth instruction, which is an instruction having a one-byte index of a set of constants. The fifth instruction includes:
a. команду вызова виртуального метода, имеющую с однобайтовый индекс набора констант, как показано в табл. 15;a. a virtual method call instruction that has a one-byte index into a set of constants, as shown in Table 15;
b. команду вызова виртуального метода, имеющую с однобайтовый индекс набора констант,как показано в табл. 16;b. a virtual method call instruction having a one-byte index into the constant set, as shown in Table 16;
c. команду доступа к статическому домену, имеющую однобайтовый индекс набора констант, как показано в табл. 17;c. a static domain access command that has a one-byte index into a set of constants, as shown in Table 17;
d. команду доступа к домену экземпляра, имеющую однобайтовый индекс набора констант, как показано в табл. 18.d. an instance domain access command that has a one-byte index into a set of constants, as shown in Table 18.
AA: Индекс набора констант для статических методов
Количество параметров B
B=1 {rC}
B=0 {}0 or 1 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=1 {rC}
B=0 {}
AA: Индекс набора констант для статических методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}2 or 3 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
AA: Индекс набора констант для статических методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AA: Index of constant set for static methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=1 {rC}
B=0 {}0 or 1 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=1 {rC}
B=0 {}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}2 or 3 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
AAAA: Индекс набора констант для статических методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AAAA: Index of constant set for static methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
AA: Индекс набора констант для виртуальных методов
Количество параметров B
B=3 {rC, rD, rE}
B=2 {rC, rD}
B=1 {rC}1 or 3 register parameters
AA: Index of the set of constants for virtual methods
Number of parameters B
B=3 {rC, rD, rE}
B=2 {rC, rD}
B=1 {rC}
AA: Индекс набора констант для виртуальных методов
Количество параметров B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}4 or 5 register parameters
AA: Index of the set of constants for virtual methods
Number of parameters B
B=5 {rC, rD, rE, rF, rG}
B=4 {rC, rD, rE, rF}
AA: Индекс набора констант для статических полейReturns the value of the static reference field to register r0-r4
AA: Index of constant set for static fields
BB: Индекс набора констант для статических полейrAA: Returns the value of a static field, 8-bit register
BB: Index of constant set for static fields
BBBB: Индекс набора констант для статических полейrAA: Returns or sets the value to be set of a static field, 8-bit register
BBBB: Index of constant set for static fields
BBBB: Индекс набора констант для статических полейrAA: Returns or sets the value of the static field to be set, an 8-bit register pair
BBBB: Index of constant set for static fields
rB: Регистр объектов
CC: Индект набора констант домена экземпляраrA: Gets or sets the value of an instance field
rB: Object register
CC: Instance domain constant set index
rB: Регистр объектов
CCCC: Индект набора констант домена экземпляраrA: Gets or sets the value of an instance field
rB: Object register
CCCC: Instance Domain Constant Set Index
rB: Регистр объектов
CCCC: Индект набора констант домена экземпляраrA is a register pair that returns or sets the value of the instance field to be set
rB: Object register
CCCC: Instance Domain Constant Set Index
Из табл. 15-18 видно, что если можно использовать однобайтовый индекс набора констант, длина байт-кода может быть значительно уменьшена.From Table 15-18 it can be seen that if a single-byte index of the constant set can be used, the bytecode length can be significantly reduced.
Сокращенный набор команд по настоящему изобретению дополнительно включает в себя шестую команду, которая представляет собой макрокоманду. Шестая команда включает в себя макрокоманду, сформированную на основе замены команды вызова статического метода, и макрокоманду, сформированную на основе слияния множества соседних команд, как показано в табл. 19.The reduced instruction set of the present invention further includes a sixth instruction, which is a macroinstruction. The sixth instruction includes a macroinstruction formed on the basis of replacing a static method call instruction, and a macroinstruction formed on the basis of merging a plurality of adjacent instructions, as shown in Table 19.
Значение каждого регистра:
rA: src
rB: srcOff
rC: dest
rD: destOff
rE: lengthshort arrayCopy(byte[] src, short srcOff, byte[] dest, short destOff, short length) throws ArrayIndexOutOfBoundsException, NullPointerException, TransactionException;
The meaning of each register:
rA:src
rB:srcOff
rC:dest
rD: destOff
rE: length
Значение каждого регистра:
rA: src
rB: srcOff
rC: dest
rD: destOff
rE: lengthshort arrayCopyNonAtomic(byte[] src, short srcOff, byte[] dest, short destOff, short length) throws ArrayIndexOutOfBoundsException, NullPointerException, SystemException;
The meaning of each register:
rA:src
rB:srcOff
rC:dest
rD: destOff
rE: length
Значение каждого регистра:
rA: bArray
rB: bOff
rC: bLen
rD: bValueshort arrayFill(byte[] bArray, short bOff, short bLen, byte bValue) throws ArrayIndexOutOfBoundsException, NullPointerException;
The meaning of each register:
rA: bArray
rB: bOff
rC: bLen
rD: bValue
Значение каждого регистра:
rA: bArray
rB: bOff
rC: bLen
rD: bValueshort arrayFillNonAtomic (byte[] bArray, short bOff, short bLen, byte bValue) throws ArrayIndexOutOfBoundsException, NullPointerException;
The meaning of each register:
rA: bArray
rB: bOff
rC: bLen
rD: bValue
Значение каждого регистра:
rA: src
rB: srcOff
rC: dest
rD: destOff
rE: lengthbyte arrayCompare(byte[] src, short srcOff, byte[] dest, short destOff, short length) throws ArrayIndexOutOfBoundsException, NullPointerException;
The meaning of each register:
rA:src
rB:srcOff
rC:dest
rD: destOff
rE: length
Значение каждого регистра:
rA: bArray
rB: bOff
rC: sValueshort setShort(byte[] bArray, short bOff, short sValue) throws TransactionException, NullPointerException, ArrayIndexOutOfBoundsException;
The meaning of each register:
rA: bArray
rB: bOff
rC:sValue
Значение каждого регистра:
rA: b1
rB: b2short makeShort (byte b1, byte b2)
The meaning of each register:
rA: b1
rB:b2
Значение каждого регистра:
rA: bArray
rB: bOffshort getShort(byte[] bArray, short bOff) throws NullPointerException, ArrayIndexOutOfBoundsException
The meaning of each register:
rA: bArray
rB: bOff
rB: Ссылка на массив, 4-битный регистр
CC: Индекс члена, 8-битный регистр без знакаrA: Return value
rB: Array reference, 4-bit register
CC: Member index, 8-bit unsigned register
BBBB: 16-битный параметр константы со знакомAA: Index of constant set for static methods
BBBB: 16-bit signed constant parameter
Из табл.19 видно, что макрокоманды для замены статических методов не должны обеспечивать индекс набора констант, и поскольку частота таких вызовов статических методов относительно высока, замена соответствующими макрокомандами может значительно уменьшить размер байт-кода.Table 19 shows that macros for replacing static methods do not have to provide an index of the constant set, and since the frequency of such calls to static methods is relatively high, replacing them with appropriate macros can significantly reduce the size of the bytecode.
Набор команд виртуальной машины TGoMOS по настоящему изобретению представляет собой сокращенный набор команд, в табл. 20 ниже представлен краткий перечень набора команд байт-кода.The instruction set of the TGoMOS virtual machine of the present invention is a reduced instruction set, and Table 20 below provides a brief list of the bytecode instruction set.
Вариант осуществления настоящего изобретения дополнительно обеспечивает устройство с ограниченными ресурсами, причем на устройстве с ограниченными ресурсами запущена виртуальная машина, и виртуальная машина используется для выполнения вышеупомянутого сокращенного набора команд.An embodiment of the present invention further provides a resource-constrained device, wherein a virtual machine is running on the resource-constrained device, and the virtual machine is used to execute the above-mentioned reduced set of instructions.
Набор команд виртуальной машины на основе регистра, разработанный в настоящем изобретении, используют для устройств с ограниченными ресурсами, таких как интеллектуальные SE, защищенные микросхемы MCU, которые могут быть использованы с различными объектно-ориентированными и архитектурно-независимыми программами, чтобы максимально уменьшить размер байт-кода, что может не только уменьшить требования к памяти микросхемы для постоянного хранения, но и повысить эффективность выполнения кода.The register-based virtual machine instruction set developed in the present invention is used for resource-constrained devices such as intelligent SE, secure MCU chips, which can be used with various object-oriented and architecture-independent programs to minimize the size of bytecode, which can not only reduce the memory requirement of the chip for persistent storage, but also improve the efficiency of code execution.
Чтобы проверить вышеуказанные полезные эффекты сокращенного набора команд по настоящему изобретению, сравнивают набор команд Java Card и набор команд TGoMOS (сокращенный набор команд по настоящему изобретению), в дополнение к коду интерпретатора байт-кода, система виртуальной машины, реализованная в той же микросхеме, имеет в основном такой же код, в команде отключен трудоемкий криптографический алгоритм и операция записи во флеш-память, для сравнения используют среднее время 10 результатов выполнения и получают результаты сравнения. Результат сравнения размеров преобразованного байт-кода набора команд Java Card и набора команд TGoMOS показано в табл. 21. Результаты сравнения производительности приложений электронного кошелька EDEP на платформах Java Card и TGoMOS приведены в табл. 22.In order to verify the above-mentioned advantageous effects of the reduced instruction set of the present invention, the Java Card instruction set and the TGoMOS instruction set (the reduced instruction set of the present invention) are compared, in addition to the bytecode interpreter code, the virtual machine system implemented in the same chip has basically the same code, the instruction disables the labor-intensive cryptographic algorithm and the flash memory write operation, the average time of 10 execution results is used for comparison, and the comparison results are obtained. The comparison result of the size of the converted bytecode of the Java Card instruction set and the TGoMOS instruction set is shown in Table 21. The performance comparison results of the EDEP electronic wallet applications on the Java Card and TGoMOS platforms are shown in Table 22.
Из табл. 21 видно, что по сравнению с набором команд Java Card размер байт-кода набора команд TGoMOS (сокращенный набор команд по настоящему изобретению) близок к набору команд Java Card. Из табл. 22 видно, что производительность применения электронного кошелька EDEP к платформе набора команд виртуальной машины TGoMOS лучше.It can be seen from Table 21 that, compared with the Java Card instruction set, the bytecode size of the TGoMOS instruction set (the reduced instruction set of the present invention) is close to the Java Card instruction set. It can be seen from Table 22 that the performance of applying the EDEP electronic wallet to the TGoMOS virtual machine instruction set platform is better.
Очевидно, что специалисты в данной области техники могут вносить различные изменения и вариации в настоящее изобретение, не выходя за рамки сущности и объема настоящего изобретения. Таким образом, если эти модификации и вариации настоящего изобретения попадают в объем формулы настоящего изобретения и его эквивалентной технологии, настоящее изобретение также предназначено для включения этих модификаций и вариаций.It is obvious that those skilled in the art can make various changes and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and its equivalent technology, the present invention is also intended to include these modifications and variations.
Claims (33)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011553141.8 | 2020-12-24 |
Publications (1)
Publication Number | Publication Date |
---|---|
RU2837139C1 true RU2837139C1 (en) | 2025-03-26 |
Family
ID=
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6021469A (en) * | 1996-01-24 | 2000-02-01 | Sun Microsystems, Inc. | Hardware virtual machine instruction processor |
US6129460A (en) * | 1997-12-17 | 2000-10-10 | Unisys Corp. | Object-oriented apparatus and method in a computer system for a programming language compiler to select optimal pointer kinds for code generation |
US6275830B1 (en) * | 1998-03-18 | 2001-08-14 | Oracle Corporation | Compile time variable size paging of constant pools |
US20060020932A1 (en) * | 2002-11-29 | 2006-01-26 | Research In Motion Limited | Method for generating interpretable code for storage in a device having limited storage |
KR100809293B1 (en) * | 2006-03-10 | 2008-03-04 | 삼성전자주식회사 | Device and method for managing a stack in a virtual machine |
RU2562430C2 (en) * | 2010-06-22 | 2015-09-10 | Интернэшнл Бизнес Машинз Корпорейшн | Increasing number of general purpose registers available to instructions |
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6021469A (en) * | 1996-01-24 | 2000-02-01 | Sun Microsystems, Inc. | Hardware virtual machine instruction processor |
US6129460A (en) * | 1997-12-17 | 2000-10-10 | Unisys Corp. | Object-oriented apparatus and method in a computer system for a programming language compiler to select optimal pointer kinds for code generation |
US6275830B1 (en) * | 1998-03-18 | 2001-08-14 | Oracle Corporation | Compile time variable size paging of constant pools |
US20060020932A1 (en) * | 2002-11-29 | 2006-01-26 | Research In Motion Limited | Method for generating interpretable code for storage in a device having limited storage |
KR100809293B1 (en) * | 2006-03-10 | 2008-03-04 | 삼성전자주식회사 | Device and method for managing a stack in a virtual machine |
RU2562430C2 (en) * | 2010-06-22 | 2015-09-10 | Интернэшнл Бизнес Машинз Корпорейшн | Increasing number of general purpose registers available to instructions |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20250130806A1 (en) | Implicit Global Pointer Relative Addressing for Global Memory Access | |
US7039904B2 (en) | Frameworks for generation of Java macro instructions for storing values into local variables | |
EP0671685B1 (en) | Method and apparatus for detecting and executing cross-domain calls in a computer system | |
BR102020019657A2 (en) | apparatus, methods and systems for instructions of a matrix operations accelerator | |
US7917732B2 (en) | Microprocessor for executing byte compiled JAVA code | |
CN114356417A (en) | System and method for implementing 16-bit floating-point matrix dot-product instruction | |
RU2621000C2 (en) | Determination of symbol data group length containing ending symbol | |
MX2014010946A (en) | Instruction to load data up to a specified memory boundary indicated by the instruction. | |
US20060195680A1 (en) | Computer instruction value field having an embedded sign | |
MX2014010947A (en) | Instruction to compute the distance to a specified memory boundary. | |
US20100011191A1 (en) | Data processing device with instruction translator and memory interface device to translate non-native instructions into native instructions for processor | |
Sakamura | Architecture of the tron vlsi cpu | |
CN104169870A (en) | Copying character data having a termination character from one memory location to another | |
EP1875338A4 (en) | Microprocessor access of operand stack as a register file using native instructions | |
CN101868783A (en) | Enhanced microprocessor or microcontroller | |
KR20010043826A (en) | Microcontroller instruction set | |
US7543288B2 (en) | Reduced instruction set for Java virtual machines | |
US6988261B2 (en) | Frameworks for generation of Java macro instructions in Java computing environments | |
CN112631723A (en) | Byte code simplified instruction set and resource limited device of micro-operation system | |
RU2837139C1 (en) | Reduced instruction set of micro-operating system byte-code and device with limited resources | |
KR20040079851A (en) | Direct instructions rendering emulation computer technique | |
US7058934B2 (en) | Frameworks for generation of Java macro instructions for instantiating Java objects | |
US5418975A (en) | Wide instruction word architecture central processor | |
Rafiquzzaman et al. | Modern Computer Architecture | |
WO2019046723A1 (en) | Implicit global pointer relative addressing for global memory access |