Last Comment Bug 723021 - Move stackLimit to JSRuntime
: Move stackLimit to JSRuntime
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla13
Assigned To: Igor Bukanov
:
: Jason Orendorff [:jorendorff]
Mentors:
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:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


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

Description 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 Igor Bukanov 2012-02-01 01:24:20 PST
Created attachment 593334 [details] [diff] [review]
v1

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 Luke Wagner [:luke] 2012-02-01 10:16:30 PST
Comment on attachment 593334 [details] [diff] [review]
v1

Very nice.
Comment 4 Ed Morley [:emorley] 2012-02-02 07:16:46 PST
https://hg.mozilla.org/mozilla-central/rev/9a11bcb3dcb8

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