Skip to content

Instantly share code, notes, and snippets.

@indutny
Created December 14, 2014 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indutny/3130c097d11570476f22 to your computer and use it in GitHub Desktop.
Save indutny/3130c097d11570476f22 to your computer and use it in GitHub Desktop.
function genT() {
return function T() {
}
}
function O() {
this.fn = null;
this.changes = 0;
}
O.prototype.outer = function outer(a) {
return this.middle(a);
};
O.prototype.middle = function middle(a) {
"use strict";
this.inner(a);
return arguments.length > 2 ? arguments[2] : void 0;
};
O.prototype.inner = function inner(a) {
var r = new (genT())(this.spillT(), a.changes * 2);
};
// Just to force pushing T with PushArgument
O.prototype.spillT = function spillT() {
debugger;
};
var o = new O();
o.outer(o);
o.outer(o);
%OptimizeFunctionOnNextCall(o.outer);
o.outer(o);
o.changes = true;
o.outer(o);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment