Skip to content

Get rid of old vec_append glue. #505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion mk/rt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUNTIME_CS := rt/sync/timer.cpp \
rt/test/rust_test_util.cpp \
rt/arch/i386/context.cpp \

RUNTIME_LL := rt/vec_append.ll
RUNTIME_LL :=

RUNTIME_S := rt/arch/i386/_context.s

Expand Down
4 changes: 0 additions & 4 deletions src/comp/back/upcall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ type upcalls =
ValueRef mark,
ValueRef new_str,
ValueRef new_vec,
ValueRef vec_grow,
ValueRef vec_append,
ValueRef get_type_desc,
ValueRef new_task,
Expand Down Expand Up @@ -106,9 +105,6 @@ fn declare_upcalls(type_names tn, ModuleRef llmod) -> @upcalls {
T_ptr(T_str())),
new_vec=d("new_vec", [T_size_t(), T_ptr(T_tydesc(tn))],
T_opaque_vec_ptr()),
vec_grow=d("vec_grow",
[T_opaque_vec_ptr(), T_size_t(), T_ptr(T_int()),
T_ptr(T_tydesc(tn))], T_opaque_vec_ptr()),
vec_append=d("vec_append",
[T_ptr(T_tydesc(tn)), T_ptr(T_tydesc(tn)),
T_ptr(T_opaque_vec_ptr()), T_opaque_vec_ptr(),
Expand Down
18 changes: 8 additions & 10 deletions src/rt/rust_upcall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,17 +370,16 @@ upcall_new_vec(rust_task *task, size_t fill, type_desc *td) {
return v;
}

extern "C" CDECL rust_vec *
upcall_vec_grow(rust_task *task,
rust_vec *v,
size_t n_bytes,
uintptr_t *need_copy,
type_desc *td)
static rust_vec *
vec_grow(rust_task *task,
rust_vec *v,
size_t n_bytes,
uintptr_t *need_copy,
type_desc *td)
{
LOG_UPCALL_ENTRY(task);
rust_dom *dom = task->dom;
LOG(task, mem,
"upcall vec_grow(0x%" PRIxPTR ", %" PRIdPTR
"vec_grow(0x%" PRIxPTR ", %" PRIdPTR
"), rc=%" PRIdPTR " alloc=%" PRIdPTR ", fill=%" PRIdPTR
", need_copy=0x%" PRIxPTR,
v, n_bytes, v->ref_count, v->alloc, v->fill, need_copy);
Expand Down Expand Up @@ -465,8 +464,7 @@ upcall_vec_append(rust_task *task, type_desc *t, type_desc *elem_t,
uintptr_t need_copy;
size_t n_src_bytes = skip_null ? src->fill - 1 : src->fill;
size_t n_dst_bytes = skip_null ? dst->fill - 1 : dst->fill;
rust_vec *new_vec = upcall_vec_grow(task, dst, n_src_bytes,
&need_copy, t);
rust_vec *new_vec = vec_grow(task, dst, n_src_bytes, &need_copy, t);

if (need_copy) {
// Copy any dst elements in, omitting null if doing str.
Expand Down
2 changes: 0 additions & 2 deletions src/rt/rustrt.def.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ rust_process_wait
rust_ptr_eq
rust_run_program
rust_start
rust_vec_append_glue
size_of
squareroot
str_alloc
Expand Down Expand Up @@ -72,7 +71,6 @@ upcall_start_task
upcall_start_thread
upcall_trace_str
upcall_trace_word
upcall_vec_grow
upcall_vec_append
upcall_yield
vec_alloc
Expand Down