Closed Bug 1692876 Opened 4 years ago Closed 4 years ago

Perform some clean-ups in (Shared)ArrayBuffer code

Categories

(Core :: JavaScript Engine, task)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(7 files)

Noticed while working on bug 1692517:

  • Remove dead code.
  • Reduce indirections.
  • Etc.

Inline the various AnyArrayBufferXYZ() functions into the corresponding
ArrayBufferObjectMaybeShared methods.

Drive-by change:
Remove the buf variable in ArrayBufferObjectMaybeShared::dataPointerEither()
for consistency with the other ArrayBufferObjectMaybeShared methods.

SharedArrayBufferObject doesn't define an isPreparedForAsmJS() method, so
this method was actually calling itself again.

Depends on D105202

AsAnyArrayBuffer() was only called in a single place in "asm.js". Replace
that call by directly rejecting shared array buffers at the top of CheckBuffer.

Depends on D105203

  • Remove ArrayBufferObject::OwnsState enum.
  • Remove method declarations without definitions.

Depends on D105204

Remove functions which are entirely unused.

Depends on D105205

Use the standard is/as() methods to test/convert (shared) array buffers.

Depends on D105206

Use {g,s}etFixedSlot() instead of {g,s}etReservedSlot() for consistency with
non-shared array buffers and because it's slightly faster.

Depends on D105207

Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/autoland/rev/fde304dd0f1f Part 1: Remove indirections for ArrayBufferObjectMaybeShared methods. r=jandem https://hg.mozilla.org/integration/autoland/rev/8d2942ebab53 Part 2: Fix isPreparedForAsmJS for shared buffers. r=jandem https://hg.mozilla.org/integration/autoland/rev/d6933e650527 Part 3: Remove AsAnyArrayBuffer function. r=jandem https://hg.mozilla.org/integration/autoland/rev/e7612e478f48 Part 4: Remove unused declarations in array buffer code. r=jandem https://hg.mozilla.org/integration/autoland/rev/fcd2d1b118f0 Part 5: Remove unused (shared) array buffer functions. r=jandem https://hg.mozilla.org/integration/autoland/rev/a4e32034b278 Part 6: Replace the remaining (shared) array buffer helpers with standard is/as() methods. r=jandem https://hg.mozilla.org/integration/autoland/rev/c754d0f1602d Part 7: Use fixed- instead of reserved-slot accessors for SharedArrayObject. r=jandem
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: