CN1438576A - Method for transfering Java line based on recovering of operation stack record - Google Patents
Method for transfering Java line based on recovering of operation stack record Download PDFInfo
- Publication number
- CN1438576A CN1438576A CN 03121035 CN03121035A CN1438576A CN 1438576 A CN1438576 A CN 1438576A CN 03121035 CN03121035 CN 03121035 CN 03121035 A CN03121035 A CN 03121035A CN 1438576 A CN1438576 A CN 1438576A
- Authority
- CN
- China
- Prior art keywords
- code
- stack
- java
- content
- written
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 230000005012 migration Effects 0.000 claims description 26
- 238000013508 migration Methods 0.000 claims description 25
- 238000011084 recovery Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 10
- 238000002955 isolation Methods 0.000 abstract description 4
- 238000003780 insertion Methods 0.000 description 29
- 230000037431 insertion Effects 0.000 description 29
- 238000012986 modification Methods 0.000 description 6
- 230000004048 modification Effects 0.000 description 6
- 238000011160 research Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 3
- 238000004321 preservation Methods 0.000 description 3
- 230000007704 transition Effects 0.000 description 2
- 239000002253 acid Substances 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
With target byte codes being loaded, the inserted target byte codes are modified dynamically by use of interpreted loading byte codes dynamically. For the assigning operations, the isolation of the relevant code segment is used instead of the isolation of the content in the operation stack. For the operation of saving the content in the operation stack, each popping up or stacked operation is recorded by the the method of inserting the byte code. The operations are safe with high efficiency.
Description
Technical field
Method based on the Java thread migration of the recovery of active stack record belongs to the thread migration technical field, relates in particular to Java thread migration technology.
Background technology
Development along with distributed computing system (distributed computing) and portable computing system, the importance of thread migration technology more and more displays, and along with the generally use that needs the Java platform of heterogeneous system, Java thread migration strategy more and more is much accounted of, it is applied to fields such as fault-tolerant, load balance widely.
Java thread migration (Java Thread Migration) refers to, the thread (Thread) that will in our system, move, with thread (Thread) is least unit, suspend execution from the node (node) that is moving, the code (code) of this thread and data (data) are transferred in the system other moved node, continue the process of carrying out.Usually, our said transparent migration (transparent migration) refers to, and system does not have outside intervention in the process of the code of thread and data catching and recover, and this outside refers to the user.
At present, in the Java thread migration field,, can not offer the various states that external program makes its thread that is being moved because the java virtual machine does not have corresponding interface, comprising the content in PC (instruction pointer) and the active stack, generally acknowledged feasible method has two kinds:
First kind: directly revise virtual machine code, such disposal route is very direct, but the problem of bringing also is clearly, this opaque disposal route can produce very serious compatibility issue, as everyone knows, SUNMicrosystems (Sun Microsystems) company that has a Java Virtual Machine copyright is very sensitive and very strict its version of control to copyright problem.
Second kind: do not relate to any code of revising virtual machine, execution characteristics according to the Java code, in the code dynamic load, the dynamic code that needs execution of revising, in object code, increase needed code segment, write down the value that needed environmental variance comprises PC (instruction pointer), the debugging acid JPDA (Java Platform DebugArchitecture Java debug platform architecture) that utilizes Java to provide simultaneously extracts the content in the active stack in the java virtual machine.
The emphasis that we set forth will be placed on second kind of scheme, recovery at the PC in the Java thread (Thread) (Program Counter program pointer counter) value and Local Variables (local variable), there are some research institutions to propose the strategy of oneself at present, adopted Java thread sequence strategy as Belgian KULEUVEN research institute, Israel technical college has adopted the strategy of reequiping the Java compiler again.We have continued to use the numerical value that utilizes JPDA to catch PC and Local Variables, have adopted the Java thread sequenceization to preserve, and utilize the scheme that Byte Code (bytecode) recovers the state of these values of inserting.
Though a lot of research institutions are to seizure and the recovery of above-mentioned two kinds of PC and Local Varaiables, a lot of schemes are arranged, but seldom mention seizure and recovery to the Operand Stack (active stack) of Thread, and do not have research institution can deliver out clear and definite feasible scheme, this point is to mention without any family research in the document of our reference.
At emphasis in this thread migration and difficult point, we have proposed the feasible program of oneself, have realized the recovery of the Operand Stack (active stack) in the Java Thread thread, and our strategy can be realized very safely and effectively.
Summary of the invention:
The object of the present invention is to provide a kind of safely and effectively based on the Java thread migration method of the recovery of active stack record.The invention is characterized in: it makes the bytecode that is written into when being written into the target byte sign indicating number by dynamically explaining, dynamically revises the target byte sign indicating number that is written into; It carries out different processing to following different procedure operation:
(1). assign operation: corresponding code segment is isolated, carry out with box lunch and go to stop migration when these isolate code segment, replace the content in the active stack is isolated with this;
(2). the operation that the active stack content is preserved: in the process that is written into the target byte sign indicating number, insert the corresponding code of handling,, all use the method for inserting corresponding bytecode to write down corresponding operation in time to the stacked operation of popping each time.
Use proof: it has guaranteed the correctness of thread migration and the efficient of Java thread migration simultaneously.
Description of drawings
Fig. 1 is based on the program flow chart of the Java thread migration method of the recovery of active stack record.
Embodiment
The method that the present invention adopts is Java Virtual Machine not to be carried out any modification, and starts with from object code.Java is a kind of indicative language, the bytecode that it is written into by dynamic explanation (Byte Code), make us when being written into the target byte sign indicating number, the dynamic strategy that inserts the target byte sign indicating number of revising becomes possibility, so, Java Virtual Machine (JVM) is explained has been exactly the code crossed through our routine processes.
Java is a kind of language towards storehouse in essence, this characteristics have determined, the Java any operation relevant with numerical value in the inside is such as assignment, the calculating of expression formula all need be finished by stack, and our purpose is will be when object code calculates, record and preserve content in the active stack so that migration of programs can the recovery operation stack in other the destination node content.
We have carried out different processing at different procedure operation.First kind of assign operation, our strategy are that corresponding code segment is isolated, and when carrying out these isolation code segments, do not move, and so also just need not isolate the content in the active stack.Second kind of situation is that we need carry out the preservation of active stack content, in the process that is written into the target byte sign indicating number, if run into following statement assignment, expression solution (shape such as following expression formula code segment): the x=y+z of type like this; We will insert corresponding processing code.
Below, we provide two simple example A at these two kinds of different processing procedures) processing of assign operation:
。。。。。。。
X=100; The value of //X variable is arranged to 100
。。。。。。。
The result of common compilation is:
0:bipush 100 // constant 100 enters active stack (0perand stack)
2:istore_1 // will operate the numerical value ejection of stack top and variable X is set
Our code isolation mark is all inserted in our processing in the front and back of this code segment, show that to system this code segment cannot interrupt, and only is finished and just can moves.
The result's who handles code is:
The code distance piece of 0:iconst_1 // insertion begins the part sign
The code distance piece of 1:istore_2 // insertion begins the part sign
The code segment of 2:bipush 100//originally
The code segment of 4:istore_1 // originally
The code distance piece latter end end mark of 5:iconst 0 // insertion
The code distance piece latter end sign B of 6:istore_2 // insertion) processing of expression formula operation:
。。。。。。。
*=y+z; // with y, z phase adduction is given X with assignment as a result
The result of common compilation is:
8:iload_2 // with the value push operation stack of variable y
9:iload_3 // with the value push operation stack of variable z
Two value phase adductions of 10:iadd // will operate stack top are put into stack top with the result
11:istore_1 // will operate the numerical value ejection of stack top and variable X is set
Our processing is at the stack-incoming operation of popping each time, all uses the corresponding byte code of insertion to write down corresponding operation,
Just be processed into following result at top the 8th statement:
The code distance piece of 26:iconst_1 // insertion begins the part sign
The code distance piece of 27:istore %4 // insertion begins the part sign
The code segment of 29:iload_2 // originally
Content counter+1 in 30:iinc %5-1 // recording operation stack
The content of 33:dup // replicate run stack top
The content of 34:istore %6 // ejection and preservation operation stack top is in the variable of new insertion
The code distance piece latter end sign of 36:iconst_0 // insertion
The code distance piece latter end sign of 37:istore %4 // insertion
Through the similar processing at every statement, result's code is as follows:
// to the modification of the 8th statement iload_2
The code distance piece of 26:iconst_1 // insertion begins the part sign
The code distance piece of 27:istore %4 // insertion begins the part sign
The code segment of 29:iload_2 // originally
Content counter+1 in 30:iinc %5-1 // recording operation stack (active stack is 1 value)
The content of 33:dup // replicate run stack top
The content of 34:istore %6 // ejection and preservation operation stack top is in the variable of new insertion
The code distance piece latter end sign of 36:iconst_0 // insertion
The code distance piece latter end sign of 37:istore %4 // insertion
// to the modification of the 9th statement iload_3
The code distance piece of 39:iconst_1 // insertion begins the part sign
The code distance piece of 40:istore %4 // insertion begins the part sign
The code segment of 42:iload_3 // originally
Content counter+1 in 43:iinc %5-1 // recording operation stack (active stack is 2 values)
The content of 46:dup // replicate run stack top
47:istore %7 // ejection is also preserved the variable of the content of operation stack top to new insertion
The code distance piece latter end sign of 49:iconst_0 // insertion
The code distance piece latter end sign of 50:istore %4 // insertion
// to the modification of the 10th statement iadd
The code distance piece of 52:iconst_1 // insertion begins the part sign
The code distance piece of 53:istore %4 // insertion begins the part sign
The code segment of 55:iadd // originally
Content counter-1 in 56:iinc %5 1 // recording operation stack (this moment, the active stack number was 1)
The content of 59:dup // replicate run stack top
60:istore %6 // ejection is also preserved the variable of the content of operation stack top to new insertion
The code distance piece latter end sign of 62:iconst_0 // insertion
The code distance piece latter end sign of 63:istore %4 // insertion
// to the modification of Sub_clause 11 statement istore_1
The code distance piece of 65:iconst_1 // insertion begins the part sign
The code distance piece of 66:istore %4 // insertion begins the part sign
The code segment of 68:istore_1 // originally
Content counter-1 in 69:iinc %5 1 // recording operation stack (this moment, active stack was empty)
The code distance piece latter end sign of 72:iconst_0 // insertion
The code distance piece latter end sign of 73:istore %4 // insertion
In sum, at our target, stack in the process of assurance Java thread migration can be by correct recovery, consider the efficiency in the transition process simultaneously, the strategy that we adopt is the type of evaluating objects code, adopted and utilized the issued transaction (transention) in the similar database to isolate, that is to say the object code of assignment expression is regarded as an integral body, carried out atomic operation assignment expression.And simultaneously at the operation of the expression formula in the Java thread, we have then adopted method described above, have also showed above simultaneously by before our strategy modification and the object code after revising.
Through test, our strategy can guarantee the Java thread the transition process stack can be correct recovery, thereby guaranteed the correctness of thread migration, our strategy has also guaranteed the efficient of Java thread migration simultaneously.
Corresponding general program flow chart is seen Fig. 1.
At first, what it may be noted that and illustrate is, the mechanism that algorithm herein adopts is to transparent algorithm, here transparent implication is meant, set forth in the flow process above this paper, needed in the process at the customer referral program migration, catch the program pointer of user program, the content of the numerical value of the variable of program and user program active stack, and after object code is moved to object code, at the user program pointer, the resuming work of the content of the numerical value of the variable of program and user program active stack, all top work, all be under the situation of user transparent, to carry out, that is to say that the user does not need top all work of setting forth is participated in and operates, these work all be by, the thread migration module in first computing system is finished.
Therefore, in view of top elaboration, have in first computing system of algorithm of described thread migration herein, the migrated users task of submitting to is to destination node if desired, and the user need not to make extra action.
Claims (1)
1. based on the method for the Java thread migration of the recovery of active stack record, it is characterized in that: it makes the bytecode that is written into when being written into the target byte sign indicating number by dynamically explaining, dynamically revises the target byte sign indicating number that is written into; It carries out different processing to following different procedure operation:
(1). assign operation: corresponding code segment is isolated, carry out with box lunch and go to stop migration when these isolate code segment, replace the content in the active stack is isolated with this;
(2). the operation that the active stack content is preserved: in the process that is written into the target byte sign indicating number, insert the corresponding code of handling,, all use the method for inserting corresponding bytecode to write down corresponding operation in time to the stacked operation of popping each time.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB03121035XA CN100356326C (en) | 2003-03-21 | 2003-03-21 | Method for transfering Java line based on recovering of operation stack record |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB03121035XA CN100356326C (en) | 2003-03-21 | 2003-03-21 | Method for transfering Java line based on recovering of operation stack record |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1438576A true CN1438576A (en) | 2003-08-27 |
CN100356326C CN100356326C (en) | 2007-12-19 |
Family
ID=27674249
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB03121035XA Expired - Fee Related CN100356326C (en) | 2003-03-21 | 2003-03-21 | Method for transfering Java line based on recovering of operation stack record |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100356326C (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102236576A (en) * | 2011-08-09 | 2011-11-09 | 复旦大学 | Java virtual machine execution engine supporting hybrid mode execution |
CN102859489A (en) * | 2010-04-27 | 2013-01-02 | 微软公司 | Resumable methods |
CN101069156B (en) * | 2004-09-30 | 2013-08-21 | 茨特里克斯系统公司 | Method and apparatus for moving processes between isolation environments |
CN104318135A (en) * | 2014-10-27 | 2015-01-28 | 中国科学院信息工程研究所 | Java code safety dynamic loading method on basis of trusted execution environment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6401109B1 (en) * | 1996-11-18 | 2002-06-04 | International Business Machines Corp. | Virtual socket for JAVA interprocess communication |
UA55489C2 (en) * | 1997-10-07 | 2003-04-15 | Каналь+ Сосьєте Анонім | Device for processing information in a number of information flows |
US6349322B1 (en) * | 1998-05-06 | 2002-02-19 | Sun Microsystems, Inc. | Fast synchronization for programs written in the JAVA programming language |
US6385643B1 (en) * | 1998-11-05 | 2002-05-07 | Bea Systems, Inc. | Clustered enterprise Java™ having a message passing kernel in a distributed processing system |
US6529962B1 (en) * | 1999-02-05 | 2003-03-04 | International Business Machines Corporation | Preserving thread identity during remote calls |
EP1183598A2 (en) * | 1999-09-21 | 2002-03-06 | Koninklijke Philips Electronics N.V. | Optimized bytecode interpreter of virtual machine instructions |
-
2003
- 2003-03-21 CN CNB03121035XA patent/CN100356326C/en not_active Expired - Fee Related
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101069156B (en) * | 2004-09-30 | 2013-08-21 | 茨特里克斯系统公司 | Method and apparatus for moving processes between isolation environments |
CN102859489A (en) * | 2010-04-27 | 2013-01-02 | 微软公司 | Resumable methods |
CN102859489B (en) * | 2010-04-27 | 2016-06-29 | 微软技术许可有限责任公司 | Recoverable method |
CN102236576A (en) * | 2011-08-09 | 2011-11-09 | 复旦大学 | Java virtual machine execution engine supporting hybrid mode execution |
CN102236576B (en) * | 2011-08-09 | 2015-01-07 | 复旦大学 | Java virtual machine execution engine supporting hybrid mode execution |
CN104318135A (en) * | 2014-10-27 | 2015-01-28 | 中国科学院信息工程研究所 | Java code safety dynamic loading method on basis of trusted execution environment |
CN104318135B (en) * | 2014-10-27 | 2017-04-05 | 中国科学院信息工程研究所 | A kind of Java code Safety actuality loading method based on credible performing environment |
Also Published As
Publication number | Publication date |
---|---|
CN100356326C (en) | 2007-12-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Morandat et al. | Evaluating the design of the R language: Objects and functions for data analysis | |
CN1146788C (en) | Device and method used in instruction selection of multiplatform environment | |
EP0911726B1 (en) | Mixed execution stack and exception handling | |
CN100342329C (en) | Zero expense abnormal treatment | |
CN1149478C (en) | Method and equipment for effective calling java method from local code | |
CN1238500A (en) | Method and system for performing static initialization | |
US8255658B2 (en) | Memory management method and computer using the same | |
CN1821964A (en) | Method and apparatus for inlining native functions into compiled java code | |
US6912553B1 (en) | Virtual machine memory management | |
US8205192B2 (en) | Compiler device, program, and recording medium | |
CN1468399A (en) | Java hardware accelerator using microcode engine | |
US7181732B2 (en) | Method and apparatus for facilitating lazy type tagging for compiled activations | |
CN106033370B (en) | Method and device for realizing 64-bit Java virtual machine | |
US9921959B2 (en) | Efficient reference classification and quick memory reuse in a system that supports concurrent garbage collection | |
CN1295605C (en) | Software support for virtual machine interpreter (VMI) acceleration hardware | |
US6523168B1 (en) | Reduction of object creation during string concatenation and like operations that utilize temporary data storage | |
US8261251B2 (en) | Modification of array access checking in AIX | |
EP2080094A2 (en) | System and method for interoperating with foreign objects from a single language computing environment | |
US20100192139A1 (en) | Efficient per-thread safepoints and local access | |
US8438468B2 (en) | Annotation management | |
US6836782B1 (en) | Method and apparatus for implementing modular garbage collectors | |
CN1438576A (en) | Method for transfering Java line based on recovering of operation stack record | |
US20060242635A1 (en) | Method and system for optimizing array sizes in a JAVA virtual machine | |
Pinckney et al. | Wasm/k: delimited continuations for WebAssembly | |
Stadler et al. | Lazy continuations for Java virtual machines |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20071219 Termination date: 20150321 |
|
EXPY | Termination of patent right or utility model |