-
-
Save indutny/3130c097d11570476f22 to your computer and use it in GitHub Desktop.
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
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