annotate some primitives as "immediate"

This annotation is useful mainly for functions that might be called
frequently from JIT-generated code.
This commit is contained in:
Matthew Flatt 2013-11-12 10:16:53 -07:00
parent 24a132b8d1
commit c81a468bc4
4 changed files with 170 additions and 170 deletions

View File

@ -317,7 +317,7 @@ void scheme_init_file(Scheme_Env *env)
windows_symbol = scheme_intern_symbol("windows");
unix_symbol = scheme_intern_symbol("unix");
p = scheme_make_prim_w_arity(path_p, "path?", 1, 1);
p = scheme_make_immed_prim(path_p, "path?", 1, 1);
SCHEME_PRIM_PROC_FLAGS(p) |= scheme_intern_prim_opt_flags(SCHEME_PRIM_IS_UNARY_INLINED
| SCHEME_PRIM_IS_OMITABLE);
scheme_add_global_constant("path?", p, env);
@ -333,47 +333,47 @@ void scheme_init_file(Scheme_Env *env)
1, 1, 1),
env);
scheme_add_global_constant("system-path-convention-type",
scheme_make_prim_w_arity(platform_path_kind,
scheme_make_immed_prim(platform_path_kind,
"system-path-convention-type",
0, 0),
env);
scheme_add_global_constant("path->string",
scheme_make_prim_w_arity(path_to_string,
scheme_make_immed_prim(path_to_string,
"path->string",
1, 1),
env);
scheme_add_global_constant("path->bytes",
scheme_make_prim_w_arity(path_to_bytes,
scheme_make_immed_prim(path_to_bytes,
"path->bytes",
1, 1),
env);
scheme_add_global_constant("path-element->bytes",
scheme_make_prim_w_arity(path_element_to_bytes,
scheme_make_immed_prim(path_element_to_bytes,
"path-element->bytes",
1, 1),
env);
scheme_add_global_constant("path-element->string",
scheme_make_prim_w_arity(path_element_to_string,
scheme_make_immed_prim(path_element_to_string,
"path-element->string",
1, 1),
env);
scheme_add_global_constant("string->path",
scheme_make_prim_w_arity(string_to_path,
scheme_make_immed_prim(string_to_path,
"string->path",
1, 1),
env);
scheme_add_global_constant("bytes->path",
scheme_make_prim_w_arity(bytes_to_path,
scheme_make_immed_prim(bytes_to_path,
"bytes->path",
1, 2),
env);
scheme_add_global_constant("bytes->path-element",
scheme_make_prim_w_arity(bytes_to_path_element,
scheme_make_immed_prim(bytes_to_path_element,
"bytes->path-element",
1, 2),
env);
scheme_add_global_constant("string->path-element",
scheme_make_prim_w_arity(string_to_path_element,
scheme_make_immed_prim(string_to_path_element,
"string->path-element",
1, 1),
env);
@ -410,17 +410,17 @@ void scheme_init_file(Scheme_Env *env)
2, 3),
env);
scheme_add_global_constant("build-path",
scheme_make_prim_w_arity(scheme_build_path,
scheme_make_immed_prim(scheme_build_path,
"build-path",
1, -1),
env);
scheme_add_global_constant("build-path/convention-type",
scheme_make_prim_w_arity(build_path_kind,
scheme_make_immed_prim(build_path_kind,
"build-path/convention-type",
2, -1),
env);
scheme_add_global_constant("path->directory-path",
scheme_make_prim_w_arity(path_to_directory_path,
scheme_make_immed_prim(path_to_directory_path,
"path->directory-path",
1, 1),
env);
@ -431,27 +431,27 @@ void scheme_init_file(Scheme_Env *env)
3, 3),
env);
scheme_add_global_constant("explode-path",
scheme_make_prim_w_arity(explode_path,
scheme_make_immed_prim(explode_path,
"explode-path",
1, 1),
env);
scheme_add_global_constant("relative-path?",
scheme_make_prim_w_arity(relative_path_p,
scheme_make_immed_prim(relative_path_p,
"relative-path?",
1, 1),
env);
scheme_add_global_constant("absolute-path?",
scheme_make_prim_w_arity(absolute_path_p,
scheme_make_immed_prim(absolute_path_p,
"absolute-path?",
1, 1),
env);
scheme_add_global_constant("complete-path?",
scheme_make_prim_w_arity(complete_path_p,
scheme_make_immed_prim(complete_path_p,
"complete-path?",
1, 1),
env);
scheme_add_global_constant("path->complete-path",
scheme_make_prim_w_arity(path_to_complete_path,
scheme_make_immed_prim(path_to_complete_path,
"path->complete-path",
1, 2),
env);

View File

@ -498,32 +498,32 @@ scheme_init_fun (Scheme_Env *env)
4, 4),
env);
scheme_add_global_constant("current-milliseconds",
scheme_make_prim_w_arity(current_milliseconds,
scheme_make_immed_prim(current_milliseconds,
"current-milliseconds",
0, 0),
env);
scheme_add_global_constant("current-inexact-milliseconds",
scheme_make_prim_w_arity(current_inexact_milliseconds,
scheme_make_immed_prim(current_inexact_milliseconds,
"current-inexact-milliseconds",
0, 0),
env);
scheme_add_global_constant("current-process-milliseconds",
scheme_make_prim_w_arity(current_process_milliseconds,
scheme_make_immed_prim(current_process_milliseconds,
"current-process-milliseconds",
0, 1),
env);
scheme_add_global_constant("current-gc-milliseconds",
scheme_make_prim_w_arity(current_gc_milliseconds,
scheme_make_immed_prim(current_gc_milliseconds,
"current-gc-milliseconds",
0, 0),
env);
scheme_add_global_constant("current-seconds",
scheme_make_prim_w_arity(current_seconds,
scheme_make_immed_prim(current_seconds,
"current-seconds",
0, 0),
env);
scheme_add_global_constant("seconds->date",
scheme_make_prim_w_arity(seconds_to_date,
scheme_make_immed_prim(seconds_to_date,
"seconds->date",
1, 2),
env);

View File

@ -94,7 +94,7 @@ SHARED_OK static Scheme_Object *num_limits[3];
void scheme_init_numstr(Scheme_Env *env)
{
scheme_add_global_constant("number->string",
scheme_make_prim_w_arity(number_to_string,
scheme_make_immed_prim(number_to_string,
"number->string",
1, 2),
env);
@ -105,68 +105,68 @@ void scheme_init_numstr(Scheme_Env *env)
env);
scheme_add_global_constant("integer-bytes->integer",
scheme_make_prim_w_arity(bytes_to_integer,
scheme_make_immed_prim(bytes_to_integer,
"integer-bytes->integer",
2, 5),
env);
scheme_add_global_constant("integer->integer-bytes",
scheme_make_prim_w_arity(integer_to_bytes,
scheme_make_immed_prim(integer_to_bytes,
"integer->integer-bytes",
3, 6),
env);
scheme_add_global_constant("floating-point-bytes->real",
scheme_make_prim_w_arity(bytes_to_real,
scheme_make_immed_prim(bytes_to_real,
"floating-point-bytes->real",
1, 4),
env);
scheme_add_global_constant("real->floating-point-bytes",
scheme_make_prim_w_arity(real_to_bytes,
scheme_make_immed_prim(real_to_bytes,
"real->floating-point-bytes",
2, 5),
env);
scheme_add_global_constant("system-big-endian?",
scheme_make_prim_w_arity(system_big_endian_p,
scheme_make_immed_prim(system_big_endian_p,
"system-big-endian?",
0, 0),
env);
scheme_add_global_constant("random",
scheme_make_prim_w_arity(sch_random,
scheme_make_immed_prim(sch_random,
"random",
0, 2),
env);
scheme_add_global_constant("random-seed",
scheme_make_prim_w_arity(random_seed,
scheme_make_immed_prim(random_seed,
"random-seed",
1, 1),
env);
scheme_add_global_constant("make-pseudo-random-generator",
scheme_make_prim_w_arity(make_pseudo_random_generator,
scheme_make_immed_prim(make_pseudo_random_generator,
"make-pseudo-random-generator",
0, 0),
env);
scheme_add_global_constant("vector->pseudo-random-generator",
scheme_make_prim_w_arity(sch_pack,
scheme_make_immed_prim(sch_pack,
"vector->pseudo-random-generator",
1, 1),
env);
scheme_add_global_constant("vector->pseudo-random-generator!",
scheme_make_prim_w_arity(sch_pack_bang,
scheme_make_immed_prim(sch_pack_bang,
"vector->pseudo-random-generator!",
2, 2),
env);
scheme_add_global_constant("pseudo-random-generator->vector",
scheme_make_prim_w_arity(sch_unpack,
scheme_make_immed_prim(sch_unpack,
"pseudo-random-generator->vector",
1, 1),
env);
scheme_add_global_constant("pseudo-random-generator-vector?",
scheme_make_prim_w_arity(sch_check_pack,
scheme_make_immed_prim(sch_check_pack,
"pseudo-random-generator-vector?",
1, 1),
env);
scheme_add_global_constant("pseudo-random-generator?",
scheme_make_prim_w_arity(pseudo_random_generator_p,
scheme_make_immed_prim(pseudo_random_generator_p,
"pseudo-random-generator?",
1, 1),
env);
@ -205,12 +205,12 @@ void scheme_init_numstr(Scheme_Env *env)
void scheme_init_extfl_numstr(Scheme_Env *env)
{
scheme_add_global_constant("floating-point-bytes->extfl",
scheme_make_prim_w_arity(bytes_to_long_double,
scheme_make_immed_prim(bytes_to_long_double,
"floating-point-bytes->extfl",
1, 4),
env);
scheme_add_global_constant("extfl->floating-point-bytes",
scheme_make_prim_w_arity(long_double_to_bytes,
scheme_make_immed_prim(long_double_to_bytes,
"extfl->floating-point-bytes",
1, 4),
env);

View File

@ -636,7 +636,7 @@ scheme_init_struct (Scheme_Env *env)
1, 2),
env);
scheme_add_global_constant("prefab-struct-key",
scheme_make_prim_w_arity(prefab_struct_key,
scheme_make_immed_prim(prefab_struct_key,
"prefab-struct-key",
1, 1),
env);
@ -658,32 +658,32 @@ scheme_init_struct (Scheme_Env *env)
/*** Predicates ****/
scheme_add_global_constant("struct-mutator-procedure?",
scheme_make_prim_w_arity(struct_setter_p,
scheme_make_immed_prim(struct_setter_p,
"struct-mutator-procedure?",
1, 1),
env);
scheme_add_global_constant("struct-accessor-procedure?",
scheme_make_prim_w_arity(struct_getter_p,
scheme_make_immed_prim(struct_getter_p,
"struct-accessor-procedure?",
1, 1),
env);
scheme_add_global_constant("struct-predicate-procedure?",
scheme_make_prim_w_arity(struct_pred_p,
scheme_make_immed_prim(struct_pred_p,
"struct-predicate-procedure?",
1, 1),
env);
scheme_add_global_constant("struct-constructor-procedure?",
scheme_make_prim_w_arity(struct_constr_p,
scheme_make_immed_prim(struct_constr_p,
"struct-constructor-procedure?",
1, 1),
env);
scheme_add_global_constant("struct-type-property-accessor-procedure?",
scheme_make_prim_w_arity(struct_prop_getter_p,
scheme_make_immed_prim(struct_prop_getter_p,
"struct-type-property-accessor-procedure?",
1, 1),
env);
scheme_add_global_constant("impersonator-property-accessor-procedure?",
scheme_make_prim_w_arity(chaperone_prop_getter_p,
scheme_make_immed_prim(chaperone_prop_getter_p,
"impersonator-property-accessor-procedure?",
1, 1),
env);
@ -691,19 +691,19 @@ scheme_init_struct (Scheme_Env *env)
/*** Inspectors ****/
REGISTER_SO(scheme_make_inspector_proc);
scheme_make_inspector_proc = scheme_make_prim_w_arity(make_inspector,
scheme_make_inspector_proc = scheme_make_immed_prim(make_inspector,
"make-inspector",
0, 1);
scheme_add_global_constant("make-inspector", scheme_make_inspector_proc, env);
scheme_add_global_constant("make-sibling-inspector",
scheme_make_prim_w_arity(make_sibling_inspector,
scheme_make_immed_prim(make_sibling_inspector,
"make-sibling-inspector",
0, 1),
env);
scheme_add_global_constant("inspector?",
scheme_make_prim_w_arity(inspector_p,
scheme_make_folding_prim(inspector_p,
"inspector?",
1, 1),
1, 1, 1),
env);
REGISTER_SO(scheme_current_inspector_proc);
@ -721,12 +721,12 @@ scheme_init_struct (Scheme_Env *env)
scheme_add_global_constant("make-special-comment",
scheme_make_prim_w_arity(make_special_comment,
scheme_make_immed_prim(make_special_comment,
"make-special-comment",
1, 1),
env);
scheme_add_global_constant("special-comment-value",
scheme_make_prim_w_arity(special_comment_value,
scheme_make_immed_prim(special_comment_value,
"special-comment-value",
1, 1),
env);