I don't think there's any way. V8 JavaScript code is compiled to native 
code, and no instrumentation is really possible on that.

On Sunday, November 20, 2016 at 10:18:24 AM UTC-8, James Lovejoy wrote:
>
> Really I need something a little more deterministic than a time limit. Is 
> there a way to set an instruction limit? Or perhaps something similar to 
> lua_sethook (http://pgl.yoyo.org/luai/i/lua_sethook) in Lua which calls a 
> callback every given number of instructions.
>
> On Sun, Nov 20, 2016 at 4:02 AM, Ben Noordhuis <[email protected] 
> <javascript:>> wrote:
>
>> On Sat, Nov 19, 2016 at 10:11 PM, James Lovejoy <[email protected] 
>> <javascript:>> wrote:
>> > Hi,
>> >
>> > Is there a way to set a hard execution limit in the V8 engine? I want 
>> to be
>> > able to prevent things like infinite loops and recursions. I realise 
>> that
>> > since V8 compiles to machine code I don't get a program counter or 
>> anything.
>> > I feel like setting the "stack limit" is the right way to go but the 
>> usage
>> > of this feature from the documentation is unclear. Can someone guide me 
>> as
>> > to how to achieve such a limit?
>> >
>> > James
>>
>> If 'execution limit' means 'time limit': start a watchdog thread and
>> call v8::Isolate::TerminateExecution() from that thread on timeout.
>> It must be a thread, it's not safe to call from a signal handler.
>>
>> --
>> --
>> v8-users mailing list
>> [email protected] <javascript:>
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "v8-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/v8-users/Qwdd66xCtTU/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to