Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/cranelift/src/func_environ.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ impl<'module_environment> FuncEnvironment<'module_environment> {
fn fuel_check(&mut self, builder: &mut FunctionBuilder) {
self.fuel_increment_var(builder);
let out_of_gas_block = builder.create_block();
builder.set_cold_block(out_of_gas_block);
let continuation_block = builder.create_block();

// Note that our fuel is encoded as adding positive values to a
Expand Down
4 changes: 2 additions & 2 deletions tests/disas/gc/array-copy-with-fuel.wat
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
;; @0020 v12 = icmp sge v10, v11 ; v11 = 0
;; @0020 brif v12, block2, block3(v10)
;;
;; block2:
;; block2 cold:
;; @0020 v172 = iadd.i64 v8, v9 ; v9 = 1
;; @0020 store notrap aligned region2 v172, v7
;; @0020 v14 = call fn0(v0), stack_map=[i32 @ ss0+0, i32 @ ss1+0]
Expand Down Expand Up @@ -132,7 +132,7 @@
;; @002b v184 = icmp sge v133, v183 ; v183 = 0
;; @002b brif v184, block8, block9(v133)
;;
;; block8:
;; block8 cold:
;; @002b store.i64 notrap aligned region2 v133, v7
;; @002b v137 = call fn0(v0)
;; @002b v139 = load.i64 notrap aligned region2 v7
Expand Down
8 changes: 4 additions & 4 deletions tests/disas/memory-copy-fuel-const-len.wat
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
;; @0023 v9 = icmp sge v7, v8 ; v8 = 0
;; @0023 brif v9, block2, block3(v7)
;;
;; block2:
;; block2 cold:
;; @0023 v58 = iadd.i64 v5, v6 ; v6 = 1
;; @0023 store notrap aligned region2 v58, v4
;; @0023 v11 = call fn0(v0)
Expand Down Expand Up @@ -93,7 +93,7 @@
;; @0030 v8 = icmp sge v6, v7 ; v7 = 0
;; @0030 brif v8, block2, block3(v6)
;;
;; block2:
;; block2 cold:
;; @0030 v43 = iadd.i64 v4, v5 ; v5 = 1
;; @0030 store notrap aligned region2 v43, v3
;; @0030 v10 = call fn0(v0)
Expand Down Expand Up @@ -144,7 +144,7 @@
;; @003d v8 = icmp sge v6, v7 ; v7 = 0
;; @003d brif v8, block2, block3(v6)
;;
;; block2:
;; block2 cold:
;; @003d v50 = iadd.i64 v4, v5 ; v5 = 1
;; @003d store notrap aligned region2 v50, v3
;; @003d v10 = call fn0(v0)
Expand All @@ -168,7 +168,7 @@
;; @0045 v52 = icmp sge v31, v51 ; v51 = 0
;; @0045 brif v52, block4, block5(v31)
;;
;; block4:
;; block4 cold:
;; @0045 v53 = iadd.i64 v29, v30 ; v30 = 4100
;; @0045 store notrap aligned region2 v53, v3
;; @0045 v35 = call fn0(v0)
Expand Down
4 changes: 2 additions & 2 deletions tests/disas/memory-copy-fuel.wat
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
;; @001e v10 = icmp sge v8, v9 ; v9 = 0
;; @001e brif v10, block2, block3(v8)
;;
;; block2:
;; block2 cold:
;; @001e v61 = iadd.i64 v6, v7 ; v7 = 1
;; @001e store notrap aligned region2 v61, v5
;; @001e v12 = call fn0(v0)
Expand Down Expand Up @@ -61,7 +61,7 @@
;; @0025 v63 = icmp sge v49, v62 ; v62 = 0
;; @0025 brif v63, block4, block5(v49)
;;
;; block4:
;; block4 cold:
;; @0025 store.i64 notrap aligned region2 v49, v5
;; @0025 v53 = call fn0(v0)
;; @0025 v55 = load.i64 notrap aligned region2 v5
Expand Down
Loading