View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000096 | file | General | public | 2019-08-02 20:34 | 2019-08-05 13:10 |
Reporter | koala_man | Assigned To | christos | ||
Priority | low | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 5.37 | ||||
Fixed in Version | 5.38 | ||||
Summary | 0000096: Add support for Hermes compiled JavaScript bytecode | ||||
Description | Hi! I am one of the developers of Hermes, a new JavaScript engine for mobile that pre-compiles JavaScript into bytecode. For your consideration, here is magic that can recognize our bytecode files (64bit magic + 32bit integer version, little-endian): 0 lequad 0x1F1903C103BC1FC6 Hermes compiled JavaScript bytecode, >8 lelong x version %d I think there is a case for upstreaming this because: 1. the use of a 64bit magic number minimizes the risk of false positives, 2. it's convenient for mobile JS to be able to determine a file's bytecode version to check compatibility, and 3. there are already hundreds of millions of mobile devices carrying files in this format. Please let me know what you think. | ||||
Steps To Reproduce | I have attached `hello.hbc`, a simple `print("Hello World");` compiled into Hermes bytecode using `hermes -O -emit-binary -out hello.hbc hello.js` Without the suggested magic, file's guess is `data`. With the magic, it says: hello.hbc: Hermes compiled JavaScript bytecode, version 60 | ||||
Additional Information | Hermes is developed by Facebook and was open sourced in July 2019: https://hermesengine.dev/ The bytecode header and magic numbers can be found in: https://github.com/facebook/hermes/blob/a09052e901f4b8dc925e6d4bd0cc47171b90db5e/include/hermes/BCGen/HBC/BytecodeFileFormat.h#L24 | ||||
Tags | magic | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2019-08-02 20:34 | koala_man | New Issue | |
2019-08-02 20:34 | koala_man | File Added: hello.hbc | |
2019-08-02 20:34 | koala_man | Tag Attached: magic | |
2019-08-05 13:09 | christos | Assigned To | => christos |
2019-08-05 13:09 | christos | Status | new => assigned |
2019-08-05 13:10 | christos | Status | assigned => resolved |
2019-08-05 13:10 | christos | Resolution | open => fixed |
2019-08-05 13:10 | christos | Fixed in Version | => 5.38 |
2019-08-05 13:10 | christos | Note Added: 0003282 |