mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1132128 - Don't use recover instructions for MRegExp* instructions. rs=nbp
This commit is contained in:
parent
70194f34c6
commit
8a90fdda86
26
js/src/jit-test/tests/ion/bug1132128.js
Normal file
26
js/src/jit-test/tests/ion/bug1132128.js
Normal 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);
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user