mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1034400: Make RNot recover in all cases and not assert on objects; r=nbp
This commit is contained in:
parent
e95f670b1a
commit
7b888e7d95
28
js/src/jit-test/tests/ion/bug1034400.js
Normal file
28
js/src/jit-test/tests/ion/bug1034400.js
Normal file
@ -0,0 +1,28 @@
|
||||
var countG = 0;
|
||||
function g() {
|
||||
switch(countG++) {
|
||||
case 0: return 42;
|
||||
case 1: return "yo";
|
||||
case 2: return {};
|
||||
}
|
||||
}
|
||||
|
||||
var countFault = 0;
|
||||
function uceFault() {
|
||||
if (countFault++ == 4)
|
||||
uceFault = function() { return true }
|
||||
return false;
|
||||
}
|
||||
|
||||
function f() {
|
||||
var x = !g();
|
||||
if (uceFault() || uceFault()) {
|
||||
assertEq(x, false);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
f();
|
||||
f();
|
||||
f();
|
@ -6255,11 +6255,7 @@ class MNot
|
||||
}
|
||||
bool writeRecoverData(CompactBufferWriter &writer) const;
|
||||
bool canRecoverOnBailout() const {
|
||||
// Non objects are recoverable and objects that cannot emulate
|
||||
// undefined get folded into 'true' by GVN.
|
||||
// So the only way to reach this function with an operand that
|
||||
// is an object is when that object might emulate undefined.
|
||||
return !operandMightEmulateUndefined_;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -501,7 +501,6 @@ RNot::recover(JSContext *cx, SnapshotIterator &iter) const
|
||||
RootedValue v(cx, iter.read());
|
||||
RootedValue result(cx);
|
||||
|
||||
MOZ_ASSERT(!v.isObject());
|
||||
result.setBoolean(!ToBoolean(v));
|
||||
|
||||
iter.storeInstructionResult(result);
|
||||
|
Loading…
Reference in New Issue
Block a user