Closed Bug 1092318 Opened 10 years ago Closed 10 years ago

Remove unsized array typed objects

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: bhackett1024, Assigned: bhackett1024)

References

Details

Attachments

(1 file)

Attached patch patch (deleted) — Splinter Review
Currently the typed objects code distinguishes between sized arrays, which have a fixed length created as part of their descriptor, and unsized arrays, whose instances can have different (though immutable) lengths. Spec changes for typed objects have removed this distinction, so that all array types have a known length. The attached patch removes unsized arrays and unsized type descriptors from the typed objects implementation, which is a considerable simplification. This doesn't bring the array typed objects totally up to date with the spec --- there is still an ArrayType function, though its signature is now ArrayType(elemType, length). This isn't part of any spec, but makes for a gentler transition from the current state of things and will be removed after this lands.
Attachment #8515212 - Flags: review?(nmatsakis)
Comment on attachment 8515212 [details] [diff] [review] patch Review of attachment 8515212 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/builtin/TypedObject.cpp @@ +675,5 @@ > ReportCannotConvertTo(cx, args[0], "ArrayType element specifier"); > return false; > } > > + if (!args[1].isInt32() || args[1].toInt32() < 0) { For future reference, I am pretty sure it was incorrect of me to write the code this way. I imagine we ought to be coercing to int32, not checking the type-tag. But that might be best done in another patch. @@ +705,5 @@ > if (!stringRepr) > return false; > > + // Extract ArrayType.prototype > + RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); If I read this correctly, you're giving all array types period the same prototype? This is certainly not what the spec will do, though there will exist a prototype object that plays that role.
Attachment #8515212 - Flags: review?(nmatsakis) → review+
This failure was only on ASAN, on a test that seems to be behaving fine but allocates a 2GB typed object, which ASAN isn't able to allocate (don't know why it worked before) and ends up reporting an error rather than just returning null. I just removed the test in the push below. https://hg.mozilla.org/integration/mozilla-inbound/rev/ceca39a1a154
Flags: needinfo?(bhackett1024)
Assignee: nobody → bhackett1024
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Depends on: 1102608
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: