What does such code mean?

22 views
Skip to first unread message

Vincent Ni

unread,
Feb 19, 2013, 1:20:11 PM2/19/13
to deuce-stm-...@googlegroups.com
In the Deuce instrumented code, I find that for each read action, the Deuce will instrument the following instructions:

original version: 
  41: getfield      #36    // Field endInfoEntries:[Ljstamp/genome/endInfoEntry;

instrumented version:
  81: getstatic     #88                 // Field jstamp/genome/SequencerDeuceFieldsHolder.endInfoEntries__ADDRESS__:J

  84: lconst_0      

  85: lcmp          

  86: ifge          95

  89: getfield      #38                 // Field endInfoEntries:[Ljstamp/genome/endInfoEntry;

  92: goto          119

  95: dup           

  96: getstatic     #88                 // Field jstamp/genome/SequencerDeuceFieldsHolder.endInfoEntries__ADDRESS__:J

  99: aload         4

  101: invokestatic  #92                 // Method org/deuce/transaction/ContextDelegator.beforeReadAccess:(Ljava/lang/Object;JLorg/deuce/transaction/Context;)V

  104: dup           

  105: getfield      #38                 // Field endInfoEntries:[Ljstamp/genome/endInfoEntry;

  108: getstatic     #88                 // Field jstamp/genome/SequencerDeuceFieldsHolder.endInfoEntries__ADDRESS__:J

  111: aload         4

  113: invokestatic  #96                 // Method org/deuce/transaction/ContextDelegator.onReadAccess:(Ljava/lang/Object;Ljava/lang/Object;JLorg/deuce/transaction/Context;)Ljava/lang/Object;

  116: checkcast     #97                 // class "[Ljstamp/genome/endInfoEntry;"


The question is why Deuce needs to do the comparison (84-89)?

Guy Korland

unread,
Feb 19, 2013, 2:20:55 PM2/19/13
to deuce-stm-...@googlegroups.com
It's kind of  an optimization that if the field is final it doesn't need any transaction logging. 
Deuce marks final fields as such by setting x__ADDRESS__ as negative.


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.
 
 

Reply all
Reply to author
Forward
0 new messages