Skip to content

Commit dca2cac

Browse files
committed
Remove stack chain field from VMContext
1 parent 665c098 commit dca2cac

File tree

665 files changed

+2438
-2448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

665 files changed

+2438
-2448
lines changed

crates/environ/src/vmoffsets.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
// gc_heap_bound: *mut u8,
1717
// gc_heap_data: *mut T, // Collector-specific pointer
1818
// type_ids: *const VMSharedTypeIndex,
19-
// stack_chain: *const StackChainCell,
2019
//
2120
// // Variable-width fields come after the fixed-width fields above. Place
2221
// // memory-related items first as they're some of the most frequently
@@ -298,22 +297,12 @@ pub trait PtrSize {
298297
self.vmctx_gc_heap_data() + self.size()
299298
}
300299

301-
/// The offset of the `stack_chain` field.
302-
/// This field stores a pointer into the `StoreOpauqe`, to a value of type
303-
/// `crate::stack_switching::StackChain`.
304-
// FIXME(#10248) This field is not actually in use, yet. It is only here for
305-
// future use in a subsequent stack-switching PR.
306-
#[inline]
307-
fn vmctx_stack_chain(&self) -> u8 {
308-
self.vmctx_type_ids_array() + self.size()
309-
}
310-
311300
/// The end of statically known offsets in `VMContext`.
312301
///
313302
/// Data after this is dynamically sized.
314303
#[inline]
315304
fn vmctx_dynamic_data_start(&self) -> u8 {
316-
self.vmctx_stack_chain() + self.size()
305+
self.vmctx_type_ids_array() + self.size()
317306
}
318307
}
319308

