Last Comment Bug 723021 - Move stackLimit to JSRuntime
: Move stackLimit to JSRuntime
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla13
Assigned To: Igor Bukanov
: Jason Orendorff [:jorendorff]
Depends on:
Blocks: 722345
  Show dependency treegraph
Reported: 2012-02-01 01:18 PST by Igor Bukanov
Modified: 2012-02-02 07:16 PST (History)
2 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (27.81 KB, patch)
2012-02-01 01:24 PST, Igor Bukanov
luke: review+
Details | Diff | Splinter Review

Description User image Igor Bukanov 2012-02-01 01:18:16 PST
With thread-bound JSRuntime there is little reason to keep the native stack limits in JSContext as that requires for each JSContext instance to set the limit essentially to the same value instead of doing once per runtime initialization/SetOwnThread calls.
Comment 1 User image Igor Bukanov 2012-02-01 01:24:20 PST
Created attachment 593334 [details] [diff] [review]

The patch stores the stack limit parameters in JSRuntime and updates the API to reflect that.

The patch also removes the function call overhead from JS_CHECK_RECURSION that is very frequently used by the parser/scanner - now the implementation uses base structs for JSContext and JSRuntime that contains fields exposed in jsfriendapi.h. Then the code just casts the passed JSContext and JSRuntime to those structs to access the relevant fields.
Comment 2 User image Luke Wagner [:luke] 2012-02-01 10:16:30 PST
Comment on attachment 593334 [details] [diff] [review]

Very nice.
Comment 4 User image Ed Morley [:emorley] 2012-02-02 07:16:46 PST

Note You need to log in before you can comment on or make changes to this bug.