NetLogo/Tortoise — pull request #86 by TheBizzle (2014-04-07 23:11:54+00:00)
Title: Fixing some language tests by getting `stop` working correctly

This pull request contains a lot of noise because all of the model dumps and compiler tests needed to be updated, thanks to this making a fundamental change to the compiler. In particular, that change is that the bodies of all procedures, as well as all `ask`/`ask`-like blocks, and also all top-level observer code—all of that stuff now runs its code through `Prims.stoppably`, which takes a thunk as an argument and evaluates it in a `stop`-safe `try`/`catch` block.

Concerns were expressed earlier about how this might negative affect performance. I don't particularly think that any performance hit we would see would be very avoidable, but here are my benchmarks on the matter:

> Time: 04/07/2014 @ 05:43:13 PM CDT
> Version: 69658cf
> Comment: Without `Procedures.stoppably`
>
> BZ Benchmark (Nashorn 1.8.0):
> --Average: 61.93 seconds
> --Min: 60.338 seconds
> --Max: 63.196 seconds
>
> BZ Benchmark (SpiderMonkey C30.0a1):
> --Average: 18.446 seconds
> --Min: 18.324 seconds
> --Max: 18.583 seconds
>
> BZ Benchmark (V8 Node.js v0.10.26):
> --Average: 29.328 seconds
> --Min: 28.432 seconds
> --Max: 30.061 seconds
>
> ==========
>
> Time: 04/07/2014 @ 05:14:26 PM CDT
> Version: 69658cf-dirty
> Comment: Added `Procedures.stoppably`
>
> BZ Benchmark (Nashorn 1.8.0):
> --Average: 69.009 seconds
> --Min: 67.413 seconds
> --Max: 70.208 seconds
>
> BZ Benchmark (SpiderMonkey C30.0a1):
> --Average: 21.378 seconds
> --Min: 21.258 seconds
> --Max: 21.448 seconds
>
> BZ Benchmark (V8 Node.js v0.10.26):
> --Average: 30.007 seconds
> --Min: 29.491 seconds
> --Max: 30.958 seconds

The performance hit in SpiderMonkey and Nashorn is about 15%. V8 hardly seems to notice that anything happened.

Requesting review by @frankduncan and @SethTisue.