This file contains hidden or 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
--- FUNCTION SOURCE () id{0,0} --- | |
var iterations = 2; | |
print("Running (" + iterations + ")... "); | |
var testData = new Uint8Array(1024 * 1024); | |
for (var i = 0; i < 1024 * 1024; i++) { | |
testData[i] = i % 256; | |
} | |
var key = [0x80]; for (i = 1; i < 32; i++) key[i] = 0x07; | |
var nonce = []; for (i = 0; i < 8; i++) nonce[i] = 0x01; | |
if (iterations < 100) { |
This file contains hidden or 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
function bar(x) { | |
try { // just to prevent inlining | |
return x; | |
} catch (e) { } | |
} | |
function foo(o) { | |
var sum = 0; | |
for (var i = 0; i < 10; i++) { | |
sum += bar(o.x); /* o.x will not be hoisted out of the loop */ |
This file contains hidden or 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
function Clash(x) { | |
// Each instance of Clash gets a different getter for the property | |
// xx. This for the second instance makes it impossible to have this | |
// accessor promoted to the hidden class because it does not match expected | |
// accessor (the same as the first instance had) which in turn prevents its | |
// inlining later. | |
Object.defineProperty(this, "xx", { | |
get: function () { return x * x } | |
}); | |
} |
This file contains hidden or 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
import 'dart:mirrors'; | |
class Proxy { | |
static final getName = currentMirrorSystem().getName; | |
final target; | |
Proxy(this.target); | |
noSuchMethod(invocation) { |
This file contains hidden or 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
<div id="result"></div> |
This file contains hidden or 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
$ node -e "console.log(process.versions.v8)" | |
3.14.5.9 | |
$ node bubble.js | |
81754 | |
$ iojs -e "console.log(process.versions.v8)" | |
4.1.0.7 | |
$ iojs bubble.js | |
42165 | |
$ diff -u bubble.js bubble1.js | |
--- bubble.js 2015-03-04 20:41:08.432717779 +0100 |
This file contains hidden or 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
function f(x, y) { | |
x = 'Q: why?'; | |
console.log(arguments[0]); | |
arguments[1] = 'A: just because'; | |
console.log(y); | |
} | |
f(null, null); | |
// Q: why? | |
// A: just because |
This file contains hidden or 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
// Benefit of optimizing this function via OSR is high: | |
// a) it is long running; | |
// b) optimization speeds up the code considerably; | |
// c) it is called a few times only. | |
function loopy() { | |
var arr = new Uint8Array(100); | |
for (var j = arr[0]; j < 1e2; j++) { | |
for (var i = arr[0]; i < 1e6; i++) { | |
Math.sqrt(arr[0] * arr[0]); | |
} |
This file contains hidden or 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
library writer; | |
import 'dart:typed_data'; | |
/// Writer wraps a fixed size Uint8List and writes values into it using | |
/// big-endian byte order. | |
class Writer { | |
/// Output buffer. | |
final Uint8List out; |
This file contains hidden or 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
#include <cstdio> | |
#include <stdint.h> | |
struct value_t { | |
union { | |
float fx[2]; | |
int32_t ix[2]; | |
}; |