JIT-inline `path?'

This commit is contained in:
Matthew Flatt 2011-07-08 19:38:59 -06:00
parent 1ba2d85004
commit d49a1e1fa1
2 changed files with 9 additions and 5 deletions

View File

@ -251,6 +251,8 @@ SHARED_OK static gid_t egid;
void scheme_init_file(Scheme_Env *env)
{
Scheme_Object *p;
REGISTER_SO(up_symbol);
REGISTER_SO(relative_symbol);
REGISTER_SO(same_symbol);
@ -305,11 +307,10 @@ void scheme_init_file(Scheme_Env *env)
windows_symbol = scheme_intern_symbol("windows");
unix_symbol = scheme_intern_symbol("unix");
scheme_add_global_constant("path?",
scheme_make_prim_w_arity(path_p,
"path?",
1, 1),
env);
p = scheme_make_prim_w_arity(path_p, "path?", 1, 1);
SCHEME_PRIM_PROC_FLAGS(p) |= SCHEME_PRIM_IS_UNARY_INLINED;
scheme_add_global_constant("path?", p, env);
scheme_add_global_constant("path-for-some-system?",
scheme_make_folding_prim(general_path_p,
"path-for-some-system?",

View File

@ -473,6 +473,9 @@ int scheme_generate_inlined_unary(mz_jit_state *jitter, Scheme_App2_Rec *app, in
} else if (IS_NAMED_PRIM(rator, "bytes?")) {
generate_inlined_type_test(jitter, app, scheme_byte_string_type, scheme_byte_string_type, 0, for_branch, branch_short, need_sync);
return 1;
} else if (IS_NAMED_PRIM(rator, "path?")) {
generate_inlined_type_test(jitter, app, SCHEME_PLATFORM_PATH_KIND, SCHEME_PLATFORM_PATH_KIND, 0, for_branch, branch_short, need_sync);
return 1;
} else if (IS_NAMED_PRIM(rator, "eof-object?")) {
generate_inlined_constant_test(jitter, app, scheme_eof, NULL, for_branch, branch_short, need_sync);
return 1;