Closed Bug 1109054 Opened 7 years ago Closed 8 months ago

MTest::operandMightEmulateUndefined not updated in all cases

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

defect

Tracking

()

RESOLVED INVALID

People

(Reporter: jandem, Unassigned)

Details

Yesterday I was looking into bug 1004388 and noticed we have an MTest with operandMightEmulateUndefined = true for the testcase below.

The problem is in MTest::foldsTo: the operand is MNot and we fold it by adding a new MTest, but we don't set operandMightEmulateUndefined = false for this new MTest.

This particular case is easy to fix because MNot also has an operandMightEmulateUndefined flag that we can copy, but there are other places that create new MTest instructions. We should find a way to set this flag consistently, maybe by adding a new argument to the constructor.

function f() {
    var o = {foo: 1};
    var p = null;
    var res = 0;
    for (var i=0; i<10000; i++) {
	var x = (i < 9000) ? o : p;
	if (!x)
	    return res;
	res = x.foo;
    }
    return res;
}
f();
Summary: MTest::operandMightEmulateUndefined not set in all cases → MTest::operandMightEmulateUndefined not updated in all cases
Jeff?  You added this stuff, right?
Flags: needinfo?(jwalden+bmo)
Priority: -- → P3

No longer valid with Warp, operandMightEmulateUndefined has been removed.

Status: NEW → RESOLVED
Closed: 8 months ago
Flags: needinfo?(jwalden)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.