Open Bug 1744978 Opened 2 years ago Updated 5 months ago

Implement jit support for Records and Tuples

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

UNCONFIRMED

People

(Reporter: nicolo.ribaudo, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(109 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The --enable-record-tuple build flag currently disables JIT. We should implement jit support for the new Record, Tuple and Box primitives.

Type: task → enhancement
Depends on: 1730843
Blocks: 1658309
Priority: -- → P3
Assignee: nobody → tjc
Depends on: 1747741

Depends on D134842

This will be used by JIT for records (since record keys need to be sorted).

Depends on D135772

This will be useful when implementing JIT for records.

Depends on D135773

Add wrappers for NativeAddProperty, GrowElements, ArrayNativeSort, Int32ToAtom

Depends on D135774

These auxiliary ops will be used to implement baseline codegen for
the AddRecordProperty opcode.

Depends on D135783

This code will be used for code generation for AddTupleElement and AddRecordProperty.

Depends on D135788

This arises when setting object flags on records/tuples; if the record or
tuple becomes non-extensible, the shape should change (otherwise, the initial
default shape is mutated).

Depends on D135789

Depends on: 1755830
Attachment #9258780 - Attachment description: WIP: Bug 1744978 - 2. Wrap test code in function definitions in order to trigger JIT → WIP: Bug 1744978 - 1. Wrap test code in function definitions in order to trigger JIT
Attachment #9258785 - Attachment description: WIP: Bug 1744978 - 7. Add methods to support JIT for Object.is on Records/Tuples → WIP: Bug 1744978 - 2. Add methods to support JIT for Object.is on Records/Tuples
Attachment #9258786 - Attachment description: WIP: Bug 1744978 - 8. Make EXTENDED_PRIMITIVE_VALUE_SLOT public → WIP: Bug 1744978 - 3. Make EXTENDED_PRIMITIVE_VALUE_SLOT public
Attachment #9258787 - Attachment description: WIP: Bug 1744978 - 9. Add Int32ToAtomForJIT as an ABI function → WIP: Bug 1744978 - 5. Add Int32ToAtom as an ABI function

This will be used by the JIT implementation for AddRecordProperty and AddTupleElement.

Depends on D135779

This will be used by the JIT implementation for FinishRecord and FinishTuple.

Depends on D152987

This will be used by the JIT implementation for AddRecordProperty.

Depends on D152988

Attachment #9258798 - Attachment description: WIP: Bug 1744978 - 20. Take objectFlags into account when determining if shape has changed → WIP: Bug 1744978 - 9. Take objectFlags into account when determining if shape has changed
Attachment #9258793 - Attachment description: WIP: Bug 1744978 - 15. Add MacroAssembler operations to be used in implementing FinishRecord → WIP: Bug 1744978 - 10. Add MacroAssembler operations to be used in implementing FinishRecord
Attachment #9258795 - Attachment description: WIP: Bug 1744978 - 17. Add MacroAssembler type testing operations for records/tuples → WIP: Bug 1744978 - 11. Add MacroAssembler type testing operations for records/tuples
Attachment #9258797 - Attachment description: WIP: Bug 1744978 - 19. Refactor emitStoreDenseElement → WIP: Bug 1744978 - 12. Refactor emitStoreDenseElement

This will be called by the JIT implementation of AddRecordProperty if a
value is non-primitive.

Depends on D135783

This function is used to implement FinishRecord.

Depends on D152991

Attachment #9258781 - Attachment description: WIP: Bug 1744978 - 3. Expose ArrayNativeSort → WIP: Bug 1744978 - 17. Expose ArrayNativeSort

This is used to implement FinishRecord.

Depends on D135773

This is used to implement AddRecordProperty.

Depends on D152993

Attachment #9258789 - Attachment description: WIP: Bug 1744978 - 11. Add ExtendedPrimOperandId type to CacheIR.h → WIP: Bug 1744978 - 20. Add ExtendedPrimOperandId type to CacheIR.h
Attachment #9258796 - Attachment description: WIP: Bug 1744978 - 18. Add GuardToExtendedPrimitive CacheIR op → WIP: Bug 1744978 - 21. Add GuardToExtendedPrimitive CacheIR op
Attachment #9258806 - Attachment description: WIP: Bug 1744978 - 27. Add CompareExtendedPrimitive CacheIR op → WIP: Bug 1744978 - 22. Add CompareExtendedPrimitive CacheIR op
Attachment #9258810 - Attachment description: WIP: Bug 1744978 - 31. Handle ExtendedPrimitives in CacheIR case for Object.is() → WIP: Bug 1744978 - 23. Handle ExtendedPrimitives in CacheIR case for Object.is()
Attachment #9258807 - Attachment description: WIP: Bug 1744978 - 28. Add TypeOfExtendedPrimitive CacheIR op → WIP: Bug 1744978 - 24. Add TypeOfExtendedPrimitive CacheIR op
Attachment #9258811 - Attachment description: WIP: Bug 1744978 - 32. Add methods for manipulating ExtendedPrimitive properties → WIP: Bug 1744978 - 25. Add methods for manipulating ExtendedPrimitive properties
Attachment #9258812 - Attachment description: WIP: Bug 1744978 - 33. Handle property accesses on Records/Tuples properly in CacheIR → WIP: Bug 1744978 - 27. Handle property accesses on Records/Tuples properly in CacheIR
Attachment #9258803 - Attachment description: WIP: Bug 1744978 - 24. Baseline JIT compilation for InitTuple opcode → WIP: Bug 1744978 - 30. Baseline JIT compilation for InitTuple opcode
Attachment #9258804 - Attachment description: WIP: Bug 1744978 - 25. Baseline JIT compilation for FinishTuple opcode → WIP: Bug 1744978 - 31. Baseline JIT compilation for FinishTuple opcode
Attachment #9258805 - Attachment description: WIP: Bug 1744978 - 26. Baseline JIT compilation for AddTupleElement opcode → WIP: Bug 1744978 - 32. Baseline JIT compilation for AddTupleElement opcode

Depends on D135797

Attachment #9258809 - Attachment description: WIP: Bug 1744978 - 30. Handle ExtendedPrimitives in CacheIR case for typeOf → WIP: Bug 1744978 - 34. Handle ExtendedPrimitives in CacheIR case for typeOf
Attachment #9258813 - Attachment description: WIP: Bug 1744978 - 34. Implement JIT for IsTuple intrinsic → WIP: Bug 1744978 - 35. Implement JIT for IsTuple intrinsic
Attachment #9258814 - Attachment description: WIP: Bug 1744978 - 35. Implement JIT for ThisTupleValue intrinsic → WIP: Bug 1744978 - 36. Implement JIT for ThisTupleValue intrinsic
Attachment #9258815 - Attachment description: WIP: Bug 1744978 - 36. Implement JIT for TupleLength intrinsic → WIP: Bug 1744978 - 37. Implement JIT for TupleLength intrinsic

This is helpful in implementing record initialization (in the presence of spread operations, record length isn't always statically known.)

Depends on D153001

Attachment #9258790 - Attachment description: WIP: Bug 1744978 - 12. Add Record and Tuple MIR types → WIP: Bug 1744978 - 41. Add Record and Tuple MIR types

Depends on D153004

This instruction is a no-op at runtime, but allows us to re-use
MIR instructions with Object operands for Records and Tuples.

Depends on D153005

Depends on D153007

This is used to implement AddRecordProperty to ensure that record keys
are not symbols.

Depends on D153008

These are used to implement FinishRecord.

Depends on D153009

This is used in implementing AddRecordProperty and AddTupleElement.

Depends on D153010

This is used in implementing AddRecordProperty.

Depends on D153011

This is used to implement FinishRecord.

Depends on D153012

Include mozilla/Maybe.h in TupleObject.cpp
Include vm/JSContext-inl.h in RecordTupleShared.cpp

This fixes build failures on build-macosx64-hybrid/plain

Depends on D153017

Attached file WIP: Bug 1744978: tmp

Depends on D153023

Attached file WIP: Bug 1744978: tmp

Depends on D153024

Attached file WIP: Bug 1744978: tmp

Depends on D153025

Attached file WIP: Bug 1744978: tmp

Depends on D153027

The bug was that it was calling prepare() twice, which meant that in
one of the paths, the stack didn't get popped all the way, meaning we
used some random garbage as the return address

Record tests pass now except for json

Depends on D153028

This needs to be cleaned up.
Records still render as just "Object { }", but that's the best I can do
for now without knowing the code better, and it doesn't crash

Main issue I fixed was that there were two versions of createValueGrip()
in the console and both needed to be changed to return something non-null
for Record/Tuple

Also needs tests

Depends on D153029

Depends on D153031

The code was incorrectly coercing ExtPrimOperandIds into ObjOperandIds,
causing useRegister(...) to use the wrong type when unboxing Tuples,
creating invalid memory addresses

Depends on D153033

Because guardToTuple may return something that's different from its input
(it might unbox a TupleObject), it can't use a custom writer.

Depends on D153036

Depends on D153037

Depends on D153038

Depends on D153039

Depends on D153041

Uncommented tests in records-proposal-examples.js,
and some in record-tuple-cookbook.js which I had forgotten to uncomment
last time. Some tests still fail.

Depends on D153045

Uncommented tests in records-proposal-examples.js,
and some in record-tuple-cookbook.js which I had forgotten to uncomment
last time.

FIXME: Errors with JSON.stringify

Depends on D153046

Implements InitTuple and FinishTuple in Warp.

Depends on D153047

Finishes WIP of previous commit.
Extends jit-test/tests/record-tuple/basic-tuples.js to induce warp (hopefully).

Depends on D153048

Depends on D153049

This was resulting in a garbage value being written into a tuple with
an array spread on arm32

Depends on D153050

Changed CallAddRecordSpread to take both the record and the object as
Values, to use fewer registers

Depends on D153054

Depends on D153055

Depends on D153056

Depends on D153057

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: tjc → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: