Closed Bug 773686 Opened 12 years ago Closed 10 years ago

[meta] Bring type and GC safety to the JS API


(Core :: JavaScript Engine, defect)

Not set





(Reporter: terrence, Assigned: terrence)



(Whiteboard: [js:t])

This is a meta bug to track the various pieces of work that will be required. The primary goal of this work is to expose enough C++ Type Information in the JS API to make the browser GC-safe-by-default without making it impossible for Rust to generate C wrappers.  The secondary goal is, of course, to have a nice API, although this bug is unlikely to get us all the way there.

The plan: begin putting bits of our API into js/public while converting them one interface at a time to type-safe C++.  These new bits will be #included into jsapi.h so that we don't have to do a massive jsapi.h -> js/api.h conversion until the very end.  At the same time as we convert the methods to C++, we will create trivial, implementation-hiding C shims as js/public/c_<foo>.h.  These shims will *not* be included into jsapi.h.  Each patch in this series should move one discrete block of interface and handle the (hopefully simple) browser changes at the same time.
No new shim files should be necessary.  The only parts of the API which are really C++ dependent are the roots, handles and mutable handles, and creation/destruction of those can be emulated with some C functions.  See JS_CreateHandleObject etc. in jsapi.h; this style of API is gross but should be fine for use in wrapper/glue code.
Ah, I had not seen that you've already added those!  In that case, yes, we should definitely do it that way.
Oh, also, those methods don't actually have an implementation, but that shouldn't be hard.  I think that allocating storage out of tempLifoAlloc would work.
Depends on: 787580
Depends on: 501536
Depends on: 789633
Depends on: 794667
Depends on: 798624
Depends on: 799248
Depends on: 799252
Depends on: 802318
Depends on: 802347
Depends on: 808181
No longer depends on: 799252
No longer depends on: 799248
No longer depends on: 802318
Blocks: ExactRooting
No longer blocks: GenerationalGC
All depending bugs are closed, so this one can close, too, I assume.
Depends on: 884371
Depends on: 884283
Depends on: 789637
Depends on: 884410
Depends on: 887563
Depends on: 887039
Depends on: 791022
Depends on: 789551
No longer depends on: 887039
Depends on: 900674
No longer depends on: 884410
Depends on: 906940
Depends on: 916993
Depends on: 917295
Depends on: 917296
Depends on: 917798
Depends on: 917843
Depends on: 918118
Depends on: 918373
Depends on: 928507
Depends on: 884410
Depends on: 903352
Depends on: 900986
Depends on: 899973
Depends on: 897484
Depends on: 896540
Depends on: 896280
Depends on: 879079
Depends on: 861281
Depends on: 858108
Depends on: 930782
Depends on: 931446
Depends on: 933810
Depends on: 933834
Depends on: 929314
Depends on: 933946
Depends on: 934557
Depends on: 942453
Depends on: 959787
Depends on: 961077
Depends on: 963167
Depends on: 965830
Depends on: 912581
Depends on: 962176
Depends on: 969798
Depends on: 969812
Depends on: 972385
No longer depends on: 962176
There are still a few more bits of problematic API to cover, but nothing that needs to block exact rooting. Congrats to everyone involved.
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.