CN101295239A - Instruction execution method of Java card virtual machine - Google Patents

Instruction execution method of Java card virtual machine Download PDF

Info

Publication number
CN101295239A
CN101295239A CNA2007100278568A CN200710027856A CN101295239A CN 101295239 A CN101295239 A CN 101295239A CN A2007100278568 A CNA2007100278568 A CN A2007100278568A CN 200710027856 A CN200710027856 A CN 200710027856A CN 101295239 A CN101295239 A CN 101295239A
Authority
CN
China
Prior art keywords
instruction
virtual machine
java card
card virtual
processor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CNA2007100278568A
Other languages
Chinese (zh)
Inventor
汪辉
李娜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Eastcompeace Smart Card Co Ltd
Original Assignee
Eastcompeace Smart Card Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Eastcompeace Smart Card Co Ltd filed Critical Eastcompeace Smart Card Co Ltd
Priority to CNA2007100278568A priority Critical patent/CN101295239A/en
Publication of CN101295239A publication Critical patent/CN101295239A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention relates to an instruction execution method for a Java card virtual machine, comprising the steps as follows: step one, a processor executes the current instruction which is required to be executed in an instruction set; meanwhile, an accelerator is informed by the processor to analyse the current instruction; step 2, the accelerator analyses the property of the current instruction and obtains the byte code address of the next instruction; steps 3, the processor is informed of the byte code address of the next instruction and jumps to the next instruction after completing the execution of the current instruction. The instruction execution method for the Java virtual machine provided by the invention carries out the analysis of the current instruction by the accelerator and obtains the byte code address of the next instruction, leads the processor to directly jump to the next instruction required to be executed immediately after completing the execution of the current instruction and has the advantages of high efficiency and high stability.

Description

