Places added place local module path table for uninterned symbols

svn: r17774
This commit is contained in:
Kevin Tew 2010-01-22 23:32:32 +00:00
parent bee5af120b
commit a6c1b9256e
2 changed files with 35 additions and 0 deletions

View File

@ -260,6 +260,7 @@ typedef struct Thread_Local_Variables {
int gensym_counter_; int gensym_counter_;
Scheme_Object *dummy_input_port_; Scheme_Object *dummy_input_port_;
Scheme_Object *dummy_output_port_; Scheme_Object *dummy_output_port_;
Scheme_Bucket_Table *place_local_modpath_table_;
/*KPLAKE1*/ /*KPLAKE1*/
} Thread_Local_Variables; } Thread_Local_Variables;
@ -505,6 +506,7 @@ XFORM_GC_VARIABLE_STACK_THROUGH_THREAD_LOCAL;
#define gensym_counter XOA (scheme_get_thread_local_variables()->gensym_counter_) #define gensym_counter XOA (scheme_get_thread_local_variables()->gensym_counter_)
#define dummy_input_port XOA (scheme_get_thread_local_variables()->dummy_input_port_) #define dummy_input_port XOA (scheme_get_thread_local_variables()->dummy_input_port_)
#define dummy_output_port XOA (scheme_get_thread_local_variables()->dummy_output_port_) #define dummy_output_port XOA (scheme_get_thread_local_variables()->dummy_output_port_)
#define place_local_modpath_table XOA (scheme_get_thread_local_variables()->place_local_modpath_table_)
/*KPLAKE2*/ /*KPLAKE2*/
/* **************************************** */ /* **************************************** */

View File

@ -199,6 +199,9 @@ READ_ONLY static Scheme_Object *empty_self_modidx;
READ_ONLY static Scheme_Object *empty_self_modname; READ_ONLY static Scheme_Object *empty_self_modname;
THREAD_LOCAL_DECL(static Scheme_Bucket_Table *starts_table); THREAD_LOCAL_DECL(static Scheme_Bucket_Table *starts_table);
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
THREAD_LOCAL_DECL(static Scheme_Bucket_Table *place_local_modpath_table);
#endif
/* FIXME eventually theses initial objects should be shared, but work required */ /* FIXME eventually theses initial objects should be shared, but work required */
THREAD_LOCAL_DECL(static Scheme_Env *initial_modules_env); THREAD_LOCAL_DECL(static Scheme_Env *initial_modules_env);
@ -408,6 +411,10 @@ void scheme_init_module_resolver(void)
REGISTER_SO(starts_table); REGISTER_SO(starts_table);
starts_table = scheme_make_weak_equal_table(); starts_table = scheme_make_weak_equal_table();
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
REGISTER_SO(place_local_modpath_table);
place_local_modpath_table = scheme_make_weak_equal_table();
#endif
config = scheme_current_config(); config = scheme_current_config();
@ -2870,10 +2877,36 @@ Scheme_Object *scheme_intern_resolved_module_path_worker(Scheme_Object *o)
return return_value; return return_value;
} }
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
static Scheme_Object *scheme_intern_local_resolved_module_path_worker(Scheme_Object *o)
{
Scheme_Object *rmp;
Scheme_Bucket *b;
Scheme_Object *return_value;
rmp = scheme_alloc_small_object();
rmp->type = scheme_resolved_module_path_type;
SCHEME_PTR_VAL(rmp) = o;
scheme_start_atomic();
b = scheme_bucket_from_table(place_local_modpath_table, (const char *)rmp);
scheme_end_atomic_no_swap();
if (!b->val)
b->val = scheme_true;
return_value = (Scheme_Object *)HT_EXTRACT_WEAK(b->key);
return return_value;
}
#endif
Scheme_Object *scheme_intern_resolved_module_path(Scheme_Object *o) Scheme_Object *scheme_intern_resolved_module_path(Scheme_Object *o)
{ {
#if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC) #if defined(MZ_USE_PLACES) && defined(MZ_PRECISE_GC)
void *return_payload; void *return_payload;
if (SCHEME_SYMBOLP(o) && SCHEME_SYM_UNINTERNEDP(o)) {
return scheme_intern_local_resolved_module_path_worker(o);
}
return_payload = scheme_master_fast_path(1, o); return_payload = scheme_master_fast_path(1, o);
return (Scheme_Object*) return_payload; return (Scheme_Object*) return_payload;
#endif #endif