Skip to content

Instantly share code, notes, and snippets.

View sjrd's full-sized avatar

Sébastien Doeraene sjrd

View GitHub Profile
@sjrd
sjrd / deltablue-es5.js
Created May 8, 2015 13:42
Scala.js benchmarks: ES5.1, ES6 and ES6 Strong Mode -- run with `$ d8 --harmony-rest-parameters --strong-mode file.js`
this['console'] = {};
this['console']['log'] = this['print'];
(function(){
'use strict';
/* Scala.js runtime support
* Copyright 2013 LAMP/EPFL
* Author: Sébastien Doeraene
*/
/* ---------------------------------- *
@sjrd
sjrd / TypedArrayFloatBuffer.js
Created February 22, 2015 22:18
Translation to JS of Scala.js' TypedArrayFloatBuffer
ScalaJS.c.Ljava_nio_TypedArrayFloatBuffer.prototype = new ScalaJS.h.Ljava_nio_FloatBuffer();
ScalaJS.c.Ljava_nio_TypedArrayFloatBuffer.prototype.constructor = ScalaJS.c.Ljava_nio_TypedArrayFloatBuffer;
/** @constructor */
ScalaJS.h.Ljava_nio_TypedArrayFloatBuffer = (function() {
/*<skip>*/
});
ScalaJS.h.Ljava_nio_TypedArrayFloatBuffer.prototype = ScalaJS.c.Ljava_nio_TypedArrayFloatBuffer.prototype;
ScalaJS.c.Ljava_nio_TypedArrayFloatBuffer.prototype.slice__Ljava_nio_FloatBuffer = (function() {
var slicedTypedArray = this.$$undtypedArray$3["subarray"](this.java$nio$Buffer$$$undposition$1, this.$$undlimit$1);
var initialLimit = ScalaJS.uI(slicedTypedArray["length"]);
@sjrd
sjrd / reversi-fastopt.js.diff
Created October 17, 2014 22:02
Differences in reversi-fastopt.js from optimizing AnonFunctions to optimizing Closures
diff --git "a/C:\\Users\\Sepi\\Documents\\Projets\\reversi-fastopt.js" "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\examples\\reversi\\target\\scala-2.11\\reversi-fastopt.js"
index 2eba7e5..d384cf7 100644
--- "a/C:\\Users\\Sepi\\Documents\\Projets\\reversi-fastopt.js"
+++ "b/C:\\Users\\Sepi\\Documents\\Projets\\scalajs\\examples\\reversi\\target\\scala-2.11\\reversi-fastopt.js"
@@ -906,6 +906,12 @@ ScalaJS.i.sc_GenSetLike$class__equals__sc_GenSetLike__O__Z = (function($$this, t
return false
}
});
+ScalaJS.i.sc_IndexedSeqLike$class__toBuffer__sc_IndexedSeqLike__scm_Buffer = (function($$this) {
+ var result = new ScalaJS.c.scm_ArrayBuffer().init___I($$this.size__I());