Last Comment Bug 764163 - IonMonkey/JM: getNewObject() should check needZealousGC() at runtime.
: IonMonkey/JM: getNewObject() should check needZealousGC() at runtime.
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: ---
Assigned To: Eric Faust [:efaust]
:
Mentors:
Depends on:
Blocks: IonMonkey
  Show dependency treegraph
 
Reported: 2012-06-12 14:10 PDT by Sean Stangl [:sstangl]
Modified: 2012-06-13 23:28 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Sean Stangl [:sstangl] 2012-06-12 14:10:02 PDT
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.
Comment 1 Eric Faust [:efaust] 2012-06-13 20:43:48 PDT
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.
Comment 2 Robert Longson 2012-06-13 23:28:11 PDT
Check is misspelled as Cehck in the comment in https://hg.mozilla.org/projects/ionmonkey/rev/b4fd23971959

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