- Compare the LIR and ASM code generated for the bridge between the
hosted and the bootstrapped version. Here are the findings:
The code is identical after the register allocation. It is almost identical after code generation. One small difference is that the 'moves' right before a function call are not exactly in the same order but are still correct. I guess it comes from the fact that I use an object as a hashMap to order moves and that iterating through object properties doesn't give the same result in tachyon and v8. The other difference is that the bytes listing for each instruction gives undefined values instead of numbers. Therefore the bytes in the CodeBlock might be wrong.
We were retrieving a string value for the bytes this way:
function printDigit(d) { return "0123456789abcdef"[d]; };
I changed it to:
+ const digits = + ["0", "1", "2", "3", "4", "5", "6" , "7", "8", "9", + "a", "b", "c", "d", "e", "f"]; + function printDigit(d) { return digits[d]; };
It is an idiom we should support in the future.
Having fixed that, I can attest that the listing for the generated code is byte-identical. I will now try to list the machine code block (the bytes in memory) and compare them.
Erick