smalltalk.addPackage('Benchfib'); smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib'); smalltalk.addMethod( "_main", smalltalk.method({ selector: "main", fn: function (){ var self=this; var result; return smalltalk.withContext(function($ctx1) { result=_st((0))._tinyBenchmarks(); _st(console)._log_(_st("0 tinyBenchmarks => ").__comma(result)); return self}, function($ctx1) {$ctx1.fill(self,"main",{result:result}, smalltalk.Benchfib.klass)})}, messageSends: ["tinyBenchmarks", "log:", ","]}), smalltalk.Benchfib.klass); smalltalk.addMethod( "_benchFib", smalltalk.method({ selector: "benchFib", fn: function (){ var self=this; return smalltalk.withContext(function($ctx1) { var $2,$1; $2=_st(self).__lt((2)); if(smalltalk.assert($2)){ $1=(1); } else { $1=_st(_st(_st(_st(self).__minus((1)))._benchFib()).__plus(_st(_st(self).__minus((2)))._benchFib())).__plus((1)); }; return $1; }, function($ctx1) {$ctx1.fill(self,"benchFib",{}, smalltalk.Number)})}, messageSends: ["ifTrue:ifFalse:", "+", "benchFib", "-", "<"]}), smalltalk.Number); smalltalk.addMethod( "_benchmark", smalltalk.method({ selector: "benchmark", fn: function (){ var self=this; var size,flags,prime,k,count; return smalltalk.withContext(function($ctx1) { var $1,$3,$5,$4,$2,$6; size=(8190); $1=self; $2=(function(iter){ return smalltalk.withContext(function($ctx2) { count=(0); count; flags=_st((smalltalk.Array || Array))._new(); flags; _st(size)._timesRepeat_((function(){ return smalltalk.withContext(function($ctx3) { return _st(flags)._add_(true); }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})})); $3=size; $4=(function(i){ return smalltalk.withContext(function($ctx3) { $5=_st(flags)._at_(i); if(smalltalk.assert($5)){ prime=_st(i).__plus((1)); prime; k=_st(i).__plus(prime); k; _st((function(){ return smalltalk.withContext(function($ctx4) { return _st(k).__lt_eq(size); }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._whileTrue_((function(){ return smalltalk.withContext(function($ctx4) { _st(flags)._at_put_(k,false); k=_st(k).__plus(prime); return k; }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})})); count=_st(count).__plus((1)); return count; }; }, function($ctx3) {$ctx3.fillBlock({i:i},$ctx1)})}); return _st((1))._to_do_($3,$4); }, function($ctx2) {$ctx2.fillBlock({iter:iter},$ctx1)})}); _st((1))._to_do_($1,$2); $6=count; return $6; }, function($ctx1) {$ctx1.fill(self,"benchmark",{size:size,flags:flags,prime:prime,k:k,count:count}, smalltalk.Number)})}, messageSends: ["to:do:", "new", "timesRepeat:", "add:", "ifTrue:", "+", "whileTrue:", "at:put:", "<=", "at:"]}), smalltalk.Number); smalltalk.addMethod( "_jsbenchFib", smalltalk.method({ selector: "jsbenchFib", fn: function (){ var self=this; return smalltalk.withContext(function($ctx1) { if (this < 2) { return 1; } else { return (this-1)._jsbenchFib() + (this-2)._jsbenchFib() + 1;}; return self}, function($ctx1) {$ctx1.fill(self,"jsbenchFib",{}, smalltalk.Number)})}, messageSends: []}), smalltalk.Number); smalltalk.addMethod( "_jsbenchmark", smalltalk.method({ selector: "jsbenchmark", fn: function (){ var self=this; return smalltalk.withContext(function($ctx1) { var size = 8190; var count; for (var z=0;z