Closed Bug 1535137 Opened 6 years ago Closed 6 years ago

Move JSOP_DOUBLE literal values into bytecode

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(3 files)

Currently, we store the double literals in PrivateScriptData::consts() with certain alignment requirements and store an index in the bytecode itself. This index is currently unaligned and we currently copy the double value to another location before using.

Instead, I'd like to store the raw bytes of the double in-line in the bytecode. This gets memcpy'd into an int64 which is BitwiseCast to a double. This shouldn't be any worse than the current unaligned index.

As a result:

  • Avoid storing both an index and double for each double literal
  • Reduce PrivateScriptData::consts() from GCPtrValue to GCPtrBigInt (which will eventually be merged with objects().
  • Remove alignment code in PrivateScriptData
Blocks: 1535138

Replace the unaligned uint32_t index with the encoded double value. The
double values are already being copied again before use, so an unaligned
uint64_t load and a BitwiseCast to double seems a more direct strategy.
This also avoids needed to manage the allocation of the consts table.

Blocks: 1535154

Depends on D23396

Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fd0ffc19dd6b Use copyAndSwap in BytecodeUtil instead of manual endian mangement r=jandem https://hg.mozilla.org/integration/autoland/rev/17ae35a549af Store JSOP_DOUBLE literals inline r=jandem https://hg.mozilla.org/integration/autoland/rev/7366858bc6ad Store inline-doubles as Values in bytecode r=jandem
Blocks: 1558801
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: