diff --git a/Cargo.lock b/Cargo.lock index 3c6f8016..02acb355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,6 +145,12 @@ dependencies = [ "yansi", ] +[[package]] +name = "atomic-maybe-uninit" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a320ab39d3f29f95494ce06a1e5d86890eadb13e4438bfd3102b1f5566b299" + [[package]] name = "atty" version = "0.2.14" @@ -496,10 +502,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", + "crossbeam-deque 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-queue", - "crossbeam-utils", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -508,7 +514,7 @@ version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -517,8 +523,17 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.9.18 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "git+https://github.com/Pivot-Studio/crossbeam.git#6925a93dbd6db8b13173252b159a9dc83febbe3a" +dependencies = [ + "crossbeam-epoch 0.9.18 (git+https://github.com/Pivot-Studio/crossbeam.git)", + "crossbeam-utils 0.8.20 (git+https://github.com/Pivot-Studio/crossbeam.git)", ] [[package]] @@ -527,7 +542,15 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "git+https://github.com/Pivot-Studio/crossbeam.git#6925a93dbd6db8b13173252b159a9dc83febbe3a" +dependencies = [ + "crossbeam-utils 0.8.20 (git+https://github.com/Pivot-Studio/crossbeam.git)", ] [[package]] @@ -536,7 +559,7 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "crossbeam-utils", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -545,6 +568,14 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +[[package]] +name = "crossbeam-utils" +version = "0.8.20" +source = "git+https://github.com/Pivot-Studio/crossbeam.git#6925a93dbd6db8b13173252b159a9dc83febbe3a" +dependencies = [ + "atomic-maybe-uninit", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -558,7 +589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "804c8821570c3f8b70230c2ba75ffa5c0f9a4189b9a432b6656c536712acae28" dependencies = [ "cfg-if", - "crossbeam-utils", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", "hashbrown 0.14.5", "lock_api", "once_cell", @@ -858,7 +889,7 @@ dependencies = [ "backtrace", "cmake", "criterion", - "crossbeam-deque", + "crossbeam-deque 0.8.5 (git+https://github.com/Pivot-Studio/crossbeam.git)", "int-enum", "lazy_static", "libc", @@ -1617,8 +1648,8 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "crossbeam-deque 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8f1924a4..38ec8688 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,9 +98,9 @@ thread = ["threadpool"] members = ["internal_macro", "vm", "pl_linker", "immix", "kagari"] [profile.release] -lto = "thin" +lto = "fat" opt-level = 3 -debug = "line-tables-only" +# debug = "line-tables-only" [profile.bench] opt-level = 3 @@ -127,3 +127,8 @@ vergen = { version = "8.3.1", features = [ "rustc", "si", ] } + + +[profile.dev] +overflow-checks = false +debug-assertions = false \ No newline at end of file diff --git a/alloc.ll b/alloc.ll index e35b8e9f..19c0fa52 100644 --- a/alloc.ll +++ b/alloc.ll @@ -19,11 +19,19 @@ declare noalias void @DioGC__safepoint_ex( define noalias void @DioGC__safepoint( i64 %rsp) { - call void @DioGC__safepoint_ex(i64 %rsp, ptr @gc_handle) + %collector_ptr = load ptr, ptr @gc_handle, align 8, !invariant.load !0 + call void @DioGC__safepoint_ex(i64 %rsp, ptr %collector_ptr) ret void } +declare noalias void @gc_set_handle(ptr %handle) + +define void @gc_thread_init() { + call void @gc_set_handle(ptr @gc_handle) + ret void +} + declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) nounwind @@ -43,7 +51,7 @@ entry: br i1 %size_gt_7936, label %call_slowpath, label %check_collector check_collector: ; Load collector from gc_handle - %collector_ptr = load ptr, ptr @gc_handle, align 8 + %collector_ptr = load ptr, ptr @gc_handle, align 8, !invariant.load !0 ; Check if collector_ptr is null %is_null = icmp eq ptr %collector_ptr, null @@ -158,3 +166,4 @@ finish_fast_path_2: attributes #0 = { nounwind allockind("alloc") "gc-leaf-function" } +!0 = !{} \ No newline at end of file diff --git a/immix b/immix index 54039556..e8ee732b 160000 --- a/immix +++ b/immix @@ -1 +1 @@ -Subproject commit 54039556ba4e99edb101a1a1cab6b0ddccecdbdf +Subproject commit e8ee732bdfaeba9b122245573937fb27ab09f692 diff --git a/src/ast/ctx/cast.rs b/src/ast/ctx/cast.rs index bd219df0..35e72991 100644 --- a/src/ast/ctx/cast.rs +++ b/src/ast/ctx/cast.rs @@ -288,7 +288,9 @@ impl<'a, 'ctx> Ctx<'a> { if let PLType::Union(u) = &*target_pltype.borrow() { let mut union_members = vec![]; for tp in &u.sum_types { - let tp = tp.get_type(self, builder, true)?; + let tp = self.run_in_type_mod(u, |ctx,u|{ + tp.get_type(ctx, builder, true) + })?; union_members.push(tp); } for (i, tp) in union_members.iter().enumerate() {