Instrumented Code

26 views
Skip to first unread message

Vincent Ni

unread,
Feb 18, 2013, 12:48:39 PM2/18/13
to deuce-stm-...@googlegroups.com
Hi,

Is there any way to see the java code after instrumentation? When I used the offline method(http://www.deucestm.org/documentation/getting-started) to instrument the java code, what I obtained is in byte code. An example is as follows:
@Atomic
  private byte[] atomicGetComplete(Decoder arg1, int[] arg2) { // Byte code:
    //   0: aconst_null
    //   1: astore 5
    //   3: invokestatic 370 org/deuce/transaction/ContextDelegator:getInstance ()Lorg/deuce/transaction/Context;
    //   6: astore 4
    //   8: iconst_1
    //   9: istore 6
    //   11: aconst_null
    //   12: astore 8
    //   14: ldc_w 371
    //   17: istore_3
    //   18: goto +100 -> 118
    //   21: aload 4
    //   23: ldc_w 372
    //   26: ldc_w 374
    //   29: invokeinterface 380 3 0
    //   34: aload_0
    //   35: aload_1
    //   36: aload_2
    //   37: aload 4
    //   39: invokevirtual 350 jstamp/intruder/Intruder:atomicGetComplete (Ljstamp/intruder/Decoder;[ILorg/deuce/transaction/Context;)[B
    //   42: astore 8
    //   44: goto +32 -> 76
    //   47: astore 7
    //   49: aload 4
    //   51: invokeinterface 383 1 0
    //   56: aload 7
    //   58: athrow
    //   59: goto +17 -> 76
    //   62: astore 7
    //   64: iconst_0
    //   65: istore 6
    //   67: goto +9 -> 76
    //   70: astore 7
    //   72: aload 7
    //   74: astore 5
    //   76: iload 6
    //   78: ifeq +27 -> 105
    //   81: aload 4
    //   83: invokeinterface 387 1 0
    //   88: ifeq +27 -> 115
    //   91: aload 5
    //   93: ifnull +6 -> 99
    //   96: aload 5
    //   98: athrow
    //   99: aload 8
    //   101: areturn
    //   102: goto +13 -> 115
    //   105: aload 4
    //   107: invokeinterface 383 1 0
    //   112: iconst_1
    //   113: istore 6
    //   115: iinc 3 255
    //   118: iload_3
    //   119: ifgt -98 -> 21
    //   122: new 364 org/deuce/transaction/TransactionException
    //   125: dup
    //   126: ldc_w 389
    //   129: invokespecial 390 org/deuce/transaction/TransactionException:<init> (Ljava/lang/String;)V
    //   132: athrow
    //
    // Exception table:
    //   from to target type
    //   34 44 47 org/deuce/transaction/AbortTransactionException
    //   34 44 62 org/deuce/transaction/TransactionException
    //   34 44 70 java/lang/Throwable } 
  @Atomic
  private void atomicProcess(Decoder arg1, Packet arg2) { // Byte code:
    //   0: aconst_null
    //   1: astore 5
    //   3: invokestatic 370 org/deuce/transaction/ContextDelegator:getInstance ()Lorg/deuce/transaction/Context;
    //   6: astore 4
    //   8: iconst_1
    //   9: istore 6
    //   11: ldc_w 371
    //   14: istore_3
    //   15: goto +96 -> 111
    //   18: aload 4
    //   20: ldc_w 402
    //   23: ldc_w 374
    //   26: invokeinterface 380 3 0
    //   31: aload_0
    //   32: aload_1
    //   33: aload_2
    //   34: aload 4
    //   36: invokevirtual 347 jstamp/intruder/Intruder:atomicProcess (Ljstamp/intruder/Decoder;Ljstamp/intruder/Packet;Lorg/deuce/transaction/Context;)V
    //   39: goto +32 -> 71
    //   42: astore 7
    //   44: aload 4
    //   46: invokeinterface 383 1 0
    //   51: aload 7
    //   53: athrow
    //   54: goto +17 -> 71
    //   57: astore 7
    //   59: iconst_0
    //   60: istore 6
    //   62: goto +9 -> 71
    //   65: astore 7
    //   67: aload 7
    //   69: astore 5
    //   71: iload 6
    //   73: ifeq +25 -> 98
    //   76: aload 4
    //   78: invokeinterface 387 1 0
    //   83: ifeq +25 -> 108
    //   86: aload 5
    //   88: ifnull +6 -> 94
    //   91: aload 5
    //   93: athrow
    //   94: return
    //   95: goto +13 -> 108
    //   98: aload 4
    //   100: invokeinterface 383 1 0
    //   105: iconst_1
    //   106: istore 6
    //   108: iinc 3 255
    //   111: iload_3
    //   112: ifgt -94 -> 18
    //   115: new 364 org/deuce/transaction/TransactionException
    //   118: dup
    //   119: ldc_w 389
    //   122: invokespecial 390 org/deuce/transaction/TransactionException:<init> (Ljava/lang/String;)V
    //   125: athrow
    //
    // Exception table:
    //   from to target type
    //   31 39 42 org/deuce/transaction/AbortTransactionException
    //   31 39 57 org/deuce/transaction/TransactionException
    //   31 39 65 java/lang/Throwable } 

Guy Korland

unread,
Feb 19, 2013, 2:12:31 PM2/19/13
to deuce-stm-...@googlegroups.com
You can use one of the decompilation tools, e.g. jad.

Guy

--
You received this message because you are subscribed to the Google Groups "Deuce-STM developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to deuce-stm-develo...@googlegroups.com.
To post to this group, send email to deuce-stm-...@googlegroups.com.
Visit this group at http://groups.google.com/group/deuce-stm-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Vincent Ni

unread,
Feb 21, 2013, 11:42:43 AM2/21/13
to deuce-stm-...@googlegroups.com
The example I showed is already from the jad.
Guy

To unsubscribe from this group and stop receiving emails from it, send an email to deuce-stm-developers+unsub...@googlegroups.com.

Guy Korland

unread,
Feb 21, 2013, 1:06:44 PM2/21/13
to deuce-stm-...@googlegroups.com
Are you sure? it's still in a bytecode view


To unsubscribe from this group and stop receiving emails from it, send an email to deuce-stm-develo...@googlegroups.com.

Vincent Ni

unread,
Feb 22, 2013, 2:44:26 PM2/22/13
to deuce-stm-...@googlegroups.com
Yes. I used the offline instrumentation approach to generate the intrumented jar file. Then I used jar xf <intrumented jar file> to unpack the file and load the class files JD-GUI on Mac 10.8.2. The code for atomic method is still in bytecode view.
Guy

To unsubscribe from this group and stop receiving emails from it, send an email to deuce-stm-developers+unsubscrib...@googlegroups.com.
To post to this group, send email to deuce-stm-...@googlegroups.com.

Guy Korland

unread,
Feb 22, 2013, 6:00:56 PM2/22/13
to deuce-stm-...@googlegroups.com
Anything special bothers you with the bytecode? I can help you walk through, it's a very simple bytecode.

To unsubscribe from this group and stop receiving emails from it, send an email to deuce-stm-develo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages