DescriptionMojom backend: Stop re-computing version info and field packing data.
We have removed most of the logic from pack.py because these computations are now being performed
in the front end. What remains in pack.py is some logic to re-organize the data from the
intermediate representation into a form that the code generators want. As we start to build
new-generation backends we can re-visit the exact shape of the data we put into the
intermediate representation and perhaps some more of this reorganization logic might be
moved to the front end:
- We left the PackedStruct object because this is what the code generators expect.
It is mostly populated now by copying data from the intermediate representation.
- We left the function GetByteLayout(). This function synthesizes the byte layout for a struct based on
equivalent data in the intermediate representation.
- The utility function GetPad() seems to be used directly by some of the code generators.
Summary of changes:
- In pack.py we delete GetAlignmentForKind, GetFieldOffset, GetVersionInfo, and most of the logic in the PackedStruct
constructor.
- We delete pack_tests.py and pack_unittest.py. These tests have been ported to Go tests in the frontend
in https://codereview.chromium.org/1833593002/.
- In mojom_translator.py we translate the version_info field of a struct and the offset, bit and
min_version fields of a struct field.
- In generator.py we stop creating synthetic request and response parameter structs and instead use
the ones translated from the intermediate representation. Similarly we stop computing struct.versions.
- We modify the logic in mojom_go_generatory.py so that rather than constructing a new object
to represent a synthetic parameter struct instead we use the object that has been translated
from the intermediate representation, because that object contains the packing data.
- In module.py we eliminate the min_versions property getter because the min_version property is now
part of the intermediate representation.
BUG=#713
R=azani@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/2c2910c3e4821732b7660e362fad1f413c2f7349
Patch Set 1 #Messages
Total messages: 21 (18 generated)
|