Last Comment Bug 693907 - Move JS_CallOnce to jsapi.cpp
: Move JS_CallOnce to jsapi.cpp
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla10
Assigned To: Steve Fink [:sfink] [:s:]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-11 21:42 PDT by Steve Fink [:sfink] [:s:]
Modified: 2011-11-05 03:11 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Once Upon a JSAPI (2.77 KB, patch)
2011-10-11 21:46 PDT, Steve Fink [:sfink] [:s:]
no flags Details | Diff | Splinter Review
Once Upon a JSAPI (2.85 KB, patch)
2011-10-19 14:22 PDT, Steve Fink [:sfink] [:s:]
jwalden+bmo: review+
Details | Diff | Splinter Review

Description Steve Fink [:sfink] [:s:] 2011-10-11 21:42:24 PDT
Currently it is in jslock.cpp alongside all the other low-level synchronization functionality. But it's the only JSAPI function defined there, and nothing else requires jsapi.h, so it seems like it would be more at home in jsapi.cpp.
Comment 1 Steve Fink [:sfink] [:s:] 2011-10-11 21:46:42 PDT
Created attachment 566437 [details] [diff] [review]
Once Upon a JSAPI
Comment 2 Steve Fink [:sfink] [:s:] 2011-10-19 14:22:24 PDT
Created attachment 568197 [details] [diff] [review]
Once Upon a JSAPI

As long as I'm moving it, perhaps I should make it work, too -- I had the success/failure sdrawkcab.
Comment 3 Jeff Walden [:Waldo] (remove +bmo to email) 2011-10-19 16:48:32 PDT
Comment on attachment 568197 [details] [diff] [review]
Once Upon a JSAPI

Review of attachment 568197 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsapi.cpp
@@ +6280,5 @@
>  }
>  
>  #endif
> +
> +#ifdef JS_THREADSAFE

I think I would prefer if you had two threadsafe #ifdef blocks here: one around CallOnce, and another within the body of JS_CallOnce, splitting for the two different implementations.  This would avoid having to repeat the JS_CallOnce signature stuff, which right now is effectively just copy-paste.
Comment 4 Steve Fink [:sfink] [:s:] 2011-10-21 15:38:21 PDT
I think I agree. Thanks.
Comment 5 Steve Fink [:sfink] [:s:] 2011-11-04 22:18:47 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/f12386561999
Comment 6 Marco Bonardo [::mak] 2011-11-05 03:11:34 PDT
https://hg.mozilla.org/mozilla-central/rev/f12386561999

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