tests/all/pooling_allocator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,15 @@ fn instance_too_large() -> Result<()> {
640640
configured maximum of 16 bytes; breakdown of allocation requirement:
641641
642642
* 76.19% - 256 bytes - instance state management
643-
* 23.81% - 80 bytes - static vmctx data
643+
* 21.43% - 72 bytes - static vmctx data
644644
"
645645
} else {
646646
"\
647-
instance allocation for this module requires 240 bytes which exceeds the \
647+
instance allocation for this module requires 240 bytes which exceeds the \
648648
configured maximum of 16 bytes; breakdown of allocation requirement:
649649
650650
* 66.67% - 160 bytes - instance state management
651-
* 33.33% - 80 bytes - static vmctx data
651+
* 30.00% - 72 bytes - static vmctx data
652652
"
653653
};
654654
match Module::new(&engine, "(module)") {

tests/disas/basic-wat-test.wat

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
;; gv1 = load.i64 notrap aligned readonly gv0+8
1515
;; gv2 = load.i64 notrap aligned gv1+16
1616
;; gv3 = vmctx
17-
;; gv4 = load.i64 notrap aligned gv3+96
18-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
17+
;; gv4 = load.i64 notrap aligned gv3+88
18+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
1919
;; stack_limit = gv2
2020
;;
2121
;; block0(v0: i64, v1: i64, v2: i32, v3: i32):
2222
;; @0021 v5 = uextend.i64 v2
23-
;; @0021 v6 = load.i64 notrap aligned readonly can_move checked v0+88
23+
;; @0021 v6 = load.i64 notrap aligned readonly can_move checked v0+80
2424
;; @0021 v7 = iadd v6, v5
2525
;; @0021 v8 = load.i32 little heap v7
2626
;; @0026 v9 = uextend.i64 v3
27-
;; @0026 v10 = load.i64 notrap aligned readonly can_move checked v0+88
27+
;; @0026 v10 = load.i64 notrap aligned readonly can_move checked v0+80
2828
;; @0026 v11 = iadd v10, v9
2929
;; @0026 v12 = load.i32 little heap v11
3030
;; @0029 v13 = iadd v8, v12

tests/disas/duplicate-loads-dynamic-memory.wat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
;; gv1 = load.i64 notrap aligned readonly gv0+8
2828
;; gv2 = load.i64 notrap aligned gv1+16
2929
;; gv3 = vmctx
30-
;; gv4 = load.i64 notrap aligned gv3+96
31-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
30+
;; gv4 = load.i64 notrap aligned gv3+88
31+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
3232
;; stack_limit = gv2
3333
;;
3434
;; block0(v0: i64, v1: i64, v2: i32):
35-
;; @0057 v6 = load.i64 notrap aligned v0+96
36-
;; @0057 v8 = load.i64 notrap aligned can_move checked v0+88
35+
;; @0057 v6 = load.i64 notrap aligned v0+88
36+
;; @0057 v8 = load.i64 notrap aligned can_move checked v0+80
3737
;; @0057 v5 = uextend.i64 v2
3838
;; @0057 v7 = icmp ugt v5, v6
3939
;; @0057 v10 = iconst.i64 0
@@ -51,13 +51,13 @@
5151
;; gv1 = load.i64 notrap aligned readonly gv0+8
5252
;; gv2 = load.i64 notrap aligned gv1+16
5353
;; gv3 = vmctx
54-
;; gv4 = load.i64 notrap aligned gv3+96
55-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
54+
;; gv4 = load.i64 notrap aligned gv3+88
55+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
5656
;; stack_limit = gv2
5757
;;
5858
;; block0(v0: i64, v1: i64, v2: i32):
59-
;; @0064 v6 = load.i64 notrap aligned v0+96
60-
;; @0064 v8 = load.i64 notrap aligned can_move checked v0+88
59+
;; @0064 v6 = load.i64 notrap aligned v0+88
60+
;; @0064 v8 = load.i64 notrap aligned can_move checked v0+80
6161
;; @0064 v5 = uextend.i64 v2
6262
;; @0064 v7 = icmp ugt v5, v6
6363
;; @0064 v12 = iconst.i64 0

tests/disas/duplicate-loads-static-memory.wat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
;; gv1 = load.i64 notrap aligned readonly gv0+8
2323
;; gv2 = load.i64 notrap aligned gv1+16
2424
;; gv3 = vmctx
25-
;; gv4 = load.i64 notrap aligned gv3+96
26-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
25+
;; gv4 = load.i64 notrap aligned gv3+88
26+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
2727
;; stack_limit = gv2
2828
;;
2929
;; block0(v0: i64, v1: i64, v2: i32):
30-
;; @0057 v6 = load.i64 notrap aligned readonly can_move checked v0+88
30+
;; @0057 v6 = load.i64 notrap aligned readonly can_move checked v0+80
3131
;; @0057 v5 = uextend.i64 v2
3232
;; @0057 v7 = iadd v6, v5
3333
;; @0057 v8 = load.i32 little heap v7
@@ -42,12 +42,12 @@
4242
;; gv1 = load.i64 notrap aligned readonly gv0+8
4343
;; gv2 = load.i64 notrap aligned gv1+16
4444
;; gv3 = vmctx
45-
;; gv4 = load.i64 notrap aligned gv3+96
46-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
45+
;; gv4 = load.i64 notrap aligned gv3+88
46+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
4747
;; stack_limit = gv2
4848
;;
4949
;; block0(v0: i64, v1: i64, v2: i32):
50-
;; @0064 v6 = load.i64 notrap aligned readonly can_move checked v0+88
50+
;; @0064 v6 = load.i64 notrap aligned readonly can_move checked v0+80
5151
;; @0064 v5 = uextend.i64 v2
5252
;; @0064 v7 = iadd v6, v5
5353
;; @0064 v8 = iconst.i64 1234

tests/disas/dynamic-memory-no-spectre-access-same-index-different-offsets.wat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040
;; gv1 = load.i64 notrap aligned readonly gv0+8
4141
;; gv2 = load.i64 notrap aligned gv1+16
4242
;; gv3 = vmctx
43-
;; gv4 = load.i64 notrap aligned gv3+96
44-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
43+
;; gv4 = load.i64 notrap aligned gv3+88
44+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
4545
;; stack_limit = gv2
4646
;;
4747
;; block0(v0: i64, v1: i64, v2: i32):
48-
;; @0047 v7 = load.i64 notrap aligned v0+96
48+
;; @0047 v7 = load.i64 notrap aligned v0+88
4949
;; @0047 v6 = uextend.i64 v2
5050
;; @0047 v8 = icmp ugt v6, v7
5151
;; @0047 trapnz v8, heap_oob
52-
;; @0047 v9 = load.i64 notrap aligned can_move checked v0+88
52+
;; @0047 v9 = load.i64 notrap aligned can_move checked v0+80
5353
;; @0047 v10 = iadd v9, v6
5454
;; @0047 v11 = load.i32 little heap v10
5555
;; @004c v17 = iconst.i64 4
@@ -73,16 +73,16 @@
7373
;; gv1 = load.i64 notrap aligned readonly gv0+8
7474
;; gv2 = load.i64 notrap aligned gv1+16
7575
;; gv3 = vmctx
76-
;; gv4 = load.i64 notrap aligned gv3+96
77-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
76+
;; gv4 = load.i64 notrap aligned gv3+88
77+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
7878
;; stack_limit = gv2
7979
;;
8080
;; block0(v0: i64, v1: i64, v2: i32, v3: i32, v4: i32, v5: i32):
81-
;; @005d v7 = load.i64 notrap aligned v0+96
81+
;; @005d v7 = load.i64 notrap aligned v0+88
8282
;; @005d v6 = uextend.i64 v2
8383
;; @005d v8 = icmp ugt v6, v7
8484
;; @005d trapnz v8, heap_oob
85-
;; @005d v9 = load.i64 notrap aligned can_move checked v0+88
85+
;; @005d v9 = load.i64 notrap aligned can_move checked v0+80
8686
;; @005d v10 = iadd v9, v6
8787
;; @005d store little heap v3, v10
8888
;; @0064 v16 = iconst.i64 4

tests/disas/dynamic-memory-yes-spectre-access-same-index-different-offsets.wat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
;; gv1 = load.i64 notrap aligned readonly gv0+8
3737
;; gv2 = load.i64 notrap aligned gv1+16
3838
;; gv3 = vmctx
39-
;; gv4 = load.i64 notrap aligned gv3+96
40-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
39+
;; gv4 = load.i64 notrap aligned gv3+88
40+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
4141
;; stack_limit = gv2
4242
;;
4343
;; block0(v0: i64, v1: i64, v2: i32):
44-
;; @0047 v7 = load.i64 notrap aligned v0+96
45-
;; @0047 v9 = load.i64 notrap aligned can_move checked v0+88
44+
;; @0047 v7 = load.i64 notrap aligned v0+88
45+
;; @0047 v9 = load.i64 notrap aligned can_move checked v0+80
4646
;; @0047 v6 = uextend.i64 v2
4747
;; @0047 v8 = icmp ugt v6, v7
4848
;; @0047 v11 = iconst.i64 0
@@ -71,13 +71,13 @@
7171
;; gv1 = load.i64 notrap aligned readonly gv0+8
7272
;; gv2 = load.i64 notrap aligned gv1+16
7373
;; gv3 = vmctx
74-
;; gv4 = load.i64 notrap aligned gv3+96
75-
;; gv5 = load.i64 notrap aligned can_move checked gv3+88
74+
;; gv4 = load.i64 notrap aligned gv3+88
75+
;; gv5 = load.i64 notrap aligned can_move checked gv3+80
7676
;; stack_limit = gv2
7777
;;
7878
;; block0(v0: i64, v1: i64, v2: i32, v3: i32, v4: i32, v5: i32):
79-
;; @005d v7 = load.i64 notrap aligned v0+96
80-
;; @005d v9 = load.i64 notrap aligned can_move checked v0+88
79+
;; @005d v7 = load.i64 notrap aligned v0+88
80+
;; @005d v9 = load.i64 notrap aligned can_move checked v0+80
8181
;; @005d v6 = uextend.i64 v2
8282
;; @005d v8 = icmp ugt v6, v7
8383
;; @005d v11 = iconst.i64 0

tests/disas/f32-load.wat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
;; gv1 = load.i64 notrap aligned readonly gv0+8
1212
;; gv2 = load.i64 notrap aligned gv1+16
1313
;; gv3 = vmctx
14-
;; gv4 = load.i64 notrap aligned gv3+96
15-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
14+
;; gv4 = load.i64 notrap aligned gv3+88
15+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
1616
;; stack_limit = gv2
1717
;;
1818
;; block0(v0: i64, v1: i64, v2: i32):
1919
;; @002e v4 = uextend.i64 v2
20-
;; @002e v5 = load.i64 notrap aligned readonly can_move checked v0+88
20+
;; @002e v5 = load.i64 notrap aligned readonly can_move checked v0+80
2121
;; @002e v6 = iadd v5, v4
2222
;; @002e v7 = load.f32 little heap v6
2323
;; @0031 jump block1

tests/disas/f32-store.wat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
;; gv1 = load.i64 notrap aligned readonly gv0+8
1515
;; gv2 = load.i64 notrap aligned gv1+16
1616
;; gv3 = vmctx
17-
;; gv4 = load.i64 notrap aligned gv3+96
18-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
17+
;; gv4 = load.i64 notrap aligned gv3+88
18+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
1919
;; stack_limit = gv2
2020
;;
2121
;; block0(v0: i64, v1: i64, v2: i32, v3: f32):
2222
;; @0031 v4 = uextend.i64 v2
23-
;; @0031 v5 = load.i64 notrap aligned readonly can_move checked v0+88
23+
;; @0031 v5 = load.i64 notrap aligned readonly can_move checked v0+80
2424
;; @0031 v6 = iadd v5, v4
2525
;; @0031 store little heap v3, v6
2626
;; @0034 jump block1

tests/disas/f64-load.wat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
;; gv1 = load.i64 notrap aligned readonly gv0+8
1414
;; gv2 = load.i64 notrap aligned gv1+16
1515
;; gv3 = vmctx
16-
;; gv4 = load.i64 notrap aligned gv3+96
17-
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+88
16+
;; gv4 = load.i64 notrap aligned gv3+88
17+
;; gv5 = load.i64 notrap aligned readonly can_move checked gv3+80
1818
;; stack_limit = gv2
1919
;;
2020
;; block0(v0: i64, v1: i64, v2: i32):
2121
;; @002e v4 = uextend.i64 v2
22-
;; @002e v5 = load.i64 notrap aligned readonly can_move checked v0+88
22+
;; @002e v5 = load.i64 notrap aligned readonly can_move checked v0+80
2323
;; @002e v6 = iadd v5, v4
2424
;; @002e v7 = load.f64 little heap v6
2525
;; @0031 jump block1

0 commit comments

Comments
 (0)