Eliminate some obsolete upcalls.
This commit is contained in:
@@ -335,59 +335,6 @@ upcall_str_new_shared(const char *cstr, size_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct s_vec_grow_args {
|
|
||||||
rust_task *task;
|
|
||||||
rust_vec_box** vp;
|
|
||||||
size_t new_sz;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" CDECL void
|
|
||||||
upcall_s_vec_grow(s_vec_grow_args *args) {
|
|
||||||
rust_task *task = args->task;
|
|
||||||
LOG_UPCALL_ENTRY(task);
|
|
||||||
reserve_vec(task, args->vp, args->new_sz);
|
|
||||||
(*args->vp)->body.fill = args->new_sz;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL void
|
|
||||||
upcall_vec_grow(rust_vec_box** vp, size_t new_sz) {
|
|
||||||
rust_task *task = rust_get_current_task();
|
|
||||||
s_vec_grow_args args = {task, vp, new_sz};
|
|
||||||
UPCALL_SWITCH_STACK(task, &args, upcall_s_vec_grow);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct s_str_concat_args {
|
|
||||||
rust_task *task;
|
|
||||||
rust_vec_box* lhs;
|
|
||||||
rust_vec_box* rhs;
|
|
||||||
rust_vec_box* retval;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" CDECL void
|
|
||||||
upcall_s_str_concat(s_str_concat_args *args) {
|
|
||||||
rust_vec *lhs = &args->lhs->body;
|
|
||||||
rust_vec *rhs = &args->rhs->body;
|
|
||||||
rust_task *task = args->task;
|
|
||||||
size_t fill = lhs->fill + rhs->fill - 1;
|
|
||||||
rust_vec_box* v = (rust_vec_box*)
|
|
||||||
task->kernel->malloc(fill + sizeof(rust_vec_box),
|
|
||||||
"str_concat");
|
|
||||||
v->header.td = args->lhs->header.td;
|
|
||||||
v->body.fill = v->body.alloc = fill;
|
|
||||||
memmove(&v->body.data[0], &lhs->data[0], lhs->fill - 1);
|
|
||||||
memmove(&v->body.data[lhs->fill - 1], &rhs->data[0], rhs->fill);
|
|
||||||
args->retval = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern "C" CDECL rust_vec_box*
|
|
||||||
upcall_str_concat(rust_vec_box* lhs, rust_vec_box* rhs) {
|
|
||||||
rust_task *task = rust_get_current_task();
|
|
||||||
s_str_concat_args args = {task, lhs, rhs, 0};
|
|
||||||
UPCALL_SWITCH_STACK(task, &args, upcall_s_str_concat);
|
|
||||||
return args.retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" _Unwind_Reason_Code
|
extern "C" _Unwind_Reason_Code
|
||||||
__gxx_personality_v0(int version,
|
__gxx_personality_v0(int version,
|
||||||
_Unwind_Action actions,
|
_Unwind_Action actions,
|
||||||
|
|||||||
@@ -76,11 +76,8 @@ upcall_validate_box
|
|||||||
upcall_log_type
|
upcall_log_type
|
||||||
upcall_malloc
|
upcall_malloc
|
||||||
upcall_rust_personality
|
upcall_rust_personality
|
||||||
upcall_vec_grow
|
|
||||||
upcall_str_new
|
|
||||||
upcall_str_new_uniq
|
upcall_str_new_uniq
|
||||||
upcall_str_new_shared
|
upcall_str_new_shared
|
||||||
upcall_str_concat
|
|
||||||
upcall_call_shim_on_c_stack
|
upcall_call_shim_on_c_stack
|
||||||
upcall_call_shim_on_rust_stack
|
upcall_call_shim_on_rust_stack
|
||||||
upcall_new_stack
|
upcall_new_stack
|
||||||
|
|||||||
@@ -16,10 +16,8 @@ type upcalls =
|
|||||||
exchange_free: ValueRef,
|
exchange_free: ValueRef,
|
||||||
validate_box: ValueRef,
|
validate_box: ValueRef,
|
||||||
mark: ValueRef,
|
mark: ValueRef,
|
||||||
vec_grow: ValueRef,
|
|
||||||
str_new_uniq: ValueRef,
|
str_new_uniq: ValueRef,
|
||||||
str_new_shared: ValueRef,
|
str_new_shared: ValueRef,
|
||||||
str_concat: ValueRef,
|
|
||||||
cmp_type: ValueRef,
|
cmp_type: ValueRef,
|
||||||
log_type: ValueRef,
|
log_type: ValueRef,
|
||||||
alloc_c_stack: ValueRef,
|
alloc_c_stack: ValueRef,
|
||||||
@@ -71,18 +69,12 @@ fn declare_upcalls(targ_cfg: @session::config,
|
|||||||
nothrow(dv("validate_box", ~[T_ptr(T_i8())])),
|
nothrow(dv("validate_box", ~[T_ptr(T_i8())])),
|
||||||
mark:
|
mark:
|
||||||
d("mark", ~[T_ptr(T_i8())], int_t),
|
d("mark", ~[T_ptr(T_i8())], int_t),
|
||||||
vec_grow:
|
|
||||||
nothrow(dv("vec_grow", ~[T_ptr(T_ptr(T_i8())), int_t])),
|
|
||||||
str_new_uniq:
|
str_new_uniq:
|
||||||
nothrow(d("str_new_uniq", ~[T_ptr(T_i8()), int_t],
|
nothrow(d("str_new_uniq", ~[T_ptr(T_i8()), int_t],
|
||||||
T_ptr(T_i8()))),
|
T_ptr(T_i8()))),
|
||||||
str_new_shared:
|
str_new_shared:
|
||||||
nothrow(d("str_new_shared", ~[T_ptr(T_i8()), int_t],
|
nothrow(d("str_new_shared", ~[T_ptr(T_i8()), int_t],
|
||||||
T_ptr(T_i8()))),
|
T_ptr(T_i8()))),
|
||||||
str_concat:
|
|
||||||
nothrow(d("str_concat", ~[T_ptr(T_i8()),
|
|
||||||
T_ptr(T_i8())],
|
|
||||||
T_ptr(T_i8()))),
|
|
||||||
cmp_type:
|
cmp_type:
|
||||||
dv("cmp_type",
|
dv("cmp_type",
|
||||||
~[T_ptr(T_i1()), T_ptr(tydesc_type),
|
~[T_ptr(T_i1()), T_ptr(tydesc_type),
|
||||||
|
|||||||
Reference in New Issue
Block a user