Closed Bug 878505 Opened 10 years ago Closed 10 years ago

OdinMonkey: reading from float view gives doublish but writing requires double?

Categories

(Core :: JavaScript Engine, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: jruderman, Assigned: luke)

References

Details

(Keywords: testcase)

Attachments

(1 file)

function g(stdlib, foreign, heap)
{
  "use asm"
  var Float32ArrayView = new stdlib.Float32Array(heap)
  function f()
  {
    Float32ArrayView[0] = Float32ArrayView[1];
  }
  return f;
}

/Users/jruderman/Desktop/asmjs/e.js:7:0 warning: asm.js type error: doublish is not double

(Is this an intentional deviation from the spec?)
In contrast, intish works fine:

function g(stdlib, foreign, heap)
{
  "use asm"
  var Int32ArrayView = new stdlib.Int32Array(heap)
  function f()
  {
    Int32ArrayView[0] = Int32ArrayView[1];
  }
  return f;
}
My reading of the spec is that both intish heaps and doublish heaps should work, and both of these examples validate in http://turtlescript.github.cscott.net/docco/asm-llvm.html

(Maybe I should make asm-llvm an online checker?)
Yeah, we talked about it on irc and I think this is just a simple bug in Odin.
Attached patch fix and testSplinter Review
Assignee: general → luke
Status: NEW → ASSIGNED
Attachment #760095 - Flags: review?(bbouvier)
>             return f.failf(lhs, "%s is not a subtype of intish", rhsType.toChars());

vs

>+            return f.failf(lhs, "%s is not doublish", rhsType.toChars());

seems like a minor inconsistency.
Comment on attachment 760095 [details] [diff] [review]
fix and test

Review of attachment 760095 [details] [diff] [review]:
-----------------------------------------------------------------

Nice! As Jesse pointed out, it would be also nice that the messages have the same form.
And still for the purposes of consistency, should we change the enum element |ArrayStore_Double| to |ArrayStore_Doublish|?
Attachment #760095 - Flags: review?(bbouvier) → review+
Mmm, by sense of style seems weak at 2am.  Thanks guys
https://hg.mozilla.org/mozilla-central/rev/1eff67ffe6b9
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.