The instruction executing method of Java card virtual machine
Technical field
The present invention relates to field of intelligent cards, relate in particular to a kind of instruction executing method of Java card virtual machine.
Background technology
Smart card has been widely used in the various products such as mobile phone, music player, Digital Television, and smart card can be realized multiple functions such as the storage, information processing of identification, data.Java card is an emerging smart card, is the multi-application platform of an opening, can realize downloading various application programs by Java card.
Because Java card itself has Java language, thus its by the Java card virtual machine to the instruction execution that makes an explanation.The Java card virtual machine is not a kind of physical arrangement, but a kind of explanation is used for the independently operating environment of the bytecode of hardware platform, and wherein the explanation for bytecode is to be achieved by the raw machine language instruction of selecting to be stored among storer or the CPU.For Java card, its instruction process speed in the course of the work will directly have influence on the travelling speed of Java card.
Disclosed a kind of instruction executing method of existing Java card virtual machine among Fig. 1, storage is by four instructions P1 in the order register 11 shown in Fig. 1, P2, P3, the instruction set that P4 forms, CPU12 explains (promptly according to P1 successively by the method that order is carried out, P2, P3, the order of P4), carry out every instruction, yet, the executive mode of this instruction is lost time very much, for example, if after executing instruction P1, CPU12 need carry out next bar instruction P4, CPU12 still needs interpretive order P2 so, P3 is until P4, promptly, adopt the mode of traversal that instruction is made an explanation, until the instruction of finding needs to carry out, the travelling speed that influences Java card that this method can be very big, efficient is very low.On the other hand, if unusual or mistake have appearred in a certain instruction in the process of implementation, CPU12 can't continue to carry out next bar instruction so, will cause deadlock, causes the stability of Java card not high.
At the above-mentioned defective of prior art, the present invention is exactly the instruction executing method that the Java card virtual machine of a kind of high-level efficiency, high stability will be provided.
Summary of the invention
The instruction executing method that the purpose of this invention is to provide the Java card virtual machine of a kind of high-level efficiency, high stability.
For achieving the above object, the instruction executing method of Java card virtual machine provided by the invention may further comprise the steps:
Step 1, the processor execution command is concentrated the present instruction that need be performed, and by processor notice accelerator present instruction is resolved simultaneously;
Step 2, accelerator is resolved the attribute of present instruction, obtains the bytecode address of next instruction;
Step 3, with the address code address notification processor of next instruction, and after executing present instruction by processor redirect next instruction so far.
The instruction executing method of Java card virtual machine provided by the present invention is resolved present instruction by accelerator, obtain the bytecode address of next instruction, make processor after executing present instruction, can directly jump to the instruction that next need be carried out immediately, avoid the instruction sequences parsing, carried out the time waste that is brought, had high efficiency advantage; When the present instruction appearance was unusual or wrong, processor can be pointed out unusual and continue and be carried out next instruction, has avoided the deadlock phenomenon, makes the stability of Java card be improved simultaneously.
In order to make the instruction executing method of Java card virtual machine of the present invention optimize more, can also be after executing described step 1, carry out a determining step of judging whether all instructions are finished, all be finished if judge all instructions, then termination routine; If instruction is not finished, then carry out described step 2.
Detailed content will be done clearer introduction in specific embodiment.
Description of drawings
Fig. 1 is the instruction executing method synoptic diagram of existing Java card virtual machine;
Fig. 2 is the instruction executing method synoptic diagram of Java card virtual machine of the present invention;
Fig. 3 is the process flow diagram of first embodiment of the instruction executing method of Java card virtual machine of the present invention;
Fig. 4 is the process flow diagram of another embodiment of the instruction executing method of Java card virtual machine of the present invention;
Be described in further detail below in conjunction with embodiment and accompanying drawing thereof.
Embodiment
Shown in Fig. 2, disclosed the instruction executing method of Java card virtual machine of the present invention among Fig. 2, the Java card virtual machine shown in Fig. 2 comprises the order register 21 of store sets of instructions, the CPU22 of execution command and the accelerator 23 of interpretive order.The instruction set that storage is made up of four instructions P1, P2, P3, P4 in the order register 21, CPU22 is when carrying out a certain instruction, the present instruction that needs are performed is sent in the accelerator 23 and is resolved, after accelerator 23 parses the attribute of present instruction, can obtain the bytecode address of next instruction, and with this address notice CPU22, after CPU22 executes present instruction, to directly carry out next instruction, rather than the instruction that order is resolved, execution command is concentrated.
Fig. 3 shows the process flow diagram of preferred embodiment of the instruction executing method of Java card virtual machine of the present invention, and it comprises following step:
Step 31, the CPU22 execution command is concentrated the present instruction that need be performed, and resolves by 23 pairs of present instructions of CPU22 notice accelerator simultaneously;
Step 32, accelerator 23 obtains the bytecode address of next instruction by resolving the attribute of present instruction;
Step 33, with the address code address notification CPU22 of next instruction, and after executing present instruction by CPU22 redirect next instruction so far;
After CPU22 directly jumps to next instruction, re-execute step 1, carry out this instruction.If next instruction is END instruction, promptly all instructions are finished, and system will finish the execution of instruction this time so.Certainly, also can on the basis of above-mentioned preferred embodiment, increase the step whether determining program finishes, as shown in Figure 4, between step 31 and step 32, increase a determining step 34, judge whether all instructions are finished, if institute all is finished in steps, then interpretive routine; If be not finished, then continue execution in step 32.
Obviously, the instruction executing method of Java card virtual machine of the present invention is resolved by 23 pairs of present instructions of accelerator, obtain the bytecode address of next instruction, make CPU22 after executing present instruction, can directly jump to the instruction that next need be carried out immediately, avoid the instruction sequences parsing, carried out the time waste that is brought, had high efficiency advantage; Occur when unusual or wrong in present instruction simultaneously, CPU22 can point out unusual and continue and carry out next instruction, has avoided the deadlock phenomenon, makes the stability of Java card improve.
Certainly the present invention is not limited to the foregoing description, and those skilled in the art can do the variation of some equivalences according to foregoing description, and for example, instruction set is not limited to be stored in the order register 21, can also be the command memory of other form; CPU22 also can take the processor of MCU forms such as (microcontrollers).Suchlike equivalent transformation all should be included in the claim restricted portion.

Claims (5)

1, the instruction executing method of Java card virtual machine, described Java card virtual machine comprises the command memory of store sets of instructions, the CPU of execution command and the accelerator of resolving instruction, the instruction executing method of described Java card virtual machine may further comprise the steps:
Step 1, the processor execution command is concentrated the present instruction that need be performed, and by processor notice accelerator present instruction is resolved simultaneously;
Step 2, accelerator is resolved the attribute of present instruction, obtains the bytecode address of next instruction;
Step 3, with the address code address notification processor of next instruction, and after executing present instruction by processor redirect next instruction so far.
2, the instruction executing method of Java card virtual machine according to claim 1 is characterized in that:
After executing described step 1, carry out a determining step of judging whether all instructions are finished, all be finished if judge all instructions, then termination routine; If instruction is not finished, then carry out described step 2.
3, the instruction executing method of Java card virtual machine according to claim 1 is characterized in that:
Described command memory is an order register.
4, the instruction executing method of Java card virtual machine according to claim 1 is characterized in that:
Described processor is CPU.
5, the instruction executing method of Java card virtual machine according to claim 1 is characterized in that:
Described processor is MCU.
CNA2007100278568A 2007-04-26 2007-04-26 Instruction execution method of Java card virtual machine Pending CN101295239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2007100278568A CN101295239A (en) 2007-04-26 2007-04-26 Instruction execution method of Java card virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2007100278568A CN101295239A (en) 2007-04-26 2007-04-26 Instruction execution method of Java card virtual machine

