Skip to content

Commit

Permalink
[whamm] Straight line Whamm probe on br_if (#229 from matthew-mojir…
Browse files Browse the repository at this point in the history
…a/straight-line)
  • Loading branch information
titzer authored Nov 21, 2024
2 parents 3a73f86 + 1343be5 commit 75246be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
Binary file modified test/monitors/whamm/monitors/br_mon.wasm
Binary file not shown.
35 changes: 8 additions & 27 deletions test/monitors/whamm/monitors/br_mon.wat
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,14 @@
)

(func $probe_br_if (param $entry i32) (param $arg0 i32)
local.get $arg0
(if
(then ;; branch taken
local.get $entry
i32.const 20
i32.add
local.get $entry
i32.const 20
i32.add
i64.load ;; count of branches taken
i64.const 1
i64.add
i64.store
)
(else ;; branch not taken
local.get $entry
i32.const 12
i32.add
local.get $entry
i32.const 12
i32.add
i64.load ;; count of branches not taken
i64.const 1
i64.add
i64.store
)
)
(local $offset i32)
(local.set $offset (i32.add (local.get $entry) (select (i32.const 20) (i32.const 12) (local.get $arg0))))
local.get $offset
local.get $offset
i64.load ;; count of branches taken
i64.const 1
i64.add
i64.store
)

(func $probe_br_table (param $entry i32) (param $arg0 i32)
Expand Down

0 comments on commit 75246be

Please sign in to comment.