mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
Bug 1631133 - MToNumberInt32 does not directly map to CacheIR's GuardToInt32Index. r=iain
Differential Revision: https://phabricator.services.mozilla.com/D71419
This commit is contained in:
parent
976500d7ac
commit
31c7a3bec0
17
js/src/jit-test/tests/warp/null-not-zero-index.js
Normal file
17
js/src/jit-test/tests/warp/null-not-zero-index.js
Normal file
@ -0,0 +1,17 @@
|
||||
// |jit-test| --no-threads
|
||||
|
||||
function f(index) {
|
||||
var a = [123];
|
||||
return a[index]
|
||||
}
|
||||
|
||||
function g() {
|
||||
for (var i = 0; i < 100; i++) {
|
||||
// Make sure |null| is not treated like a |0| index.
|
||||
assertEq(f(i > 90 ? null : 0), i > 90 ? undefined : 123)
|
||||
}
|
||||
}
|
||||
|
||||
for (var j = 0; j < 10; j++) {
|
||||
g();
|
||||
}
|
@ -167,7 +167,8 @@ bool WarpCacheIRTranspiler::transpile_GuardToInt32Index() {
|
||||
Int32OperandId outputId = reader.int32OperandId();
|
||||
|
||||
MDefinition* input = getOperand(inputId);
|
||||
auto* ins = MToNumberInt32::New(alloc(), input);
|
||||
auto* ins =
|
||||
MToNumberInt32::New(alloc(), input, IntConversionInputKind::NumbersOnly);
|
||||
current->add(ins);
|
||||
|
||||
return defineOperand(outputId, ins);
|
||||
|
Loading…
Reference in New Issue
Block a user