function testBoxed() { for (let i = 0; i < 1000; ++i) {
let vals = values[i % values.length];
// NB: The parser can only fold `if (true) { ... }`. Using an explicit // variable ensures that only GVN will fold the test-condition. constTrue = true;
// Conditionally set |bi| to create a phi-value. MToInt64's type policy will // see a boxed input and therefore not apply MTruncateBigIntToInt64. // // Later let GVN simplify MToInt64(MInt32ToBigInt(i32)) to just // MExtendInt32ToInt64(i32). // // MBox(MInt32ToBigInt(i32)) is captured by a resume point, so we can't // recover MInt32ToBigInt(i32), because MBox is not recoverable.
let bi = undefined; if (True) {
bi = BigInt(vals[0]);
}
function testRecover() { for (let i = 0; i < 1000; ++i) {
let vals = values[i % values.length];
// NB: The parser can only fold `if (true) { ... }`. Using an explicit // variable ensures that only GVN will fold the test-condition. constTrue = true;
// Conditionally set |bi| to create a phi-value. MToInt64's type policy will // see a BigInt input and therefore apply MTruncateBigIntToInt64. // // Later let GVN simplify MTruncateBigIntToInt64(MInt32ToBigInt(i32)) to // just MExtendInt32ToInt64(i32). // // MInt32ToBigInt(i32) is captured by a resume point, but since // MInt32ToBigInt is recoverable, it will be optimized away.
let bi = 0n; if (True) {
bi = BigInt(vals[0]);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.