Repairing and mechanising the JavaScript relaxed memory model
Repairing and mechanising the JavaScript relaxed memory model
复制标题
修复和机械化 JavaScript 宽松内存模型
DOI:
--
复制
发表时间:
2020
期刊:
影响因子:
--
通讯作者:
Shu
中科院分区:
文献类型:
--
作者:
Conrad Watt;Christopher Pulte;A. Podkopaev;G. Barbier;Stephen Dolan;Shaked Flur;Jean Pichon;Shu
Modern JavaScript includes the SharedArrayBuffer feature, which provides access to true shared memory concurrency. SharedArrayBuffers are simple linear buffers of bytes, and the JavaScript specification defines an axiomatic relaxed memory model to describe their behaviour. While this model is heavily based on the C/C++11 model, it diverges in some key areas. JavaScript chooses to give a well-defined semantics to data-races, unlike the "undefined behaviour" of C/C++11. Moreover, the JavaScript model is mixed-size. This means that its accesses are not to discrete locations, but to (possibly overlapping) ranges of bytes. We show that the model, in violation of the design intention, does not support a compilation scheme to ARMv8 which is used in practice. We propose a correction, which also incorporates a previously proposed fix for a failure of the model to provide Sequential Consistency of Data-Race-Free programs (SC-DRF), an important correctness condition. We use model checking, in Alloy, to generate small counter-examples for these deficiencies, and investigate our correction. To accomplish this, we also develop a mixed-size extension to the existing ARMv8 axiomatic model. Guided by our Alloy experimentation, we mechanise (in Coq) the JavaScript model (corrected and uncorrected), our ARMv8 model, and, for the corrected JavaScript model, a "model-internal" SC-DRF proof and a compilation scheme correctness proof to ARMv8. In addition, we investigate a non-mixed-size subset of the corrected JavaScript model, and give proofs of compilation correctness for this subset to x86-TSO, Power, RISC-V, ARMv7, and (again) ARMv8, via the Intermediate Memory Model (IMM). As a result of our work, the JavaScript standards body (ECMA TC39) will include fixes for both issues in an upcoming edition of the specification.
登录
查看更多内容
DOI:
10.1145/2837614.2837615
发表时间:
2016-01
期刊:
Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
影响因子:
--
作者:
Shaked Flur;Kathryn E. Gray;Christopher Pulte;Susmit Sarkar;A. Sezgin;Luc Maranget;Will Deacon;Peter Sewell
通讯作者:
Shaked Flur;Kathryn E. Gray;Christopher Pulte;Susmit Sarkar;A. Sezgin;Luc Maranget;Will Deacon;Peter Sewell
DOI:
10.1145/2254064.2254102
发表时间:
2012
期刊:
--
影响因子:
--
作者:
Sarkar S
通讯作者:
Sarkar S
DOI:
10.1145/3009837.3009838
发表时间:
2017
期刊:
--
影响因子:
--
作者:
Wickerson J
通讯作者:
Wickerson J
DOI:
10.1145/2535838.2535876
发表时间:
2014
期刊:
--
影响因子:
--
作者:
Bodin M
通讯作者:
Bodin M
DOI:
10.1145/3009837.3009839
发表时间:
2017
期刊:
--
影响因子:
--
作者:
Flur S
通讯作者:
Flur S