diff options
Diffstat (limited to 'src/ir/cost.h')
-rw-r--r-- | src/ir/cost.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h index 268ac41b3..a006146d3 100644 --- a/src/ir/cost.h +++ b/src/ir/cost.h @@ -563,8 +563,14 @@ struct CostAnalyzer : public OverriddenVisitor<CostAnalyzer, Index> { Index visitRefTest(RefTest* curr) { WASM_UNREACHABLE("TODO: GC"); } Index visitRefCast(RefCast* curr) { WASM_UNREACHABLE("TODO: GC"); } Index visitBrOnCast(BrOnCast* curr) { WASM_UNREACHABLE("TODO: GC"); } - Index visitRttCanon(RttCanon* curr) { WASM_UNREACHABLE("TODO: GC"); } - Index visitRttSub(RttSub* curr) { WASM_UNREACHABLE("TODO: GC"); } + Index visitRttCanon(RttCanon* curr) { + // TODO: investigate actual RTT costs in VMs + return 1; + } + Index visitRttSub(RttSub* curr) { + // TODO: investigate actual RTT costs in VMs + return 2 + visit(curr->parent); + } Index visitStructNew(StructNew* curr) { WASM_UNREACHABLE("TODO: GC"); } Index visitStructGet(StructGet* curr) { return 1 + nullCheckCost(curr->ref) + visit(curr->ref); |