Closed Bug 764163 Opened 9 years ago Closed 9 years ago

IonMonkey/JM: getNewObject() should check needZealousGC() at runtime.

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sstangl, Assigned: efaust)

References

(Blocks 1 open bug)

Details

getNewObject() in both JITs contains the following compile-time check:

>#ifdef JS_GC_ZEAL
>    if (cx->runtime->needZealousGC()) {
>        jump(fail);
>        return;
>    }
>#endif

As exists, the code assumes that when the next GC occurs, the executable code would be GC'd, then later regenerated. Since IM/JM code is now preserved on GC, needZealousGC() should actually be checked every time we attempt to perform an inline allocation.

Affects both IM and JM, but only in debug mode.
We simply check cx->runtime->gcZeal_ instead of calling needZealousGC() to prevent call and rearrangement overhead.

https://hg.mozilla.org/projects/ionmonkey/rev/b4fd23971959

JM was not patched.
Assignee: general → efaust
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Check is misspelled as Cehck in the comment in https://hg.mozilla.org/projects/ionmonkey/rev/b4fd23971959
You need to log in before you can comment on or make changes to this bug.