From 8d6da2ebd637e30913ed5fbef872ce789c07b365 Mon Sep 17 00:00:00 2001 From: Brian Hackett Date: Wed, 13 Apr 2011 10:20:48 -0700 Subject: [PATCH] [INFER] Fix busted jstests. --- js/src/jsdbgapi.cpp | 3 +++ js/src/jsinfer.cpp | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/js/src/jsdbgapi.cpp b/js/src/jsdbgapi.cpp index 02deb107712..33747ed3ebb 100644 --- a/js/src/jsdbgapi.cpp +++ b/js/src/jsdbgapi.cpp @@ -1094,6 +1094,9 @@ JS_SetWatchPoint(JSContext *cx, JSObject *obj, jsid id, return false; } + if (!cx->markTypePropertyConfigured(obj->getType(), propid)) + return false; + JSObject *pobj; JSProperty *prop; if (!js_LookupProperty(cx, obj, propid, &pobj, &prop)) diff --git a/js/src/jsinfer.cpp b/js/src/jsinfer.cpp index 6277bc7c5af..d613710491b 100644 --- a/js/src/jsinfer.cpp +++ b/js/src/jsinfer.cpp @@ -1796,7 +1796,6 @@ TypeCompartment::newInitializerTypeObject(JSContext *cx, JSScript *script, * observed by other code before all properties have been added. Mark * all the properties as definite properties of the object. */ - JS_ASSERT(!script->hasSharps); JSObject *baseobj = script->getObject(GET_SLOTNO(script->code + offset)); if (!res->addDefiniteProperties(cx, baseobj, false)) @@ -2684,8 +2683,10 @@ TypeObject::addDefiniteProperties(JSContext *cx, JSObject *obj, bool clearUnknow * initializers). */ TypeSet *parentTypes = proto->getType()->getProperty(cx, id, false); - if (!parentTypes || parentTypes->unknown()) + if (!parentTypes || parentTypes->unknown()) { + cx->compartment->types.checkPendingRecompiles(cx); return false; + } parentTypes->addBaseClearDefinite(cx, this); } } else { @@ -4544,11 +4545,15 @@ JSObject::makeNewType(JSContext *cx, JSScript *newScript) */ baseobj = NewReshapedObject(cx, type, baseobj->getParent(), kind, (const js::Shape *) baseobj->lastProperty()); - if (!baseobj) + if (!baseobj) { + cx->compartment->types.checkPendingRecompiles(cx); return; + } - if (!type->addDefiniteProperties(cx, baseobj, true)) + if (!type->addDefiniteProperties(cx, baseobj, true)) { + cx->compartment->types.checkPendingRecompiles(cx); return; + } type->newScript = newScript; type->newScriptFinalizeKind = unsigned(kind);