Skip to content

Instantly share code, notes, and snippets.

View AndreasMadsen's full-sized avatar

Andreas Madsen AndreasMadsen

View GitHub Profile
@AndreasMadsen
AndreasMadsen / index.html
Created September 21, 2015 16:55
TCP created before MakeCallback
<!DOCTYPE html>
<meta charset="utf8">
<title>dprof visualizer</title>
<style>
/* general page layout */
html, body {
margin: 0;
height: 100%;
}
@AndreasMadsen
AndreasMadsen / index.html
Created September 17, 2015 20:05
chrome-bug
<!DOCTYPE html>
<meta charset="utf8">
<title>dprof visualizer</title>
<style>
/* general page layout */
html, body {
margin: 0;
height: 100%;
}
var stream = require('stream');
var s = new stream.Readable({
highWaterMark: 20,
read: function() {
setImmediate(this.push.bind(this, 'abc'));
}
});
s.pipe(process.stdout);
@AndreasMadsen
AndreasMadsen / .rc
Created March 21, 2015 12:48
alias nodeir
alias nodeir='node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm --print-opt-code'
@AndreasMadsen
AndreasMadsen / rnn.py
Created March 11, 2015 15:12 — forked from tmramalho/rnn
import theano
import theano.tensor as T
import numpy as np
import cPickle
import random
import matplotlib.pyplot as plt
class RNN(object):
def __init__(self, nin, n_hidden, nout):
'use strict';
var stream = require('stream');
var timer = new stream.Readable({
highWaterMark: 1,
read: function() {
console.log('read');
var self = this;
'use strict';
var asyncWrap = process.binding('async_wrap');
var fs = require('fs');
var asyncHooksObject = {};
var kCallInitHook = 0;
asyncHooksObject[kCallInitHook] = 1;
//asyncHooksObject = new Uint8Array([1]);
@AndreasMadsen
AndreasMadsen / patch.diff
Last active August 29, 2015 14:05
Working Local Scope in v8
diff --git a/src/runtime.cc b/src/runtime.cc
index 1616434..a72eff3 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -14552,6 +14552,59 @@ RUNTIME_FUNCTION(Runtime_GetScript) {
}
+// Get variabels in this function scope
+RUNTIME_FUNCTION(Runtime_LocalVariabels) {
d8 --allow-natives-syntax test.js
@AndreasMadsen
AndreasMadsen / v8.diff
Created August 25, 2014 15:47
Add CallSiteGetFunctionArguments to frame object
diff --git a/src/messages.js b/src/messages.js
index c86c12d..ad5921c 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -801,6 +801,10 @@ function CallSiteGetFunction() {
? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey);
}
+function CallSiteGetFunctionArguments() {
+ return GET_PRIVATE(this, CallSiteFunctionKey).arguments;