Skip to content

Instantly share code, notes, and snippets.

View chriswhocodes's full-sized avatar

Chris Newland chriswhocodes

View GitHub Profile
@chriswhocodes
chriswhocodes / PathtracerMT.java
Last active March 14, 2019 23:33
Multithreaded version of @shelajev Java port of the postcard raytracer by Fabien Sanglard
package org.example.pathtracer.multithreaded;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
@chriswhocodes
chriswhocodes / gist:0ee21a9c33472d5bc35ce050fc961e03
Created January 8, 2019 19:15
OpenJDK hg diff for floating point min/max intrinsics hg diff -c 53041:f15af1e2c683
diff -r 6aeb6a23fb83 -r f15af1e2c683 src/hotspot/cpu/aarch64/aarch64.ad
--- a/src/hotspot/cpu/aarch64/aarch64.ad Tue Dec 18 16:22:46 2018 -0500
+++ b/src/hotspot/cpu/aarch64/aarch64.ad Tue Dec 18 16:50:35 2018 +0000
@@ -12601,6 +12601,63 @@
%}
+// Math.max(FF)F
+instruct maxF_reg_reg(vRegF dst, vRegF src1, vRegF src2) %{
+ match(Set dst (MaxF src1 src2));
chris@vultr:~/openjfx8_clean$ /home/chris/gradle-4.8.1/bin/gradle clean openZip -PCOMPILE_TARGETS=armv6hf
> Configure project :
all tool packages are present [armv6hf-02.tgz, gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux.tgz]
*****************************************************************
Unsupported gradle version 4.8.1 in use.
Only version 4.8 is supported. Use this version at your own risk
*****************************************************************
gradle.gradleVersion: 4.8.1
OS_NAME: linux
@chriswhocodes
chriswhocodes / gist:5516d24078205dc218dead870853e018
Created May 25, 2016 07:52
JavaFX crash on VideoDataBuffer.convertToFormat
Process: java [900]
Path:
/Library/Java/JavaVirtualMachines/jdk1.8.0_92_openjfx/Contents/Home/bin/java
Identifier: java
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: eclipse [601]
Responsible: java [900]
User ID: 501
<?xml version='1.0' encoding='UTF-8'?>
<hotspot_log version='160 1' process='1441' time_ms='1437572649560'>
<vm_version>
<name>
Java HotSpot(TM) 64-Bit Server VM
</name>
<release>
25.51-b03
</release>
<info>
@chriswhocodes
chriswhocodes / gist:c6c6e33e7994c98d4975
Created June 9, 2015 21:09
Output of run.js under Nashorn 9b67
9b67
Result of
$JAVA_HOME/bin/jjs -co --dump-debug-dir=. run.js
chris@debian:~/jitwatch/sandbox/sources/jdk/nashorn/internal/scripts$ ls -l
total 4
-rw-r--r-- 1 chris chris 700 Jun 9 22:07 Script$run.class
chris@debian:~/jitwatch/sandbox/sources/jdk/nashorn/internal/scripts$ $JAVA_HOME/bin/javap -v *
@chriswhocodes
chriswhocodes / gist:e3a85c3613b084e45356
Created June 9, 2015 21:04
Output of run.js under Nashorn 8u60b18
8u60b18
Result of
$JAVA_HOME/bin/jjs -co --dump-debug-dir=. run.js
chris@debian:~/jitwatch/sandbox/sources/jdk/nashorn/internal/scripts$ ls -l
total 8
-rw-r--r-- 1 chris chris 871 Jun 9 21:57 JO5P0.class
-rw-r--r-- 1 chris chris 3216 Jun 9 21:57 Script$run.class
@chriswhocodes
chriswhocodes / run.js
Created June 9, 2015 21:00
Example JavaScript that dumps different bytecode with Nashorn 8u60b18 and 9b67
var sum = 0;
for (var i = 0; i < 1000000; i++)
{
sum = addOne(sum);
sum = addTwo(sum);
}
print(sum);
# Run complete. Total time: 02:40:43
Benchmark Mode Cnt Score Error Units
NashornTest.testBox2D avgt 20 10548.066 ± 2164.147 ms/op
NashornTest.testCodeLoad avgt 20 641.698 ± 47.914 ms/op
NashornTest.testCrypto avgt 20 1327.919 ± 164.940 ms/op
NashornTest.testDeltablue avgt 20 693.767 ± 146.080 ms/op
NashornTest.testEarleyBoyer avgt 20 2798.762 ± 759.598 ms/op
NashornTest.testGBEmuPart1 avgt 20 17875.571 ± 3209.708 ms/op
NashornTest.testMandreel avgt 20 43786.140 ± 1838.792 ms/op
package org.sample;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;
import javax.script.Invocable;
import javax.script.ScriptEngineManager;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;