Backed out changeset aa85f08f9f76 (bug 1116855) for Hazard analysis failures.

This commit is contained in:
Ryan VanderMeulen
2015-01-26 15:58:58 -05:00
parent 6e4f8ae8ab
commit 0df4e149fb
22 changed files with 260 additions and 1499 deletions

View File

@@ -901,9 +901,6 @@ js::StandardDefineProperty(JSContext *cx, HandleObject obj, HandleId id, const P
return DefinePropertyOnArray(cx, arr, id, desc, throwError, rval);
}
if (obj->is<UnboxedPlainObject>() && !obj->as<UnboxedPlainObject>().convertToNative(cx))
return false;
if (obj->getOps()->lookupGeneric) {
if (obj->is<ProxyObject>()) {
Rooted<PropertyDescriptor> pd(cx);
@@ -966,9 +963,6 @@ js::DefineProperties(JSContext *cx, HandleObject obj, HandleObject props)
return true;
}
if (obj->is<UnboxedPlainObject>() && !obj->as<UnboxedPlainObject>().convertToNative(cx))
return false;
if (obj->getOps()->lookupGeneric) {
if (obj->is<ProxyObject>()) {
Rooted<PropertyDescriptor> pd(cx);
@@ -1497,13 +1491,10 @@ js::CreateThis(JSContext *cx, const Class *newclasp, HandleObject callee)
return NewObjectWithClassProto(cx, newclasp, proto, parent, kind);
}
static inline JSObject *
static inline PlainObject *
CreateThisForFunctionWithType(JSContext *cx, HandleTypeObject type, JSObject *parent,
NewObjectKind newKind)
{
if (type->maybeUnboxedLayout() && newKind != SingletonObject)
return UnboxedPlainObject::create(cx, type, newKind);
if (types::TypeNewScript *newScript = type->newScript()) {
if (newScript->analyzed()) {
// The definite properties analysis has been performed for this
@@ -1549,14 +1540,14 @@ CreateThisForFunctionWithType(JSContext *cx, HandleTypeObject type, JSObject *pa
return NewObjectWithType<PlainObject>(cx, type, parent, allocKind, newKind);
}
JSObject *
PlainObject *
js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject *proto,
NewObjectKind newKind /* = GenericObject */)
{
RootedObject res(cx);
RootedPlainObject res(cx);
if (proto) {
RootedTypeObject type(cx, cx->getNewType(nullptr, TaggedProto(proto),
RootedTypeObject type(cx, cx->getNewType(&PlainObject::class_, TaggedProto(proto),
&callee->as<JSFunction>()));
if (!type)
return nullptr;
@@ -1568,7 +1559,7 @@ js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject
if (regenerate) {
// The script was analyzed successfully and may have changed
// the new type table, so refetch the type.
type = cx->getNewType(nullptr, TaggedProto(proto),
type = cx->getNewType(&PlainObject::class_, TaggedProto(proto),
&callee->as<JSFunction>());
MOZ_ASSERT(type && type->newScript());
}
@@ -1590,7 +1581,7 @@ js::CreateThisForFunctionWithProto(JSContext *cx, HandleObject callee, JSObject
return res;
}
JSObject *
PlainObject *
js::CreateThisForFunction(JSContext *cx, HandleObject callee, NewObjectKind newKind)
{
RootedValue protov(cx);
@@ -1601,10 +1592,10 @@ js::CreateThisForFunction(JSContext *cx, HandleObject callee, NewObjectKind newK
proto = &protov.toObject();
else
proto = nullptr;
JSObject *obj = CreateThisForFunctionWithProto(cx, callee, proto, newKind);
PlainObject *obj = CreateThisForFunctionWithProto(cx, callee, proto, newKind);
if (obj && newKind == SingletonObject) {
RootedPlainObject nobj(cx, &obj->as<PlainObject>());
RootedPlainObject nobj(cx, obj);
/* Reshape the singleton before passing it as the 'this' value. */
NativeObject::clear(cx, nobj);
@@ -3805,7 +3796,6 @@ JSObject::dump()
if (obj->isNewTypeUnknown()) fprintf(stderr, " new_type_unknown");
if (obj->hasUncacheableProto()) fprintf(stderr, " has_uncacheable_proto");
if (obj->hadElementsAccess()) fprintf(stderr, " had_elements_access");
if (obj->wasNewScriptCleared()) fprintf(stderr, " new_script_cleared");
if (obj->isNative()) {
NativeObject *nobj = &obj->as<NativeObject>();