Closed Bug 1278223 Opened 8 years ago Closed 8 years ago

Add release asserts to enforce single context per runtime

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

Details

Attachments

(2 files)

We should add release asserts to keep us from regressing this in Gecko. After that we can start relying on this in the engine and simplify/optimize a bunch of things.

We will also have to fix up or remove jsapi-tests and shell tests that currently violate this.
Attached patch PatchSplinter Review
This adds the release assert and gets rid of the multiple-cx stuff we have in the shell and jsapi-tests.
Attachment #8760252 - Flags: review?(luke)
Attachment #8760252 - Flags: review?(luke) → review+
Attached patch Fix gtestsSplinter Review
This fixes some gtests to use the main context.

JS_ContextIterator isn't pretty but this should be a temporary thing anyway.
Attachment #8760300 - Flags: review?(nfitzgerald)
Comment on attachment 8760300 [details] [diff] [review]
Fix gtests

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

::: devtools/shared/heapsnapshot/tests/gtest/DevTools.h
@@ -47,5 @@
>      rt = getRuntime();
>      if (!rt)
>        return;
>  
> -    cx = createContext();

I also removed createContext locally.
Comment on attachment 8760300 [details] [diff] [review]
Fix gtests

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

Thanks!
Attachment #8760300 - Flags: review?(nfitzgerald) → review+
Pushed by jandemooij@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8456f48c6118
part 1 - Stop using multiple contexts per runtime in gtests. r=fitzgen
https://hg.mozilla.org/integration/mozilla-inbound/rev/1258a697a4bb
part 2 - Change the shell to use a single cx per runtime and add a release assert to enforce this. r=luke
https://hg.mozilla.org/mozilla-central/rev/8456f48c6118
https://hg.mozilla.org/mozilla-central/rev/1258a697a4bb
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: