SMF For Free Support Forum
Signup For Free Forum
November 22, 2014, 10:23:39 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register Chat  

Pages: [1]
  Print  
Author Topic: BCEL instruction  (Read 3386 times)
0 Members and 1 Guest are viewing this topic.
meteor
SMF For Free Newbie
*
Offline Offline

Posts: 1


View Profile
Total Badges: 3
Badges: (View All)
Topic Starter Level 1 First Post
« on: February 01, 2012, 01:01:27 pm »

Hi all,

I am trying to write a timing strategy for Volta, an execution time analyzer for Java processors. In Volta, the execution time of a Java Bytecode instruction is determined with the following method:

public int getCycles(Instruction instruction)

This method looks up the instruction time of the Instruction. The class Instruction of BCEL is used: Instruction (http://commons.apache.org/bcel/apidocs/org/apache/bcel/generic/Instruction.html?is-external=true)

For example, getCycles(BIPUSH) returns "2", meaning it takes 2 cycles on a java processor to execute a bipush bytecode.

Okay, now the problem. On a particular Java processor, the execution time of the instruction varies with the argument. For example, using LDC to load an integer takes 7 cycles. Using LDC to load a string takes 3 cycles.

Therefore, I need to know exactly what an Instruction does, just the opcode isn't enough. Does anybody know how to do this? I might be able to get the index used by the LDC instruction with

instruction.getIndex();

but how can I determine which constant is actually loaded?
Logged


Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.20 | SMF © 2013, Simple Machines