Skip to content

Commit

Permalink
Rename edge to slot (#150)
Browse files Browse the repository at this point in the history
Parent PR: mmtk/mmtk-core#1134

---------

Co-authored-by: mmtkgc-bot <[email protected]>
  • Loading branch information
wks and mmtkgc-bot authored May 22, 2024
1 parent d1e42bd commit e776c41
Show file tree
Hide file tree
Showing 9 changed files with 179 additions and 176 deletions.
12 changes: 6 additions & 6 deletions julia/mmtk_julia.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ void scan_vm_specific_roots(RootsWorkClosure* closure)
(closure->report_tpinned_nodes_func)(tpinned_buf.ptr, tpinned_len, tpinned_buf.cap, closure->data, false);
}

JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessEdgeFn process_edge) {
JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessSlotFn process_slot) {
jl_task_t *ta = (jl_task_t*)obj_raw;

if (ta->excstack) { // inlining label `excstack` from mark_loop
// if it is not managed by MMTk, nothing needs to be done because the object does not need to be scanned
if (mmtk_object_is_managed_by_mmtk(ta->excstack)) {
process_edge(closure, &ta->excstack);
process_slot(closure, &ta->excstack);
}
jl_excstack_t *excstack = ta->excstack;
size_t itr = ta->excstack->top;
Expand All @@ -353,20 +353,20 @@ JL_DLLEXPORT void scan_julia_exc_obj(void* obj_raw, void* closure, ProcessEdgeFn
// GC-managed values inside.
size_t njlvals = jl_bt_num_jlvals(bt_entry);
while (jlval_index < njlvals) {
jl_value_t** new_obj_edge = &bt_entry[2 + jlval_index].jlvalue;
jl_value_t** new_obj_slot = &bt_entry[2 + jlval_index].jlvalue;
jlval_index += 1;
process_edge(closure, new_obj_edge);
process_slot(closure, new_obj_slot);
}
jlval_index = 0;
}

jl_bt_element_t *stack_raw = (jl_bt_element_t *)(excstack+1);
jl_value_t** stack_obj_edge = &stack_raw[itr-1].jlvalue;
jl_value_t** stack_obj_slot = &stack_raw[itr-1].jlvalue;

itr = jl_excstack_next(excstack, itr);
bt_index = 0;
jlval_index = 0;
process_edge(closure, stack_obj_edge);
process_slot(closure, stack_obj_slot);
}
}
}
Expand Down
105 changes: 56 additions & 49 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ lazy_static = "1.1"
# - change branch
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "fea59e4f5cc6176093da1d8efa7d7b3b4b8d0fa7" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "56b2521d2b99848ee0613a0a5288fe6d81b754ba" }
# Uncomment the following to build locally
# mmtk = { path = "../repos/mmtk-core" }
log = {version = "0.4", features = ["max_level_trace", "release_max_level_off"] }
Expand Down
8 changes: 4 additions & 4 deletions mmtk/api/mmtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ extern "C" {

typedef void* MMTk_Mutator;
typedef void* MMTk_TraceLocal;
typedef void (*ProcessEdgeFn)(void* closure, void* slot);
typedef void (*ProcessOffsetEdgeFn)(void* closure, void* slot, int offset);
typedef void (*ProcessSlotFn)(void* closure, void* slot);
typedef void (*ProcessOffsetSlotFn)(void* closure, void* slot, int offset);

typedef struct {
void** ptr;
size_t cap;
} RootsWorkBuffer;

typedef struct {
RootsWorkBuffer (*report_edges_func)(void** buf, size_t size, size_t cap, void* data, bool renew);
RootsWorkBuffer (*report_slots_func)(void** buf, size_t size, size_t cap, void* data, bool renew);
RootsWorkBuffer (*report_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew);
RootsWorkBuffer (*report_tpinned_nodes_func)(void** buf, size_t size, size_t cap, void* data, bool renew);
void* data;
Expand Down Expand Up @@ -70,7 +70,7 @@ extern uintptr_t JULIA_MALLOC_BYTES;
// * int is 4 bytes
// * size_t is 8 bytes
typedef struct {
void (* scan_julia_exc_obj) (void* obj, void* closure, ProcessEdgeFn process_edge);
void (* scan_julia_exc_obj) (void* obj, void* closure, ProcessSlotFn process_slot);
void* (* get_stackbase) (int16_t tid);
void (* mmtk_jl_run_finalizers) (void* tls);
void (* jl_throw_out_of_memory_error) (void);
Expand Down
Loading

0 comments on commit e776c41

Please sign in to comment.