Publications (1)

Publication Number Publication Date
CN101295239A true CN101295239A (en) 2008-10-29

Family

ID=40065543

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2007100278568A Pending CN101295239A (en) 2007-04-26 2007-04-26 Instruction execution method of Java card virtual machine

Country Status (1)

Country Link
CN (1) CN101295239A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102903001A (en) * 2012-09-29 2013-01-30 上海复旦微电子集团股份有限公司 Instruction processing method and intelligent card
CN107179935A (en) * 2016-03-11 2017-09-19 华为技术有限公司 A kind of instruction executing method and virtual machine
CN110704108A (en) * 2019-08-30 2020-01-17 阿里巴巴集团控股有限公司 Method and device for interpreting and executing byte code instruction stream
US10802854B2 (en) 2019-08-30 2020-10-13 Alibaba Group Holding Limited Method and apparatus for interpreting bytecode instruction stream
CN112256331A (en) * 2020-12-22 2021-01-22 鹏城实验室 Virtual machine instruction analysis acceleration method and device and computer storage medium

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102903001A (en) * 2012-09-29 2013-01-30 上海复旦微电子集团股份有限公司 Instruction processing method and intelligent card
CN102903001B (en) * 2012-09-29 2015-09-30 上海复旦微电子集团股份有限公司 The disposal route of instruction and smart card
CN107179935A (en) * 2016-03-11 2017-09-19 华为技术有限公司 A kind of instruction executing method and virtual machine
CN107179935B (en) * 2016-03-11 2021-01-29 华为技术有限公司 Instruction execution method and virtual machine
CN110704108A (en) * 2019-08-30 2020-01-17 阿里巴巴集团控股有限公司 Method and device for interpreting and executing byte code instruction stream
US10802854B2 (en) 2019-08-30 2020-10-13 Alibaba Group Holding Limited Method and apparatus for interpreting bytecode instruction stream
TWI743698B (en) * 2019-08-30 2021-10-21 開曼群島商創新先進技術有限公司 Method and device for interpreting execution byte code instruction stream
CN112256331A (en) * 2020-12-22 2021-01-22 鹏城实验室 Virtual machine instruction analysis acceleration method and device and computer storage medium

Similar Documents

Publication Publication Date Title
TWI730654B (en) Method and device for deploying and executing smart contract
CN101398845B (en) Multi-language binding method and system in web applications
CN103020176A (en) Data block dividing method in XML parsing and XML parsing method
RU2015151114A (en) DEVICE AND METHOD FOR ACCELERATING COMPRESSION AND UNPACKING OPERATIONS
CN101295239A (en) Instruction execution method of Java card virtual machine
CN101344857B (en) Apparatus and method for accelerating Java translation
CN103188267B (en) A kind of protocol analysis method based on DFA
CN101884025A (en) Method and a system for accelerating procedure return sequences
CN106020920A (en) Preprocessing method and system for JCVM interpreter
CN104049947A (en) Dynamic Rename Based Register Reconfiguration Of A Vector Register File
US7228527B1 (en) Method and system for structuring a procedure
CN102541639B (en) CPU (Central Processing Unit) card data processing method, CPU card data processing system and CPU card
CN105022667A (en) Embedded browser CSS (Cascading Style Sheets) based engine parallelization method
CN112487092A (en) Intelligent contract calling method and device based on block chain
CN102541738B (en) Method for accelerating soft error resistance test of multi-core CPUs (central processing units)
CN104503733A (en) Merging method and device for state machine
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN105302557A (en) Thread establishing and processing method and apparatus
CN102799434B (en) A kind of method utilizing software protecting equipment to realize automatic code transplanting
CN102724591B (en) Set top box page displaying method and set top box device
CN112035169B (en) Jump processing method and device, computer equipment and computer readable storage medium
JP2011501286A (en) Java byte code conversion method
JP3495230B2 (en) Emulation processing method
CN107566316A (en) A kind of message parsing method, device and network processing unit
EP0945795A1 (en) Computer system having a multi-pointer branch instruction and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20081029