Bug 890686 - Implement JS_GlobalObjectTraceHook, and install it appropriately. (r=billm)

This commit is contained in:
Eric Faust
2014-04-04 16:58:08 -07:00
parent 979010c742
commit 20e02fae56
30 changed files with 139 additions and 26 deletions

View File

@@ -1286,7 +1286,12 @@ NewObject(ExclusiveContext *cx, types::TypeObject *type_, JSObject *parent, gc::
* This will cancel an already-running incremental GC from doing any more
* slices, and it will prevent any future incremental GCs.
*/
if (clasp->trace && !(clasp->flags & JSCLASS_IMPLEMENTS_BARRIERS)) {
bool globalWithoutCustomTrace = clasp->trace == JS_GlobalObjectTraceHook &&
!cx->compartment()->options().getTrace();
if (clasp->trace &&
!globalWithoutCustomTrace &&
!(clasp->flags & JSCLASS_IMPLEMENTS_BARRIERS))
{
if (!cx->shouldBeJSContext())
return nullptr;
JSRuntime *rt = cx->asJSContext()->runtime();