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
/** | |
* @fileoverview | |
* @author Taketoshi Aono | |
*/ | |
const fs = require('fs'); | |
const LOOP_COUNT = 1e6; | |
function generatorBenchmark(filename, cb) { | |
const fd = fs.openSync(filename, 'w'); |
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
if (typeof console === 'undefined') console = {log:print}; | |
function forIn(o) { | |
let result = 0; | |
for (const key in o) { | |
if (Object.prototype.hasOwnProperty.call(o, key)) { | |
result += key.length + o[key].length; | |
} | |
} | |
return result; |
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
if (typeof console === 'undefined') console = {log:print}; | |
function forIn(o) { | |
let result = 0; | |
for (const key in o) { | |
if (Object.prototype.hasOwnProperty.call(o, key)) { | |
result += key.length + o[key].length; | |
} | |
} | |
return result; |
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
; rcx = kernel address | |
; rbx = probe array | |
retry: | |
mov al, byte [rcx] | |
shl rax, 0xc | |
jz retry | |
mov rbx, qword [rbx + rax] |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <iostream> | |
const int kHeapObjectTag = 1; | |
const int kHeapObjectTagSize = 2; | |
const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; | |
inline static bool HasHeapObjectTag(const char* value) { | |
return ((reinterpret_cast<intptr_t>(value) & kHeapObjectTagMask) == |
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
/** | |
* @fileoverview | |
* @author Taketoshi Aono | |
*/ | |
(function(Promise) { | |
if (typeof module === 'object' && module.exports) { | |
module.exports = Promise; | |
} else if (typeof window === 'object') { | |
window.SimplePromise = Promise; |
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
const hello = () => new Promise(resolve => setTimeout(() => resolve("hello"), 300)); | |
const world = () => new Promise(resolve => setTimeout(() => resolve("world"), 300)); | |
co(function* () { | |
var hello = yield hello(); | |
var world = yield world(); | |
return `${hello} ${world}`; | |
}).then(word => console.log(value)); |
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
import * as React from 'react'; | |
import { | |
Observable | |
} from 'rxjs/Rx'; | |
import { | |
createModule, | |
component, | |
IOResponse, | |
Tags as T, | |
run, |