"asm.js type error: unknown is not a subtype of doublish" when assigning into float*array

RESOLVED FIXED in mozilla24

Status

()

Core
JavaScript Engine
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Jesse Ruderman, Assigned: bbouvier)

Tracking

(Blocks: 2 bugs, {testcase})

Trunk
mozilla24
x86_64
Mac OS X
testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

4 years ago
var g = (function(stdlib, foreign, heap) {
  "use asm";
  var identity = foreign.identity;
  var doubles = new stdlib.Float64Array(heap);
  function g()
  {
    doubles[0] = identity(2.0);
    return +doubles[0];
  }
  return g;
})(this, {identity: function(x) { return x; }}, new ArrayBuffer(4096));
print(g());

asm.js type error: unknown is not a subtype of doublish

(In other contexts, OdinMonkey seems to be fine with treating unknown as a subtype of doublish, so this is weird.)
(Reporter)

Comment 1

4 years ago
Same problem with *int*arrays.
(Assignee)

Comment 2

4 years ago
Created attachment 761734 [details] [diff] [review]
proposed fix
Assignee: general → bbouvier
Status: NEW → ASSIGNED
Attachment #761734 - Flags: review?(luke)

Comment 3

4 years ago
Comment on attachment 761734 [details] [diff] [review]
proposed fix

Thanks Benjamin, perfect fix.

On a style note, I'd prefer if you kept the switch (TypedArrayStoreType()) (the one after the CheckExpr) because that way we get the compiler checking that all the enum values are handled in the switch (and warning if one is missing).
Attachment #761734 - Flags: review?(luke) → review+
(Assignee)

Comment 4

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/3dbc486831a4
Sorry, backed out because of test failures:
http://hg.mozilla.org/integration/mozilla-inbound/rev/64e8cd80963f

TEST-UNEXPECTED-FAIL | /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/tests/asm.js/testHeapAccess.js | --ion-eager: /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/lib/asm.js:17:0 warning: successfully compiled asm.js code
TEST-UNEXPECTED-FAIL | /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/tests/asm.js/testHeapAccess.js | --baseline-eager --no-ti --no-fpu: /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/lib/asm.js:17:0 warning: successfully compiled asm.js code
TEST-UNEXPECTED-FAIL | /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/tests/asm.js/testHeapAccess.js | --no-baseline --no-ion: /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/lib/asm.js:17:0 warning: successfully compiled asm.js code
TEST-UNEXPECTED-FAIL | /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/tests/asm.js/testHeapAccess.js | --no-baseline --no-ion --no-ti: /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/lib/asm.js:17:0 warning: successfully compiled asm.js code
TEST-UNEXPECTED-FAIL | /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/tests/asm.js/testHeapAccess.js | --baseline-eager: /builds/slave/m-in_lx_sm-warnaserr-000000000/src/js/src/jit-test/lib/asm.js:17:0 warning: successfully compiled asm.js code
https://tbpl.mozilla.org/php/getParsedLog.php?id=24080933&tree=Mozilla-Inbound
(Assignee)

Updated

4 years ago
Depends on: 882514
(Assignee)

Comment 6

4 years ago
Created attachment 762303 [details] [diff] [review]
same patch with non arrow function in test case

Doh! The tests were failing because of bug 882514. Replaced the arrow function by a lambda, jit-tests now work with --tbpl.

Carrying over r+ from Luke.
Attachment #761734 - Attachment is obsolete: true
Attachment #762303 - Flags: review+
(Assignee)

Comment 7

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/e1c91dd828e8

Comment 8

4 years ago
https://hg.mozilla.org/mozilla-central/rev/e1c91dd828e8
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.