Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333829 - TransformsBlock has different byte codes with new compiler
Summary: TransformsBlock has different byte codes with new compiler
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xsl (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.3 M5   Edit
Assignee: David Carver CLA
QA Contact: David Carver CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 333678
  Show dependency tree
 
Reported: 2011-01-10 01:04 EST by David Williams CLA
Modified: 2011-01-28 13:16 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2011-01-10 01:04:16 EST
similar to other bugs related to 333678 the subject class produces different byte codes with latest JDT compiler. 

The reason is apparently that the compiler handles the empty switch statement in 

protected void setSortColumn(int column) 

method differently. 

Presumably more efficiently? 

For the source of 

	@Override
	protected void setSortColumn(int column) {
		switch (column) {
		// case 1:
		// sortByName();
		// break;
		// case 2:
		// sortByType();
		// break;
		}
		super.setSortColumn(column);
	}


The 3.6 compiler produced: 

  // Method descriptor #4 (I)V
  // Stack: 2, Locals: 2
  protected void setSortColumn(int column);
    0  aload_0 [this]
    1  iload_1 [column]
    2  invokespecial org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock.setSortColumn(int) : void [261]
    5  return
      Line numbers:
        [pc: 0, line: 179]
        [pc: 5, line: 180]
      Local variable table:
        [pc: 0, pc: 6] local: this index: 0 type: org.eclipse.wst.xsl.internal.debug.ui.tabs.main.TransformsBlock
        [pc: 0, pc: 6] local: column index: 1 type: int



The new 3.7 M4 compiler produces

  // Method descriptor #4 (I)V
  // Stack: 2, Locals: 2
  protected void setSortColumn(int column);
    0  iload_1 [column]
    1  pop
    2  aload_0 [this]
    3  iload_1 [column]
    4  invokespecial org.eclipse.wst.xsl.internal.debug.ui.AbstractTableBlock.setSortColumn(int) : void [261]
    7  return
      Line numbers:
        [pc: 0, line: 171]
        [pc: 2, line: 179]
        [pc: 7, line: 180]
      Local variable table:
        [pc: 0, pc: 8] local: this index: 0 type: org.eclipse.wst.xsl.internal.debug.ui.tabs.main.TransformsBlock
        [pc: 0, pc: 8] local: column index: 1 type: int


While I can't "read" byte code instructions, the empty switch statement does look a bit odd, and I'd not be surprised if it couldn't be "compiled out" of byte codes. 

My main concern is that the bits now differ, even though version/qualifier is the same ... so ... I'd suggest simply incrementing service field by +100 re-releasing.
Comment 1 David Carver CLA 2011-01-28 00:24:10 EST
Tentatively targeting for 3.3M6.
Comment 2 David Carver CLA 2011-01-28 13:16:21 EST
Incremented the service field by +100 per suggestion.  No code changes otherwise.