Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(791)

Issue 1824263002: Mojom backend: Stop re-computing version info and field packing data. (Closed)

Created:
4 years, 9 months ago by rudominer
Modified:
4 years, 9 months ago
Reviewers:
azani
CC:
mojo-reviews_chromium.org, gregsimon, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, yzshen+mojopublicwatch_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Mojom 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)
rudominer
Hi Alex, ptal.
4 years, 9 months ago (2016-03-25 15:14:36 UTC) #18
azani
lgtm
4 years, 9 months ago (2016-03-25 19:14:26 UTC) #19
rudominer
4 years, 9 months ago (2016-03-25 20:32:30 UTC) #21
Message was sent while issue was closed.
Committed patchset #1 (id:240001) manually as
2c2910c3e4821732b7660e362fad1f413c2f7349 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698