Created
January 13, 2013 12:49
-
-
Save anonymous/4523924 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Bar{ | |
public static void pop2(int a, int b){} // this method is very likely to be inlined | |
public int indexOf(byte[] bytes, byte toFind, int offset, int length) { | |
{ | |
int dummy = bytes[offset] + bytes[offset + length - 1]; | |
} | |
return 1; | |
} | |
public int twoVariables(byte[] bytes, byte toFind, int offset, int length) { | |
{ | |
int dummy = bytes[offset + length - 1]; | |
} | |
{ | |
int dummy = bytes[offset]; | |
} | |
return 1; | |
} | |
public int assignTwice(byte[] bytes, byte toFind, int offset, int length) { | |
{ | |
int dummy = bytes[offset + length - 1]; | |
dummy = bytes[offset]; | |
} | |
return 1; | |
} | |
public int useMax(byte[] bytes, byte toFind, int offset, int length) { | |
Math.max(bytes[offset + length - 1], bytes[offset]); | |
return 1; | |
} | |
public int usePop2Method(byte[] bytes, byte toFind, int offset, int length) { | |
pop2(bytes[offset + length - 1], bytes[offset]); | |
return 1; | |
} | |
public int useIf(byte[] bytes, byte toFind, int offset, int length) { | |
if ((bytes[offset] == bytes[offset+length-1])) { } | |
return 1; | |
} | |
/* | |
Does not compile: | |
public int compare(byte[] bytes, byte toFind, int offset, int length) { | |
bytes[offset] == bytes[offset + length - 1]; | |
return 1; | |
} | |
*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment