Bug 1232859 - Don't crash or abort compilation if we're unable to compile the regex stubs. r=nbp

This commit is contained in:
Jan de Mooij 2016-01-28 14:59:42 +01:00
parent 2eb4030f07
commit a34aedbb0c
4 changed files with 17 additions and 10 deletions

View File

@ -0,0 +1,12 @@
// |jit-test| error:recursion
x = /x/;
z = [];
y = Object.defineProperty(z, "valueOf", {
get: function() {
+y;
for (var i = 0; i < 1; i++) {
a = x.exec(0);
}
}
})
z + '';

View File

@ -5044,7 +5044,7 @@ IonBuilder::inlineScriptedCall(CallInfo& callInfo, JSFunction* target)
if (types && !types->unknown()) {
TemporaryTypeSet* clonedTypes = types->clone(alloc_->lifoAlloc());
if (!clonedTypes)
return oom();
return false;
MTypeBarrier* barrier = MTypeBarrier::New(alloc(), callInfo.thisArg(), clonedTypes);
current->add(barrier);
if (barrier->type() == MIRType_Undefined)

View File

@ -1140,11 +1140,6 @@ class IonBuilder
IonBuilder* outermostBuilder();
bool oom() {
abortReason_ = AbortReason_Alloc;
return false;
}
struct LoopHeader {
jsbytecode* pc;
MBasicBlock* header;

View File

@ -1864,8 +1864,8 @@ IonBuilder::inlineRegExpMatcher(CallInfo& callInfo)
JSContext* cx = GetJitContext()->cx;
if (!cx->compartment()->jitCompartment()->ensureRegExpMatcherStubExists(cx)) {
oom();
return InliningStatus_Error;
cx->clearPendingException(); // OOM or overrecursion.
return InliningStatus_NotInlined;
}
callInfo.setImplicitlyUsedUnchecked();
@ -1918,8 +1918,8 @@ IonBuilder::inlineRegExpTester(CallInfo& callInfo)
JSContext* cx = GetJitContext()->cx;
if (!cx->compartment()->jitCompartment()->ensureRegExpTesterStubExists(cx)) {
oom();
return InliningStatus_Error;
cx->clearPendingException(); // OOM or overrecursion.
return InliningStatus_NotInlined;
}
callInfo.setImplicitlyUsedUnchecked();