Ontwikkelaars van de V8 JavaScript-engine
Decompiler
De originele C-functie is bijvoorbeeld gecompileerd in wasm
typedef struct {float x, y, z; } vec3;
zwevende punt(const vec3 *a, const vec3 *b) {
retourneer a->x * b->x +
a->y * b->y +
a->z * b->z;
}
zal door het hulpprogramma wasm-decompile worden gedecompileerd in een pseudo-taal
functie punt(a:{ a:zweven, b:zweven, c:zweven },
b:{ a:zweven, b:zweven, c:zweven }):zweven {
retourneer aa * ba + ab * bb + ac * bc
}
terwijl de conversie naar tekstformaat ".wat" er zo uit zou zien
(func $dot (type 0) (param i32 i32) (resultaat f32)
(f32.toevoegen
(f32.toevoegen
(f32.mul
(f32.laden
(lokaal.get 0))
(f32.laden
(lokaal.get 1)))
(f32.mul
(f32.belastingsverschuiving=4
(lokaal.get 0))
(f32.belastingsverschuiving=4
(lokaal.get 1))))
(f32.mul
(f32.belastingsverschuiving=8
(lokaal.get 0))
(f32.belastingsverschuiving=8
(lokaal.get 1))))))
Bron: opennet.ru