JIT: faster path for `vector-{ref,set!}' on chaperone/impersonator
This commit probably should be removed from the v5.1.2 branch (after the branch is created).
This commit is contained in:
parent
97d5e3fa02
commit
a81917a269
|
@ -175,6 +175,7 @@
|
|||
n_s
|
||||
_s
|
||||
ss_s
|
||||
ssi_s
|
||||
tt_s
|
||||
ss_m
|
||||
Sl_s
|
||||
|
|
|
@ -219,6 +219,7 @@ struct scheme_jit_common_record {
|
|||
void *bad_flvector_length_code;
|
||||
void *bad_fxvector_length_code;
|
||||
void *vector_ref_code, *vector_ref_check_index_code, *vector_set_code, *vector_set_check_index_code;
|
||||
void *chap_vector_ref_code, *chap_vector_ref_check_index_code, *chap_vector_set_code, *chap_vector_set_check_index_code;
|
||||
void *string_ref_code, *string_ref_check_index_code, *string_set_code, *string_set_check_index_code;
|
||||
void *bytes_ref_code, *bytes_ref_check_index_code, *bytes_set_code, *bytes_set_check_index_code;
|
||||
void *flvector_ref_check_index_code, *flvector_set_check_index_code, *flvector_set_flonum_check_index_code;
|
||||
|
@ -1084,6 +1085,7 @@ double *scheme_mz_retain_double(mz_jit_state *jitter, double d);
|
|||
int scheme_mz_remap_it(mz_jit_state *jitter, int i);
|
||||
void scheme_mz_pushr_p_it(mz_jit_state *jitter, int reg);
|
||||
void scheme_mz_popr_p_it(mz_jit_state *jitter, int reg, int discard);
|
||||
void scheme_mz_need_space(mz_jit_state *jitter, int need_extra);
|
||||
int scheme_stack_safety(mz_jit_state *jitter, int cnt, int offset);
|
||||
#ifdef USE_FLONUM_UNBOXING
|
||||
int scheme_mz_flonum_pos(mz_jit_state *jitter, int i);
|
||||
|
|
|
@ -83,6 +83,7 @@ define_ts_si_s(scheme_struct_ref, FSRC_MARKS)
|
|||
define_ts_sis_v(scheme_struct_set, FSRC_MARKS)
|
||||
define_ts_iS_s(scheme_extract_checked_procedure, FSRC_MARKS)
|
||||
define_ts_iS_s(scheme_procedure_arity_includes, FSRC_MARKS)
|
||||
define_ts_ssi_s(vector_check_chaperone_of, FSRC_OTHER)
|
||||
#endif
|
||||
|
||||
#ifdef JITCALL_TS_PROCS
|
||||
|
@ -195,4 +196,5 @@ define_ts_s_s(scheme_box, FSRC_OTHER)
|
|||
# define ts_apply_checked_fail apply_checked_fail
|
||||
# define ts_scheme_build_list_offset scheme_build_list_offset
|
||||
# define ts_wrong_argument_count wrong_argument_count
|
||||
# define ts_vector_check_chaperone_of vector_check_chaperone_of
|
||||
#endif
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
#define define_ts_siS_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g7, int g8, Scheme_Object** g9) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g4, int g5, Scheme_Object** g6) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_siS_s("[" #id "]", src_type, id, g7, g8, g9); \
|
||||
return scheme_rtcall_siS_s("[" #id "]", src_type, id, g4, g5, g6); \
|
||||
else \
|
||||
return id(g4, g5, g6); \
|
||||
}
|
||||
#define define_ts_iSs_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(int g7, Scheme_Object** g8, Scheme_Object* g9) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_iSs_s("[" #id "]", src_type, id, g7, g8, g9); \
|
||||
else \
|
||||
return id(g7, g8, g9); \
|
||||
}
|
||||
#define define_ts_iSs_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(int g10, Scheme_Object** g11, Scheme_Object* g12) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_iSs_s("[" #id "]", src_type, id, g10, g11, g12); \
|
||||
else \
|
||||
return id(g10, g11, g12); \
|
||||
}
|
||||
#define define_ts_s_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g13) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g10) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_s_s("[" #id "]", src_type, id, g13); \
|
||||
return scheme_rtcall_s_s("[" #id "]", src_type, id, g10); \
|
||||
else \
|
||||
return id(g13); \
|
||||
return id(g10); \
|
||||
}
|
||||
#define define_ts_n_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Native_Closure_Data* g14) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Native_Closure_Data* g11) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_n_s("[" #id "]", src_type, id, g14); \
|
||||
return scheme_rtcall_n_s("[" #id "]", src_type, id, g11); \
|
||||
else \
|
||||
return id(g14); \
|
||||
return id(g11); \
|
||||
}
|
||||
#define define_ts__s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id() \
|
||||
|
@ -44,13 +44,22 @@ static Scheme_Object* ts_ ## id() \
|
|||
return id(); \
|
||||
}
|
||||
#define define_ts_ss_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g15, Scheme_Object* g16) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g12, Scheme_Object* g13) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_ss_s("[" #id "]", src_type, id, g15, g16); \
|
||||
return scheme_rtcall_ss_s("[" #id "]", src_type, id, g12, g13); \
|
||||
else \
|
||||
return id(g15, g16); \
|
||||
return id(g12, g13); \
|
||||
}
|
||||
#define define_ts_ssi_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(Scheme_Object* g14, Scheme_Object* g15, int g16) \
|
||||
XFORM_SKIP_PROC \
|
||||
{ \
|
||||
if (scheme_use_rtcall) \
|
||||
return scheme_rtcall_ssi_s("[" #id "]", src_type, id, g14, g15, g16); \
|
||||
else \
|
||||
return id(g14, g15, g16); \
|
||||
}
|
||||
#define define_ts_tt_s(id, src_type) \
|
||||
static Scheme_Object* ts_ ## id(const Scheme_Object* g17, const Scheme_Object* g18) \
|
||||
|
|
|
@ -147,7 +147,33 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_tt_s(const char *who, int src_type, prim_tt_s f, const Scheme_Object* g63, const Scheme_Object* g64)
|
||||
Scheme_Object* scheme_rtcall_ssi_s(const char *who, int src_type, prim_ssi_s f, Scheme_Object* g63, Scheme_Object* g64, int g65)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
future_t *future;
|
||||
double tm;
|
||||
Scheme_Object* retval;
|
||||
|
||||
future = fts->thread->current_ft;
|
||||
future->prim_protocol = SIG_ssi_s;
|
||||
future->prim_func = f;
|
||||
tm = get_future_timestamp();
|
||||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g63;
|
||||
future->arg_s1 = g64;
|
||||
future->arg_i2 = g65;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
retval = future->retval_s;
|
||||
future->retval_s = 0;
|
||||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_tt_s(const char *who, int src_type, prim_tt_s f, const Scheme_Object* g66, const Scheme_Object* g67)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -162,8 +188,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_t0 = g63;
|
||||
future->arg_t1 = g64;
|
||||
future->arg_t0 = g66;
|
||||
future->arg_t1 = g67;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -172,7 +198,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
MZ_MARK_STACK_TYPE scheme_rtcall_ss_m(const char *who, int src_type, prim_ss_m f, Scheme_Object* g65, Scheme_Object* g66)
|
||||
MZ_MARK_STACK_TYPE scheme_rtcall_ss_m(const char *who, int src_type, prim_ss_m f, Scheme_Object* g68, Scheme_Object* g69)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -187,8 +213,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g65;
|
||||
future->arg_s1 = g66;
|
||||
future->arg_s0 = g68;
|
||||
future->arg_s1 = g69;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -197,7 +223,7 @@
|
|||
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_Sl_s(const char *who, int src_type, prim_Sl_s f, Scheme_Object** g67, intptr_t g68)
|
||||
Scheme_Object* scheme_rtcall_Sl_s(const char *who, int src_type, prim_Sl_s f, Scheme_Object** g70, intptr_t g71)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -212,8 +238,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_S0 = g67;
|
||||
future->arg_l1 = g68;
|
||||
future->arg_S0 = g70;
|
||||
future->arg_l1 = g71;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -222,7 +248,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_l_s(const char *who, int src_type, prim_l_s f, intptr_t g69)
|
||||
Scheme_Object* scheme_rtcall_l_s(const char *who, int src_type, prim_l_s f, intptr_t g72)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -237,7 +263,7 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_l0 = g69;
|
||||
future->arg_l0 = g72;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -246,7 +272,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
void scheme_rtcall_bsi_v(const char *who, int src_type, prim_bsi_v f, Scheme_Bucket* g70, Scheme_Object* g71, int g72)
|
||||
void scheme_rtcall_bsi_v(const char *who, int src_type, prim_bsi_v f, Scheme_Bucket* g73, Scheme_Object* g74, int g75)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -261,9 +287,9 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_b0 = g70;
|
||||
future->arg_s1 = g71;
|
||||
future->arg_i2 = g72;
|
||||
future->arg_b0 = g73;
|
||||
future->arg_s1 = g74;
|
||||
future->arg_i2 = g75;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -272,7 +298,7 @@
|
|||
|
||||
|
||||
}
|
||||
void scheme_rtcall_iiS_v(const char *who, int src_type, prim_iiS_v f, int g73, int g74, Scheme_Object** g75)
|
||||
void scheme_rtcall_iiS_v(const char *who, int src_type, prim_iiS_v f, int g76, int g77, Scheme_Object** g78)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -287,9 +313,9 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_i0 = g73;
|
||||
future->arg_i1 = g74;
|
||||
future->arg_S2 = g75;
|
||||
future->arg_i0 = g76;
|
||||
future->arg_i1 = g77;
|
||||
future->arg_S2 = g78;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -298,7 +324,7 @@
|
|||
|
||||
|
||||
}
|
||||
void scheme_rtcall_ss_v(const char *who, int src_type, prim_ss_v f, Scheme_Object* g76, Scheme_Object* g77)
|
||||
void scheme_rtcall_ss_v(const char *who, int src_type, prim_ss_v f, Scheme_Object* g79, Scheme_Object* g80)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -313,8 +339,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g76;
|
||||
future->arg_s1 = g77;
|
||||
future->arg_s0 = g79;
|
||||
future->arg_s1 = g80;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -323,7 +349,7 @@
|
|||
|
||||
|
||||
}
|
||||
void scheme_rtcall_b_v(const char *who, int src_type, prim_b_v f, Scheme_Bucket* g78)
|
||||
void scheme_rtcall_b_v(const char *who, int src_type, prim_b_v f, Scheme_Bucket* g81)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -338,7 +364,7 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_b0 = g78;
|
||||
future->arg_b0 = g81;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -347,7 +373,7 @@
|
|||
|
||||
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_sl_s(const char *who, int src_type, prim_sl_s f, Scheme_Object* g79, intptr_t g80)
|
||||
Scheme_Object* scheme_rtcall_sl_s(const char *who, int src_type, prim_sl_s f, Scheme_Object* g82, intptr_t g83)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -362,8 +388,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g79;
|
||||
future->arg_l1 = g80;
|
||||
future->arg_s0 = g82;
|
||||
future->arg_l1 = g83;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -372,7 +398,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_iS_s(const char *who, int src_type, prim_iS_s f, int g81, Scheme_Object** g82)
|
||||
Scheme_Object* scheme_rtcall_iS_s(const char *who, int src_type, prim_iS_s f, int g84, Scheme_Object** g85)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -387,8 +413,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_i0 = g81;
|
||||
future->arg_S1 = g82;
|
||||
future->arg_i0 = g84;
|
||||
future->arg_S1 = g85;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -397,7 +423,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_S_s(const char *who, int src_type, prim_S_s f, Scheme_Object** g83)
|
||||
Scheme_Object* scheme_rtcall_S_s(const char *who, int src_type, prim_S_s f, Scheme_Object** g86)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -412,7 +438,7 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_S0 = g83;
|
||||
future->arg_S0 = g86;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -421,7 +447,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
void scheme_rtcall_s_v(const char *who, int src_type, prim_s_v f, Scheme_Object* g84)
|
||||
void scheme_rtcall_s_v(const char *who, int src_type, prim_s_v f, Scheme_Object* g87)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -436,8 +462,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g84;
|
||||
send_special_result(future, g84);
|
||||
future->arg_s0 = g87;
|
||||
send_special_result(future, g87);
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
||||
|
@ -445,7 +471,7 @@
|
|||
|
||||
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_iSi_s(const char *who, int src_type, prim_iSi_s f, int g85, Scheme_Object** g86, int g87)
|
||||
Scheme_Object* scheme_rtcall_iSi_s(const char *who, int src_type, prim_iSi_s f, int g88, Scheme_Object** g89, int g90)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -460,9 +486,9 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_i0 = g85;
|
||||
future->arg_S1 = g86;
|
||||
future->arg_i2 = g87;
|
||||
future->arg_i0 = g88;
|
||||
future->arg_S1 = g89;
|
||||
future->arg_i2 = g90;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -471,7 +497,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
void scheme_rtcall_siS_v(const char *who, int src_type, prim_siS_v f, Scheme_Object* g88, int g89, Scheme_Object** g90)
|
||||
void scheme_rtcall_siS_v(const char *who, int src_type, prim_siS_v f, Scheme_Object* g91, int g92, Scheme_Object** g93)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -486,9 +512,9 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g88;
|
||||
future->arg_i1 = g89;
|
||||
future->arg_S2 = g90;
|
||||
future->arg_s0 = g91;
|
||||
future->arg_i1 = g92;
|
||||
future->arg_S2 = g93;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -497,7 +523,7 @@
|
|||
|
||||
|
||||
}
|
||||
void* scheme_rtcall_z_p(const char *who, int src_type, prim_z_p f, size_t g91)
|
||||
void* scheme_rtcall_z_p(const char *who, int src_type, prim_z_p f, size_t g94)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -512,7 +538,7 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_z0 = g91;
|
||||
future->arg_z0 = g94;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -521,7 +547,7 @@
|
|||
|
||||
return retval;
|
||||
}
|
||||
Scheme_Object* scheme_rtcall_si_s(const char *who, int src_type, prim_si_s f, Scheme_Object* g92, int g93)
|
||||
Scheme_Object* scheme_rtcall_si_s(const char *who, int src_type, prim_si_s f, Scheme_Object* g95, int g96)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -536,8 +562,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g92;
|
||||
future->arg_i1 = g93;
|
||||
future->arg_s0 = g95;
|
||||
future->arg_i1 = g96;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -546,7 +572,7 @@
|
|||
receive_special_result(future, retval, 1);
|
||||
return retval;
|
||||
}
|
||||
void scheme_rtcall_sis_v(const char *who, int src_type, prim_sis_v f, Scheme_Object* g94, int g95, Scheme_Object* g96)
|
||||
void scheme_rtcall_sis_v(const char *who, int src_type, prim_sis_v f, Scheme_Object* g97, int g98, Scheme_Object* g99)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -561,9 +587,9 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g94;
|
||||
future->arg_i1 = g95;
|
||||
future->arg_s2 = g96;
|
||||
future->arg_s0 = g97;
|
||||
future->arg_i1 = g98;
|
||||
future->arg_s2 = g99;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
@ -572,7 +598,7 @@
|
|||
|
||||
|
||||
}
|
||||
int scheme_rtcall_ss_i(const char *who, int src_type, prim_ss_i f, Scheme_Object* g97, Scheme_Object* g98)
|
||||
int scheme_rtcall_ss_i(const char *who, int src_type, prim_ss_i f, Scheme_Object* g100, Scheme_Object* g101)
|
||||
XFORM_SKIP_PROC
|
||||
{
|
||||
Scheme_Future_Thread_State *fts = scheme_future_thread_state;
|
||||
|
@ -587,8 +613,8 @@
|
|||
future->time_of_request = tm;
|
||||
future->source_of_request = who;
|
||||
future->source_type = src_type;
|
||||
future->arg_s0 = g97;
|
||||
future->arg_s1 = g98;
|
||||
future->arg_s0 = g100;
|
||||
future->arg_s1 = g101;
|
||||
|
||||
future_do_runtimecall(fts, (void*)f, 0, 1);
|
||||
future = fts->thread->current_ft;
|
||||
|
|
|
@ -1,72 +1,75 @@
|
|||
#define SIG_siS_s 10
|
||||
typedef Scheme_Object* (*prim_siS_s)(Scheme_Object*, int, Scheme_Object**);
|
||||
Scheme_Object* scheme_rtcall_siS_s(const char *who, int src_type, prim_siS_s f, Scheme_Object* g145, int g146, Scheme_Object** g147);
|
||||
Scheme_Object* scheme_rtcall_siS_s(const char *who, int src_type, prim_siS_s f, Scheme_Object* g151, int g152, Scheme_Object** g153);
|
||||
#define SIG_iSs_s 11
|
||||
typedef Scheme_Object* (*prim_iSs_s)(int, Scheme_Object**, Scheme_Object*);
|
||||
Scheme_Object* scheme_rtcall_iSs_s(const char *who, int src_type, prim_iSs_s f, int g148, Scheme_Object** g149, Scheme_Object* g150);
|
||||
Scheme_Object* scheme_rtcall_iSs_s(const char *who, int src_type, prim_iSs_s f, int g154, Scheme_Object** g155, Scheme_Object* g156);
|
||||
#define SIG_s_s 12
|
||||
typedef Scheme_Object* (*prim_s_s)(Scheme_Object*);
|
||||
Scheme_Object* scheme_rtcall_s_s(const char *who, int src_type, prim_s_s f, Scheme_Object* g151);
|
||||
Scheme_Object* scheme_rtcall_s_s(const char *who, int src_type, prim_s_s f, Scheme_Object* g157);
|
||||
#define SIG_n_s 13
|
||||
typedef Scheme_Object* (*prim_n_s)(Scheme_Native_Closure_Data*);
|
||||
Scheme_Object* scheme_rtcall_n_s(const char *who, int src_type, prim_n_s f, Scheme_Native_Closure_Data* g152);
|
||||
Scheme_Object* scheme_rtcall_n_s(const char *who, int src_type, prim_n_s f, Scheme_Native_Closure_Data* g158);
|
||||
#define SIG__s 14
|
||||
typedef Scheme_Object* (*prim__s)();
|
||||
Scheme_Object* scheme_rtcall__s(const char *who, int src_type, prim__s f );
|
||||
#define SIG_ss_s 15
|
||||
typedef Scheme_Object* (*prim_ss_s)(Scheme_Object*, Scheme_Object*);
|
||||
Scheme_Object* scheme_rtcall_ss_s(const char *who, int src_type, prim_ss_s f, Scheme_Object* g153, Scheme_Object* g154);
|
||||
#define SIG_tt_s 16
|
||||
Scheme_Object* scheme_rtcall_ss_s(const char *who, int src_type, prim_ss_s f, Scheme_Object* g159, Scheme_Object* g160);
|
||||
#define SIG_ssi_s 16
|
||||
typedef Scheme_Object* (*prim_ssi_s)(Scheme_Object*, Scheme_Object*, int);
|
||||
Scheme_Object* scheme_rtcall_ssi_s(const char *who, int src_type, prim_ssi_s f, Scheme_Object* g161, Scheme_Object* g162, int g163);
|
||||
#define SIG_tt_s 17
|
||||
typedef Scheme_Object* (*prim_tt_s)(const Scheme_Object*, const Scheme_Object*);
|
||||
Scheme_Object* scheme_rtcall_tt_s(const char *who, int src_type, prim_tt_s f, const Scheme_Object* g155, const Scheme_Object* g156);
|
||||
#define SIG_ss_m 17
|
||||
Scheme_Object* scheme_rtcall_tt_s(const char *who, int src_type, prim_tt_s f, const Scheme_Object* g164, const Scheme_Object* g165);
|
||||
#define SIG_ss_m 18
|
||||
typedef MZ_MARK_STACK_TYPE (*prim_ss_m)(Scheme_Object*, Scheme_Object*);
|
||||
MZ_MARK_STACK_TYPE scheme_rtcall_ss_m(const char *who, int src_type, prim_ss_m f, Scheme_Object* g157, Scheme_Object* g158);
|
||||
#define SIG_Sl_s 18
|
||||
MZ_MARK_STACK_TYPE scheme_rtcall_ss_m(const char *who, int src_type, prim_ss_m f, Scheme_Object* g166, Scheme_Object* g167);
|
||||
#define SIG_Sl_s 19
|
||||
typedef Scheme_Object* (*prim_Sl_s)(Scheme_Object**, intptr_t);
|
||||
Scheme_Object* scheme_rtcall_Sl_s(const char *who, int src_type, prim_Sl_s f, Scheme_Object** g159, intptr_t g160);
|
||||
#define SIG_l_s 19
|
||||
Scheme_Object* scheme_rtcall_Sl_s(const char *who, int src_type, prim_Sl_s f, Scheme_Object** g168, intptr_t g169);
|
||||
#define SIG_l_s 20
|
||||
typedef Scheme_Object* (*prim_l_s)(intptr_t);
|
||||
Scheme_Object* scheme_rtcall_l_s(const char *who, int src_type, prim_l_s f, intptr_t g161);
|
||||
#define SIG_bsi_v 20
|
||||
Scheme_Object* scheme_rtcall_l_s(const char *who, int src_type, prim_l_s f, intptr_t g170);
|
||||
#define SIG_bsi_v 21
|
||||
typedef void (*prim_bsi_v)(Scheme_Bucket*, Scheme_Object*, int);
|
||||
void scheme_rtcall_bsi_v(const char *who, int src_type, prim_bsi_v f, Scheme_Bucket* g162, Scheme_Object* g163, int g164);
|
||||
#define SIG_iiS_v 21
|
||||
void scheme_rtcall_bsi_v(const char *who, int src_type, prim_bsi_v f, Scheme_Bucket* g171, Scheme_Object* g172, int g173);
|
||||
#define SIG_iiS_v 22
|
||||
typedef void (*prim_iiS_v)(int, int, Scheme_Object**);
|
||||
void scheme_rtcall_iiS_v(const char *who, int src_type, prim_iiS_v f, int g165, int g166, Scheme_Object** g167);
|
||||
#define SIG_ss_v 22
|
||||
void scheme_rtcall_iiS_v(const char *who, int src_type, prim_iiS_v f, int g174, int g175, Scheme_Object** g176);
|
||||
#define SIG_ss_v 23
|
||||
typedef void (*prim_ss_v)(Scheme_Object*, Scheme_Object*);
|
||||
void scheme_rtcall_ss_v(const char *who, int src_type, prim_ss_v f, Scheme_Object* g168, Scheme_Object* g169);
|
||||
#define SIG_b_v 23
|
||||
void scheme_rtcall_ss_v(const char *who, int src_type, prim_ss_v f, Scheme_Object* g177, Scheme_Object* g178);
|
||||
#define SIG_b_v 24
|
||||
typedef void (*prim_b_v)(Scheme_Bucket*);
|
||||
void scheme_rtcall_b_v(const char *who, int src_type, prim_b_v f, Scheme_Bucket* g170);
|
||||
#define SIG_sl_s 24
|
||||
void scheme_rtcall_b_v(const char *who, int src_type, prim_b_v f, Scheme_Bucket* g179);
|
||||
#define SIG_sl_s 25
|
||||
typedef Scheme_Object* (*prim_sl_s)(Scheme_Object*, intptr_t);
|
||||
Scheme_Object* scheme_rtcall_sl_s(const char *who, int src_type, prim_sl_s f, Scheme_Object* g171, intptr_t g172);
|
||||
#define SIG_iS_s 25
|
||||
Scheme_Object* scheme_rtcall_sl_s(const char *who, int src_type, prim_sl_s f, Scheme_Object* g180, intptr_t g181);
|
||||
#define SIG_iS_s 26
|
||||
typedef Scheme_Object* (*prim_iS_s)(int, Scheme_Object**);
|
||||
Scheme_Object* scheme_rtcall_iS_s(const char *who, int src_type, prim_iS_s f, int g173, Scheme_Object** g174);
|
||||
#define SIG_S_s 26
|
||||
Scheme_Object* scheme_rtcall_iS_s(const char *who, int src_type, prim_iS_s f, int g182, Scheme_Object** g183);
|
||||
#define SIG_S_s 27
|
||||
typedef Scheme_Object* (*prim_S_s)(Scheme_Object**);
|
||||
Scheme_Object* scheme_rtcall_S_s(const char *who, int src_type, prim_S_s f, Scheme_Object** g175);
|
||||
#define SIG_s_v 27
|
||||
Scheme_Object* scheme_rtcall_S_s(const char *who, int src_type, prim_S_s f, Scheme_Object** g184);
|
||||
#define SIG_s_v 28
|
||||
typedef void (*prim_s_v)(Scheme_Object*);
|
||||
void scheme_rtcall_s_v(const char *who, int src_type, prim_s_v f, Scheme_Object* g176);
|
||||
#define SIG_iSi_s 28
|
||||
void scheme_rtcall_s_v(const char *who, int src_type, prim_s_v f, Scheme_Object* g185);
|
||||
#define SIG_iSi_s 29
|
||||
typedef Scheme_Object* (*prim_iSi_s)(int, Scheme_Object**, int);
|
||||
Scheme_Object* scheme_rtcall_iSi_s(const char *who, int src_type, prim_iSi_s f, int g177, Scheme_Object** g178, int g179);
|
||||
#define SIG_siS_v 29
|
||||
Scheme_Object* scheme_rtcall_iSi_s(const char *who, int src_type, prim_iSi_s f, int g186, Scheme_Object** g187, int g188);
|
||||
#define SIG_siS_v 30
|
||||
typedef void (*prim_siS_v)(Scheme_Object*, int, Scheme_Object**);
|
||||
void scheme_rtcall_siS_v(const char *who, int src_type, prim_siS_v f, Scheme_Object* g180, int g181, Scheme_Object** g182);
|
||||
#define SIG_z_p 30
|
||||
void scheme_rtcall_siS_v(const char *who, int src_type, prim_siS_v f, Scheme_Object* g189, int g190, Scheme_Object** g191);
|
||||
#define SIG_z_p 31
|
||||
typedef void* (*prim_z_p)(size_t);
|
||||
void* scheme_rtcall_z_p(const char *who, int src_type, prim_z_p f, size_t g183);
|
||||
#define SIG_si_s 31
|
||||
void* scheme_rtcall_z_p(const char *who, int src_type, prim_z_p f, size_t g192);
|
||||
#define SIG_si_s 32
|
||||
typedef Scheme_Object* (*prim_si_s)(Scheme_Object*, int);
|
||||
Scheme_Object* scheme_rtcall_si_s(const char *who, int src_type, prim_si_s f, Scheme_Object* g184, int g185);
|
||||
#define SIG_sis_v 32
|
||||
Scheme_Object* scheme_rtcall_si_s(const char *who, int src_type, prim_si_s f, Scheme_Object* g193, int g194);
|
||||
#define SIG_sis_v 33
|
||||
typedef void (*prim_sis_v)(Scheme_Object*, int, Scheme_Object*);
|
||||
void scheme_rtcall_sis_v(const char *who, int src_type, prim_sis_v f, Scheme_Object* g186, int g187, Scheme_Object* g188);
|
||||
#define SIG_ss_i 33
|
||||
void scheme_rtcall_sis_v(const char *who, int src_type, prim_sis_v f, Scheme_Object* g195, int g196, Scheme_Object* g197);
|
||||
#define SIG_ss_i 34
|
||||
typedef int (*prim_ss_i)(Scheme_Object*, Scheme_Object*);
|
||||
int scheme_rtcall_ss_i(const char *who, int src_type, prim_ss_i f, Scheme_Object* g189, Scheme_Object* g190);
|
||||
int scheme_rtcall_ss_i(const char *who, int src_type, prim_ss_i f, Scheme_Object* g198, Scheme_Object* g199);
|
||||
|
|
|
@ -82,6 +82,20 @@ case SIG_ss_s:
|
|||
send_special_result(future, retval);
|
||||
break;
|
||||
}
|
||||
case SIG_ssi_s:
|
||||
{
|
||||
prim_ssi_s f = (prim_ssi_s)future->prim_func;
|
||||
GC_CAN_IGNORE Scheme_Object* retval;
|
||||
JIT_TS_LOCALIZE(Scheme_Object*, arg_s0); JIT_TS_LOCALIZE(Scheme_Object*, arg_s1); JIT_TS_LOCALIZE(int, arg_i2);
|
||||
|
||||
future->arg_s0 = NULL; future->arg_s1 = NULL;
|
||||
|
||||
retval =
|
||||
f(arg_s0, arg_s1, arg_i2);
|
||||
future->retval_s = retval;
|
||||
send_special_result(future, retval);
|
||||
break;
|
||||
}
|
||||
case SIG_tt_s:
|
||||
{
|
||||
prim_tt_s f = (prim_tt_s)future->prim_func;
|
||||
|
|
|
@ -83,6 +83,17 @@ static Scheme_Object *apply_checked_fail(Scheme_Object **args)
|
|||
return _scheme_apply(args[2], 3, a);
|
||||
}
|
||||
|
||||
static Scheme_Object *vector_check_chaperone_of(Scheme_Object *o, Scheme_Object *orig, int setter)
|
||||
{
|
||||
if (!scheme_chaperone_of(o, orig))
|
||||
scheme_raise_exn(MZEXN_FAIL_CONTRACT,
|
||||
"%s: chaperone produced a result: %V that is not a chaperone of the original result: %V",
|
||||
(setter ? "vector-set!" : "vector-ref"),
|
||||
o,
|
||||
orig);
|
||||
return o;
|
||||
}
|
||||
|
||||
static int save_struct_temp(mz_jit_state *jitter)
|
||||
{
|
||||
#ifdef MZ_USE_JIT_PPC
|
||||
|
@ -864,6 +875,82 @@ static int common2(mz_jit_state *jitter, void *_data)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int generate_apply_proxy(mz_jit_state *jitter, int setter)
|
||||
/* current val in R0, chaperone-filtered val in R0;
|
||||
original chaperone and index on runstack;
|
||||
for setter, put back result in R2, vec in R0, and index in V1 */
|
||||
{
|
||||
GC_CAN_IGNORE jit_insn *ref, *ref1, *ref2, *refrts;
|
||||
|
||||
CHECK_LIMIT();
|
||||
jit_ldr_p(JIT_R2, JIT_RUNSTACK);
|
||||
jit_ldxi_p(JIT_R1, JIT_R2, &((Scheme_Chaperone *)0x0)->redirects);
|
||||
|
||||
/* if chaperone was for properties, only, then we're done */
|
||||
ref = mz_beqi_t(jit_forward(), JIT_R1, scheme_vector_type, JIT_R2);
|
||||
|
||||
if (setter)
|
||||
jit_ldxi_p(JIT_V1, JIT_R1, &SCHEME_CDR(0x0)); /* rator */
|
||||
else
|
||||
jit_ldxi_p(JIT_V1, JIT_R1, &SCHEME_CAR(0x0)); /* rator */
|
||||
jit_ldxi_p(JIT_R2, JIT_R2, &((Scheme_Chaperone *)0x0)->prev); /* vec */
|
||||
jit_ldxi_p(JIT_R1, JIT_RUNSTACK, WORDS_TO_BYTES(1)); /* index */
|
||||
if (setter) {
|
||||
jit_subi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(4));
|
||||
jit_stxi_p(WORDS_TO_BYTES(3), JIT_RUNSTACK, JIT_R0); /* save value */
|
||||
} else {
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R0); /* save value */
|
||||
jit_subi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(3));
|
||||
}
|
||||
jit_str_p(JIT_RUNSTACK, JIT_R2);
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R1);
|
||||
jit_stxi_p(WORDS_TO_BYTES(2), JIT_RUNSTACK, JIT_R0);
|
||||
CHECK_LIMIT();
|
||||
JIT_UPDATE_THREAD_RSPTR();
|
||||
scheme_generate_non_tail_call(jitter, 3, 0, 0, 0, 0, 0, 1);
|
||||
CHECK_LIMIT();
|
||||
if (setter) {
|
||||
jit_addi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(4));
|
||||
} else {
|
||||
jit_addi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(3));
|
||||
}
|
||||
|
||||
jit_ldr_p(JIT_R1, JIT_RUNSTACK);
|
||||
jit_ldxi_s(JIT_R2, JIT_R1, &MZ_OPT_HASH_KEY(&((Scheme_Stx *)0x0)->iso));
|
||||
/* if impersonator, no chaperone-of check needed */
|
||||
ref1 = jit_bmsi_ul(jit_forward(), JIT_R2, SCHEME_CHAPERONE_IS_IMPERSONATOR);
|
||||
|
||||
if (setter)
|
||||
jit_ldxi_p(JIT_R1, JIT_RUNSTACK, WORDS_TO_BYTES(-1)); /* saved value */
|
||||
else
|
||||
jit_ldxi_p(JIT_R1, JIT_RUNSTACK, WORDS_TO_BYTES(1)); /* saved value */
|
||||
ref2 = jit_beqr_p(jit_forward(), JIT_R1, JIT_R0);
|
||||
CHECK_LIMIT();
|
||||
jit_prepare(3);
|
||||
jit_movi_i(JIT_R2, setter);
|
||||
jit_pusharg_i(JIT_R2);
|
||||
jit_pusharg_p(JIT_R1);
|
||||
jit_pusharg_p(JIT_R0);
|
||||
JIT_UPDATE_THREAD_RSPTR();
|
||||
mz_finish_lwe(ts_vector_check_chaperone_of, refrts);
|
||||
jit_retval(JIT_R0);
|
||||
CHECK_LIMIT();
|
||||
|
||||
mz_patch_branch(ref);
|
||||
mz_patch_branch(ref1);
|
||||
mz_patch_branch(ref2);
|
||||
if (setter) {
|
||||
jit_movr_p(JIT_R2, JIT_R0); /* result needed in R2 for setter */
|
||||
jit_ldxi_p(JIT_V1, JIT_RUNSTACK, WORDS_TO_BYTES(1)); /* saved index */
|
||||
jit_ldr_p(JIT_R0, JIT_RUNSTACK); /* saved chaperone */
|
||||
jit_ldxi_p(JIT_R0, JIT_R0, &((Scheme_Chaperone *)0x0)->prev); /* vec */
|
||||
}
|
||||
jit_addi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2)); /* don't need saved anymore */
|
||||
JIT_UPDATE_THREAD_RSPTR();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int common3(mz_jit_state *jitter, void *_data)
|
||||
{
|
||||
int i, ii, iii;
|
||||
|
@ -874,7 +961,7 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
vector, it includes the offset to the start of the elements array).
|
||||
In set mode, value is on run stack. */
|
||||
for (iii = 0; iii < 2; iii++) { /* ref, set */
|
||||
for (ii = 0; ii < 4; ii++) { /* vector, string, bytes, fx */
|
||||
for (ii = -1; ii < 4; ii++) { /* chap-vector, vector, string, bytes, fx */
|
||||
for (i = 0; i < 2; i++) { /* check index? */
|
||||
GC_CAN_IGNORE jit_insn *ref, *reffail, *refrts;
|
||||
Scheme_Type ty;
|
||||
|
@ -884,12 +971,27 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
code = jit_get_ip().ptr;
|
||||
|
||||
switch (ii) {
|
||||
case -1:
|
||||
case 0:
|
||||
ty = scheme_vector_type;
|
||||
offset = (int)&SCHEME_VEC_ELS(0x0);
|
||||
count_offset = (int)&SCHEME_VEC_SIZE(0x0);
|
||||
log_elem_size = JIT_LOG_WORD_SIZE;
|
||||
if (!iii) {
|
||||
if (ii == -1) {
|
||||
if (!iii) {
|
||||
if (!i) {
|
||||
sjc.chap_vector_ref_code = code;
|
||||
} else {
|
||||
sjc.chap_vector_ref_check_index_code = code;
|
||||
}
|
||||
} else {
|
||||
if (!i) {
|
||||
sjc.chap_vector_set_code = code;
|
||||
} else {
|
||||
sjc.chap_vector_set_check_index_code = code;
|
||||
}
|
||||
}
|
||||
} else if (!iii) {
|
||||
if (!i) {
|
||||
sjc.vector_ref_code = code;
|
||||
} else {
|
||||
|
@ -965,21 +1067,38 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
|
||||
__START_SHORT_JUMPS__(1);
|
||||
|
||||
mz_prolog(JIT_R2);
|
||||
if (ii != -1) {
|
||||
mz_prolog(JIT_R2);
|
||||
} else {
|
||||
/* skip prolog for chaperone handling, but save original R0 & R1: */
|
||||
jit_subi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
CHECK_RUNSTACK_OVERFLOW();
|
||||
jit_str_p(JIT_RUNSTACK, JIT_R0);
|
||||
if (i)
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R1);
|
||||
else {
|
||||
jit_lshi_ul(JIT_R2, JIT_R1, 0x1);
|
||||
jit_ori_ul(JIT_R2, JIT_R2, 0x1);
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R2);
|
||||
}
|
||||
}
|
||||
|
||||
ref = jit_bmci_ul(jit_forward(), JIT_R0, 0x1);
|
||||
CHECK_LIMIT();
|
||||
|
||||
/* Slow path: */
|
||||
reffail = _jit.x.pc;
|
||||
if (!i) {
|
||||
jit_lshi_ul(JIT_R1, JIT_R1, 1);
|
||||
jit_ori_ul(JIT_R1, JIT_R1, 0x1);
|
||||
}
|
||||
jit_subi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
CHECK_RUNSTACK_OVERFLOW();
|
||||
jit_str_p(JIT_RUNSTACK, JIT_R0);
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R1);
|
||||
if (ii != -1) {
|
||||
/* in chaperone mode, we already saved original and index on runstack */
|
||||
if (!i) {
|
||||
jit_lshi_ul(JIT_R1, JIT_R1, 1);
|
||||
jit_ori_ul(JIT_R1, JIT_R1, 0x1);
|
||||
}
|
||||
jit_subi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
CHECK_RUNSTACK_OVERFLOW();
|
||||
jit_str_p(JIT_RUNSTACK, JIT_R0);
|
||||
jit_stxi_p(WORDS_TO_BYTES(1), JIT_RUNSTACK, JIT_R1);
|
||||
}
|
||||
if (!iii) {
|
||||
jit_movi_i(JIT_R1, 2);
|
||||
} else {
|
||||
|
@ -991,6 +1110,7 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
jit_pusharg_p(JIT_RUNSTACK);
|
||||
jit_pusharg_i(JIT_R1);
|
||||
switch (ii) {
|
||||
case -1:
|
||||
case 0:
|
||||
if (!iii) {
|
||||
(void)mz_finish_lwe(ts_scheme_checked_vector_ref, refrts);
|
||||
|
@ -999,6 +1119,8 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
}
|
||||
CHECK_LIMIT();
|
||||
/* Might return, if arg was chaperone */
|
||||
if (ii == -1)
|
||||
jit_addi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
jit_addi_p(JIT_RUNSTACK, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
JIT_UPDATE_THREAD_RSPTR();
|
||||
if (!iii)
|
||||
|
@ -1043,6 +1165,24 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
(void)jit_bmci_ul(reffail, JIT_R1, 0x1);
|
||||
(void)jit_blei_l(reffail, JIT_R1, 0x0);
|
||||
}
|
||||
if (!ii) {
|
||||
__END_SHORT_JUMPS__(1);
|
||||
if (iii == 0) {
|
||||
if (i)
|
||||
(void)mz_beqi_t(sjc.chap_vector_ref_check_index_code, JIT_R0, scheme_chaperone_type, JIT_R2);
|
||||
else
|
||||
(void)mz_beqi_t(sjc.chap_vector_ref_code, JIT_R0, scheme_chaperone_type, JIT_R2);
|
||||
} else {
|
||||
if (i)
|
||||
(void)mz_beqi_t(sjc.chap_vector_set_check_index_code, JIT_R0, scheme_chaperone_type, JIT_R2);
|
||||
else
|
||||
(void)mz_beqi_t(sjc.chap_vector_set_code, JIT_R0, scheme_chaperone_type, JIT_R2);
|
||||
}
|
||||
__START_SHORT_JUMPS__(1);
|
||||
} else if (ii == -1) {
|
||||
/* since we got here, we know that the wrapper is a proxy */
|
||||
jit_ldxi_p(JIT_R0, JIT_R0, &((Scheme_Chaperone *)0x0)->prev);
|
||||
}
|
||||
(void)mz_bnei_t(reffail, JIT_R0, ty, JIT_R2);
|
||||
if (iii) {
|
||||
jit_ldxi_s(JIT_R2, JIT_R0, &(MZ_OPT_HASH_KEY((Scheme_Inclhash_Object *)0x0)));
|
||||
|
@ -1056,7 +1196,7 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
(void)jit_bler_ul(reffail, JIT_R2, JIT_V1);
|
||||
if (log_elem_size)
|
||||
jit_lshi_ul(JIT_V1, JIT_V1, log_elem_size);
|
||||
if (!ii) /* vector */
|
||||
if (!ii || (ii == -1)) /* vector */
|
||||
jit_addi_p(JIT_V1, JIT_V1, offset);
|
||||
} else {
|
||||
/* constant index supplied: */
|
||||
|
@ -1065,6 +1205,7 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
if (!iii) {
|
||||
/* ref mode: */
|
||||
switch (ii) {
|
||||
case -1: /* chap-vector */
|
||||
case 0: /* vector */
|
||||
case 3: /* fxvector */
|
||||
jit_ldxr_p(JIT_R0, JIT_R0, JIT_V1);
|
||||
|
@ -1088,12 +1229,34 @@ static int common3(mz_jit_state *jitter, void *_data)
|
|||
jit_ori_l(JIT_R0, JIT_R0, 0x1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ii == -1) {
|
||||
/* apply proxy */
|
||||
CHECK_LIMIT();
|
||||
generate_apply_proxy(jitter, 0);
|
||||
CHECK_LIMIT();
|
||||
}
|
||||
} else {
|
||||
/* set mode: */
|
||||
jit_ldr_p(JIT_R2, JIT_RUNSTACK);
|
||||
if (ii == -1) {
|
||||
/* apply proxy */
|
||||
CHECK_LIMIT();
|
||||
jit_ldxi_p(JIT_R0, JIT_RUNSTACK, WORDS_TO_BYTES(2));
|
||||
generate_apply_proxy(jitter, 1);
|
||||
CHECK_LIMIT();
|
||||
|
||||
/* recompute offset */
|
||||
jit_rshi_ul(JIT_V1, JIT_V1, 1);
|
||||
if (log_elem_size)
|
||||
jit_lshi_ul(JIT_V1, JIT_V1, log_elem_size);
|
||||
jit_addi_p(JIT_V1, JIT_V1, offset);
|
||||
} else {
|
||||
jit_ldr_p(JIT_R2, JIT_RUNSTACK);
|
||||
}
|
||||
switch (ii) {
|
||||
case 3: /* fxvector */
|
||||
(void)jit_bmci_l(reffail, JIT_R2, 0x1);
|
||||
case -1: /* chap-vector, fall-though from fxvector */
|
||||
case 0: /* vector, fall-though from fxvector */
|
||||
jit_stxr_p(JIT_V1, JIT_R0, JIT_R2);
|
||||
break;
|
||||
|
|
|
@ -2100,9 +2100,9 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
|
|||
int unbox = jitter->unbox;
|
||||
int can_chaperone = 1, for_struct = 0, for_fx = 0;
|
||||
|
||||
if (IS_NAMED_PRIM(rator, "vector-ref"))
|
||||
if (IS_NAMED_PRIM(rator, "vector-ref")) {
|
||||
which = 0;
|
||||
else if (IS_NAMED_PRIM(rator, "fxvector-ref")) {
|
||||
} else if (IS_NAMED_PRIM(rator, "fxvector-ref")) {
|
||||
which = 0;
|
||||
for_fx = 1;
|
||||
can_chaperone = 0;
|
||||
|
@ -2163,6 +2163,7 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
|
|||
|
||||
if (!which) {
|
||||
/* vector-ref is relatively simple and worth inlining */
|
||||
if (can_chaperone) scheme_mz_need_space(jitter, 3);
|
||||
generate_vector_op(jitter, 0, 0, base_offset, 0, unsafe,
|
||||
0, 0, can_chaperone, for_struct, for_fx, 0);
|
||||
CHECK_LIMIT();
|
||||
|
@ -2220,6 +2221,7 @@ int scheme_generate_inlined_binary(mz_jit_state *jitter, Scheme_App3_Rec *app, i
|
|||
jit_movi_l(JIT_V1, offset);
|
||||
if (!which) {
|
||||
/* vector-ref is relatively simple and worth inlining */
|
||||
if (can_chaperone) scheme_mz_need_space(jitter, 3);
|
||||
generate_vector_op(jitter, 0, 1, base_offset, 0, unsafe,
|
||||
0, 0, can_chaperone, for_struct, for_fx, 0);
|
||||
CHECK_LIMIT();
|
||||
|
@ -2847,6 +2849,7 @@ int scheme_generate_inlined_nary(mz_jit_state *jitter, Scheme_App_Rec *app, int
|
|||
if (!simple) {
|
||||
if (!which) {
|
||||
/* vector-set! is relatively simple and worth inlining */
|
||||
if (can_chaperone) scheme_mz_need_space(jitter, 3);
|
||||
generate_vector_op(jitter, 1, 0, base_offset, 0, unsafe,
|
||||
flonum_arg, result_ignored, can_chaperone,
|
||||
for_struct, for_fx, check_mutable);
|
||||
|
@ -2896,6 +2899,7 @@ int scheme_generate_inlined_nary(mz_jit_state *jitter, Scheme_App_Rec *app, int
|
|||
jit_movi_l(JIT_V1, offset);
|
||||
if (!which) {
|
||||
/* vector-set! is relatively simple and worth inlining */
|
||||
if (can_chaperone) scheme_mz_need_space(jitter, 3);
|
||||
generate_vector_op(jitter, 1, 1, base_offset, 0, unsafe,
|
||||
flonum_arg, result_ignored, can_chaperone,
|
||||
for_struct, for_fx, check_mutable);
|
||||
|
|
|
@ -346,6 +346,12 @@ void scheme_mz_popr_p_it(mz_jit_state *jitter, int reg, int discard)
|
|||
jitter->need_set_rs = 1;
|
||||
}
|
||||
|
||||
void scheme_mz_need_space(mz_jit_state *jitter, int need_extra)
|
||||
{
|
||||
if (jitter->extra_pushed + need_extra > jitter->max_extra_pushed)
|
||||
jitter->max_extra_pushed = jitter->extra_pushed + need_extra;
|
||||
}
|
||||
|
||||
void scheme_mz_runstack_skipped(mz_jit_state *jitter, int n)
|
||||
{
|
||||
int v;
|
||||
|
|
Loading…
Reference in New Issue
Block a user