diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index 8a41afc51..789565e5f 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -1824,6 +1824,12 @@ jit::ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph) bool jit::MakeMRegExpHoistable(MIRGraph& graph) { + // If we are compiling try blocks, regular expressions may be observable + // from catch blocks (which Ion does not compile). For now just disable the + // pass in this case. + if (graph.hasTryBlock()) + return true; + for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) { for (MDefinitionIterator iter(*block); iter; iter++) { if (!iter->isRegExp()) diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 195156e64..cf936758a 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -1124,6 +1124,10 @@ JSObject::setFlags(ExclusiveContext* cx, BaseShape::Flag flags, GenerateShape ge RootedObject self(cx, this); + Shape* existingShape = self->ensureShape(cx); + if (!existingShape) + return false; + if (isNative() && as().inDictionaryMode()) { if (generateShape == GENERATE_SHAPE && !as().generateOwnShape(cx)) return false; @@ -1137,10 +1141,6 @@ JSObject::setFlags(ExclusiveContext* cx, BaseShape::Flag flags, GenerateShape ge return true; } - Shape* existingShape = self->ensureShape(cx); - if (!existingShape) - return false; - Shape* newShape = Shape::setObjectFlags(cx, flags, self->getTaggedProto(), existingShape); if (!newShape) return false;