preillyme/v8js — pull request #131 by stesie (2014-12-09 00:22:20+00:00)
Title: Apply time/memory limits to V8Function calls

Implementation to feature requested/discussed in #129

* this adds two new setter functions `setTimeLimit` and `setMemoryLimit` on the V8Js class
* time & memory limits are still allowed on the `executeString` calls and override "instance limits" (via setters)
* if no limits are passed to `executeString`, then the instance limits are applied on `executeString` calls
* the instance limits are always applied to V8Function calls

Besides this patch fixes the `GetHeapStatistics` call behaviour. Earlier V8Js just called this method on the isolate, however the comments in the header file state, that you must hold a v8::Locker instance during the call. If a memory limit shall be applied, now the execution is quickly interrupted using RequestInterrupt ... and the limits are checked in the callback after aquiring the lock as needed ... then execution is continued.

cheers
~stesie

@christiaan @pinepain