Skip to content

Commit ec17739

Browse files
authored
Remove some code (#37)
Merge only with mmtk/julia#5. - Correct prototype for `run_finalizer`. - Remove `jl_mmtk_gc_alloc_default_llvm`, no longer needed. - Remove calls to `gc_time_mallocd_array_*`, only needed with `GC_TIME`. - Remove call to `verify_parent1`, only needed with `GC_VERIFY`.
1 parent c97d03b commit ec17739

File tree

6 files changed

+6
-37
lines changed

6 files changed

+6
-37
lines changed

.github/scripts/Make.user

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
USE_MMTK=1
1+
WITH_MMTK=1

.github/scripts/ci-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [ "$build_type" == "release" ]; then
2020
build_args=$build_args" --release"
2121
fi
2222

23-
cd $MMTK_JULIA_DIR
23+
cd $MMTK_JULIA_DIR/mmtk
2424
cargo build --features immix $build_args
2525

2626
cd $JULIA_PATH

.github/scripts/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUSTUP_TOOLCHAIN=`cat $BINDING_PATH/mmtk/rust-toolchain`
55
JULIA_TEST_ARGS='--check-bounds=yes --startup-file=no --depwarn=error'
66

77
# Julia binding requires these
8-
export MMTK_JULIA_DIR=$BINDING_PATH/mmtk
8+
export MMTK_JULIA_DIR=$BINDING_PATH
99

1010
# Make sure we have enough heap to build Julia
1111
export MMTK_MIN_HSIZE_G=0.5

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To build Julia with MMTk, create a `Make.user` file in the top-level directory o
1919

2020
```
2121
export MMTK_BUILD=release # or debug depending on how you build the Rust binding
22-
export MMTK_JULIA_DIR=<path-to-mmtk-julia>/mmtk
22+
export MMTK_JULIA_DIR=<path-to-mmtk-julia>
2323
```
2424

2525
Before building Julia, build the Rust binding in `mmtk-julia/mmtk`. Note that we currently support either immix or marksweep implementations in mmtk-core (build it with `cargo build --features immix # or marksweep`). To build Julia, navigate to `/vm/julia` and run `make` (or `make debug`). Please also make sure to install any dependency considering any particular requirement from both [Julia](https://github.com/JuliaLang/julia/blob/master/doc/src/devdocs/build/build.md#required-build-tools-and-external-libraries) and [MMTk](https://github.com/mmtk/mmtk-core#requirements).

julia/mmtk_julia.c

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "gc.h"
66

77
extern int64_t perm_scanned_bytes;
8-
extern void run_finalizer(jl_task_t *ct, jl_value_t *o, jl_value_t *ff);
8+
extern void run_finalizer(jl_task_t *ct, void *o, void *ff);
99
extern int gc_n_threads;
1010
extern jl_ptls_t* gc_all_tls_states;
1111
extern jl_ptls_t get_next_mutator_tls(void);
@@ -34,31 +34,6 @@ JL_DLLEXPORT void (jl_mmtk_harness_end)(void)
3434
harness_end();
3535
}
3636

37-
JL_DLLEXPORT jl_value_t *jl_mmtk_gc_alloc_default_llvm(jl_ptls_t ptls, int pool_offset, int osize)
38-
{
39-
// safepoint
40-
jl_gc_safepoint();
41-
42-
jl_value_t *v;
43-
44-
// ptls->mmtk_mutator_ptr->allocators.immix[0].cursor = ptls->cursor;
45-
46-
// v needs to be 16 byte aligned, therefore v_tagged needs to be offset accordingly to consider the size of header
47-
jl_taggedvalue_t *v_tagged =
48-
(jl_taggedvalue_t *) alloc(ptls->mmtk_mutator_ptr, osize, 16, 8, 0);
49-
50-
// ptls->cursor = ptls->mmtk_mutator_ptr->allocators.immix[0].cursor;
51-
// ptls->limit = ptls->mmtk_mutator_ptr->allocators.immix[0].limit;
52-
53-
v = jl_valueof(v_tagged);
54-
55-
post_alloc(ptls->mmtk_mutator_ptr, v, osize, 0);
56-
ptls->gc_num.allocd += osize;
57-
ptls->gc_num.poolalloc++;
58-
59-
return v;
60-
}
61-
6237
STATIC_INLINE void* alloc_default_object(jl_ptls_t ptls, size_t size, int offset) {
6338
int64_t delta = (-offset -(int64_t)(ptls->cursor)) & 15; // aligned to 16
6439
uint64_t aligned_addr = (uint64_t)ptls->cursor + delta;
@@ -137,7 +112,6 @@ JL_DLLEXPORT jl_value_t *jl_mmtk_gc_alloc_big(jl_ptls_t ptls, size_t sz)
137112

138113
static void mmtk_sweep_malloced_arrays(void) JL_NOTSAFEPOINT
139114
{
140-
gc_time_mallocd_array_start();
141115
reset_count_tls();
142116
jl_ptls_t ptls2 = (jl_ptls_t) get_next_mutator_tls();
143117
while(ptls2 != NULL) {
@@ -164,7 +138,6 @@ static void mmtk_sweep_malloced_arrays(void) JL_NOTSAFEPOINT
164138
}
165139
ptls2 = get_next_mutator_tls();
166140
}
167-
gc_time_mallocd_array_end();
168141
gc_sweep_sysimg();
169142
}
170143

@@ -759,10 +732,6 @@ JL_DLLEXPORT void scan_julia_obj(jl_value_t* obj, closure_pointer closure, Proce
759732
continue;
760733

761734
process_edge(closure, begin);
762-
763-
void *vb = jl_astaggedvalue(b);
764-
verify_parent1("module", binding->parent, &vb, "binding_buff");
765-
(void)vb;
766735
}
767736

768737
process_edge(closure, &m->parent);

mmtk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2018"
1010
[package.metadata.julia]
1111
# Our CI matches the following line and extract mmtk/julia. If this line is updated, please check ci yaml files and make sure it works.
1212
julia_repo = "https://github.com/mmtk/julia.git"
13-
julia_version = "54ca78ad9ca9e2795c6356588ed50039f2d1b23b"
13+
julia_version = "72a275233012a80dfd5c5ac1c83afdf9aff0a87a"
1414

1515
[lib]
1616
crate-type = ["staticlib", "rlib", "dylib"]

0 commit comments

Comments
 (0)