Last Comment Bug 693907 - Move JS_CallOnce to jsapi.cpp
: Move JS_CallOnce to jsapi.cpp
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
-- normal (vote)
: mozilla10
Assigned To: Steve Fink [:sfink] [:s:]
: Jason Orendorff [:jorendorff]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image 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 User image Steve Fink [:sfink] [:s:] 2011-10-11 21:46:42 PDT
Created attachment 566437 [details] [diff] [review]
Once Upon a JSAPI
Comment 2 User image 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 User image 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
> +

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 User image Steve Fink [:sfink] [:s:] 2011-10-21 15:38:21 PDT
I think I agree. Thanks.
Comment 5 User image Steve Fink [:sfink] [:s:] 2011-11-04 22:18:47 PDT
Comment 6 User image Marco Bonardo [::mak] 2011-11-05 03:11:34 PDT

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