Skip to content

Commit

Permalink
Sample for intrinsic
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkrit committed Jul 24, 2017
1 parent 1eeed46 commit 9ba6a99
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Binary file added lib/hsdis-amd64.dll
Binary file not shown.
Binary file added lib/hsdis-amd64.lib
Binary file not shown.
3 changes: 3 additions & 0 deletions lib/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Copy dll/lib in %javahome%\jre\bin\server folder

java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly ...
22 changes: 22 additions & 0 deletions src/main/java/intrinsic/AtomicCounterAssembly.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package intrinsic;

import java.util.concurrent.atomic.AtomicInteger;

/*
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly -server -cp target/classes intrinsic.AtomicCounterAssembly
*/
public class AtomicCounterAssembly {

public static void main(String...args) {

AtomicInteger i = new AtomicInteger();
int total = 0;
for(int x=0;x<1000;x++) {
total = i.incrementAndGet();
}
System.out.println(total);

}
}

0 comments on commit 9ba6a99

Please sign in to comment.