conrad benham 20001 java opcode and runtime data analysis by: conrad benham supervisor: professor...
TRANSCRIPT
Conrad Benham 2000 1
Java Opcode and Runtime Data Analysis
By: Conrad Benham
Supervisor: Professor Arthur Sale
Conrad Benham 2000 2
Project Goals
To collect data on Java’s:Opcodes,Runtime System andCreate a program to automate this.
These statistics will be used by Professor Sale to create an optimised Hardware Java Virtual Machine (JVM).
Conrad Benham 2000 3
Why do this?- Competitive Analysis
Presently there are few JVMs implemented in hardware.
Existing implementations rarely have published documented to the level necessary for advanced research.
Java statistics are often difficult to obtain or sketchy in detail.
Conrad Benham 2000 4
Why do this?- Research Analysis
Statistics will identify most common opcodes.
Allows hardware developers to focus on optimising a specific sub-set of the opcodes.
Findings will be published to help other research efforts.
Presently there are few tools which collect data of this kind.
Conrad Benham 2000 5
So how does Java work?
Java Source CodeCreated by Java ProgrammerCreated by Java Programmer
Java CompilerProduces Java Byte CodesProduces Java Byte Codes
Platform Independent JVMRuns Java Byte CodesRuns Java Byte Codes
Go to Sun Microsystems’ Java web site at: www.java.sun.com
FOR MORE INFO...
Conrad Benham 2000 6
What are we looking for?
Static Datacollected from the byte codes.collected from the byte codes.
does not change during execution time.does not change during execution time.
will change at compile time.will change at compile time.
Dynamic Datacollected at runtime.collected at runtime.
will change at runtime (depending on inputs will change at runtime (depending on inputs to a program).to a program).
Conrad Benham 2000 7
Static Data
Includes data found in Java class files
e.g. the iadd instruction which adds e.g. the iadd instruction which adds two integer operands on the operand two integer operands on the operand stack together and pushes the result stack together and pushes the result back on the stack.back on the stack.
Branching InstructionsThe offset of instructions resulting from The offset of instructions resulting from the conditional statements (i.e. if, the conditional statements (i.e. if, while, switch, try).while, switch, try).
Conrad Benham 2000 8
Types of Branching Instruction
Forwardi.e. if, else, switch and try.
Backwardi.e. loops such as for and whilei.e. loops such as for and while
Conrad Benham 2000 9
Dynamic Data
Includes runtime analysise.g. average loop iterations, e.g. average loop iterations, processor usage, memory usage.processor usage, memory usage.
analysing feasibility of using registers, analysing feasibility of using registers, efficient heap allocation/de-allocation efficient heap allocation/de-allocation and garbage collection routines.and garbage collection routines.
Conrad Benham 2000 10
Analysis Benchmarks
There are a number of benchmark suites available:
Including the Dhrystone and Whetstone Including the Dhrystone and Whetstone benchmarksbenchmarksBenchmark code must be:Benchmark code must be:• representative of most Java applications, they
must follow the typical programmers coding style
• able to test a JVM in terms of of how much system resources it uses (e.g processor usage and memory usage).
Conrad Benham 2000 11
Method of Collection
Static DataSource Code CompilationSource Code Compilation
Class File DisassemblyClass File Disassembly
File ParsingFile Parsing
Dynamic DataNot finalisedNot finalised
Memory usage patternsMemory usage patterns
Execution timesExecution times
Other performance issuesOther performance issues
Conrad Benham 2000 12
Demonstration
Conrad Benham 2000 13
Conclusion
Relatively few organisations have collected data on Java, the emphasis is on code optimisation. The main aim of this project is to create and collect reusable components, data and statistics for other research.Comments and questions.