Bug 1132128 - Don't use recover instructions for MRegExp* instructions. rs=nbp

This commit is contained in:
Jan de Mooij 2015-02-16 23:12:05 +01:00
parent 70194f34c6
commit 8a90fdda86
2 changed files with 32 additions and 3 deletions

View File

@ -0,0 +1,26 @@
if (getJitCompilerOptions()["ion.warmup.trigger"] > 20)
setJitCompilerOption("ion.warmup.trigger", 20);
function callRegExpTest(i) {
var s = "" + i;
var re = /(\d+)/;
re.test(s);
assertEq(RegExp.$1, s);
}
function callRegExpExec(i) {
var s = "" + i;
var re = /(\d+)/;
var res = re.exec(s);
assertEq(RegExp.$1, s);
return res;
}
function callRegExpReplace(i) {
var s = "" + i;
var re = /(\d+)/;
s.replace(re, "");
assertEq(RegExp.$1, s);
}
for (var i = 0; i < 60; i++) {
callRegExpTest(i);
callRegExpExec(i);
callRegExpReplace(i);
}

View File

@ -6963,7 +6963,8 @@ class MRegExpExec
bool writeRecoverData(CompactBufferWriter &writer) const MOZ_OVERRIDE;
bool canRecoverOnBailout() const MOZ_OVERRIDE {
if (regexp()->isRegExp())
// XXX: always return false for now, to work around bug 1132128.
if (false && regexp()->isRegExp())
return !regexp()->toRegExp()->source()->needUpdateLastIndex();
return false;
}
@ -7008,7 +7009,8 @@ class MRegExpTest
// RegExpTest has a side-effect on the regexp object's lastIndex
// when sticky or global flags are set.
// Return false unless we are sure it's not the case.
if (regexp()->isRegExp())
// XXX: always return false for now, to work around bug 1132128.
if (false && regexp()->isRegExp())
return !regexp()->toRegExp()->source()->needUpdateLastIndex();
return false;
}
@ -7066,7 +7068,8 @@ class MRegExpReplace
bool canRecoverOnBailout() const MOZ_OVERRIDE {
// RegExpReplace will zero the lastIndex field when global flag is set.
// So we can only remove this if it's non-global.
if (pattern()->isRegExp())
// XXX: always return false for now, to work around bug 1132128.
if (false && pattern()->isRegExp())
return !pattern()->toRegExp()->source()->global();
return false;
}