mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 07:04:04 -05:00
Add prepare hint to javascript example (#6016)
Without this additional line, v8 trunk produces no output, and v8 11.3 produces a bunch of assembly with no `imull` instruction. I don't actually know much about v8 or javascript, but based on [this mailing list post](https://groups.google.com/g/v8-users/c/xlx22gScRNs/m/yE2-boWsBQAJ) and testing on godbolt.org, this works.
This commit is contained in:
@@ -3,6 +3,9 @@ function square(a) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Collect type information on next call of function
|
||||
%PrepareFunctionForOptimization(square)
|
||||
|
||||
// Call function once to fill type information
|
||||
square(23);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user