smalltalk.addPackage('Benchfib', {}); smalltalk.addClass('Benchfib', smalltalk.Object, [], 'Benchfib'); smalltalk.addMethod( "_main", smalltalk.method({ selector: "main", fn: function (){ var self=this; return smalltalk.withContext(function($ctx1) { $ctx1.result=nil; $ctx1.locals.result=_st((0))._tinyBenchmarks(); _st(console)._log_(_st("0 tinyBenchmarks => ").__comma($ctx1.locals.result)); return self}, self, "main", [], smalltalk.Benchfib.klass)} }), 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; }, self, "benchFib", [], smalltalk.Number)} }), smalltalk.Number); smalltalk.addMethod( "_benchmark", smalltalk.method({ selector: "benchmark", fn: function (){ var self=this; return smalltalk.withContext(function($ctx1) { var $1; $ctx1.size=nil; $ctx1.flags=nil; $ctx1.prime=nil; $ctx1.k=nil; $ctx1.count=nil; $ctx1.locals.size=(8190); _st((1))._to_do_(self,(function(iter){ return smalltalk.withContext(function($ctx2) { $ctx1.locals.count=(0); $ctx1.locals.count; $ctx1.locals.flags=_st((smalltalk.Array || Array))._new(); $ctx1.locals.flags; _st($ctx1.locals.size)._timesRepeat_((function(){ return smalltalk.withContext(function($ctx3) { return _st($ctx1.locals.flags)._add_(true); })})); return _st((1))._to_do_($ctx1.locals.size,(function(i){ return smalltalk.withContext(function($ctx3) { $1=_st($ctx1.locals.flags)._at_(i); if(smalltalk.assert($1)){ $ctx1.locals.prime=_st(i).__plus((1)); $ctx1.locals.prime; $ctx1.locals.k=_st(i).__plus($ctx1.locals.prime); $ctx1.locals.k; _st((function(){ return smalltalk.withContext(function($ctx4) { return _st($ctx1.locals.k).__lt_eq($ctx1.locals.size); })}))._whileTrue_((function(){ return smalltalk.withContext(function($ctx4) { _st($ctx1.locals.flags)._at_put_($ctx1.locals.k,false); $ctx1.locals.k=_st($ctx1.locals.k).__plus($ctx1.locals.prime); return $ctx1.locals.k; })})); $ctx1.locals.count=_st($ctx1.locals.count).__plus((1)); return $ctx1.locals.count; }; })})); })})); return $ctx1.locals.count; }, self, "benchmark", [], smalltalk.Number)} }), 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}, self, "jsbenchFib", [], smalltalk.Number)} }), 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