- Timestamp:
- 09/18/08 19:46:04 (2 months ago)
- Location:
- v6/smop
- Files:
-
- 8 modified
-
CMakeLists.txt (modified) (1 diff)
-
include/smop_base.h (modified) (2 diffs)
-
src/smop_lowlevel.sm0p (modified) (2 diffs)
-
src/smop_mold.c (modified) (2 diffs)
-
src/smop_s1p_array_iterator.sm0p (modified) (1 diff)
-
src/smop_s1p_root_namespace.c (modified) (1 diff)
-
src/smop_slime_node.c (modified) (1 diff)
-
tools/ri (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
v6/smop/CMakeLists.txt
r22275 r22281 1 1 project (smop) 2 2 SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_TRACE" ) 3 #SET( CMAKE_C_FLAGS "-O0 -g3 -DSMOP_LOWLEVEL_MEM_TRACE -DSMOP_LOWLEVEL_MEM_DEBUG -DSMOP_MOLD_DEBUG -DSMOP_SLIME_DEBUG" ) 3 4 SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) 4 5 cmake_minimum_required (VERSION 2.6) -
v6/smop/include/smop_base.h
r22274 r22281 85 85 #ifdef SMOP_LOWLEVEL_MEM_DEBUG 86 86 #define SMOP_REFERENCE(interpreter, object) \ 87 (fprintf(stderr," [32mSMOP_REFERENCE[0m(%p) at %s line %d file %s\n",object,__func__,__LINE__,__FILE__),\87 (fprintf(stderr,"[SMOP_LOWLEVEL_MEM_DEBUG] ++ (%p) %s:%d (%s)\n",object,__FILE__,__LINE__,__func__),\ 88 88 (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->REFERENCE( (SMOP__Object*)interpreter, \ 89 89 ((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object)), \ … … 92 92 93 93 #define SMOP_RELEASE(interpreter, object) \ 94 (fprintf(stderr," [31mSMOP_RELEASE[0m(%p) at %s line %d file %s\n",object,__func__,__LINE__,__FILE__),\94 (fprintf(stderr,"[SMOP_LOWLEVEL_MEM_DEBUG] -- (%p) %s:%d (%s)\n",object,__FILE__,__LINE__,__func__),\ 95 95 (((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object))->RELEASE( (SMOP__Object*)interpreter, \ 96 96 ((SMOP__ResponderInterface*)(((SMOP__Object*)object)->RI)?(((SMOP__Object*)object)->RI):((SMOP__ResponderInterface*)object)), \ -
v6/smop/src/smop_lowlevel.sm0p
r22230 r22281 162 162 163 163 SMOP__Object* smop_lowlevel_refcnt_inc(SMOP__Object* interpreter, SMOP__ResponderInterface* ri, SMOP__Object* value) { 164 #ifdef SMOP_LOWLEVEL_MEM_DEBUG165 fprintf(stderr,"[SMOP_LOWLEVEL_MEM_DEBUG] refcont_inc: %p\n",value);166 #endif167 164 smop_lowlevel_wrlock(value); 168 165 ((SMOP_LOWLEVEL_INTERNAL*)value->data)->ref_cnt++; … … 172 169 173 170 SMOP__Object* smop_lowlevel_refcnt_dec(SMOP__Object* interpreter, SMOP__ResponderInterface* ri, SMOP__Object* value) { 174 #ifdef SMOP_LOWLEVEL_MEM_DEBUG175 fprintf(stderr,"[SMOP_LOWLEVEL_MEM_DEBUG] refcont_dec: %p\n",value);176 #endif177 171 smop_lowlevel_wrlock(value); 178 172 ((SMOP_LOWLEVEL_INTERNAL*)value->data)->ref_cnt--; -
v6/smop/src/smop_mold.c
r22198 r22281 258 258 free(call_named); 259 259 free(call_pos); 260 261 #ifdef SMOP_MOLD_DEBUG 262 if (identifier && SMOP_RI(identifier) == SMOP_RI(SMOP__ID__new)) { 263 int u; 264 char* external = SMOP__NATIVE__idconst_fetch(call_identifier, &u); 265 char* local = malloc(u+1); 266 memcpy(local, external, u); 267 local[u] = 0; 268 fprintf(stderr, "[SMOP_MOLD_DEBUG] eval \"%s\" on \"%s\".\n", local, SMOP_RI(call_invocant)->id); 269 free(local); 270 } else { 271 fprintf(stderr, "[SMOP_MOLD_DEBUG] eval on \"%s\".\n", SMOP_RI(call_invocant)->id); 272 } 273 #endif 274 260 275 261 276 SMOP__Object* ret = SMOP_DISPATCH(interpreter,SMOP_RI(call_invocant),call_identifier,capture); … … 292 307 SMOP__Object* call_capture = get_register(interpreter,frame); 293 308 309 #ifdef SMOP_MOLD_DEBUG 310 if (identifier && SMOP_RI(identifier) == SMOP_RI(SMOP__ID__new)) { 311 int u; 312 char* external = SMOP__NATIVE__idconst_fetch(call_identifier, &u); 313 char* local = malloc(u+1); 314 memcpy(local, external, u); 315 local[u] = 0; 316 fprintf(stderr, "[SMOP_MOLD_DEBUG] eval \"%s\" on \"%s\".\n", local, ((SMOP__ResponderInterface*)call_responder)->id); 317 free(local); 318 } else { 319 fprintf(stderr, "[SMOP_MOLD_DEBUG] eval on \"%s\".\n", ((SMOP__ResponderInterface*)call_responder)->id); 320 } 321 #endif 322 294 323 SMOP__Object* ret = SMOP_DISPATCH(interpreter,SMOP_RI(call_responder),call_identifier,call_capture); 295 324 SMOP_RELEASE(interpreter,call_responder); -
v6/smop/src/smop_s1p_array_iterator.sm0p
r22272 r22281 46 46 mold_reg_set(interpreter,frame,0,SMOP_REFERENCE(interpreter,interpreter)); 47 47 mold_reg_set(interpreter,frame,1,SMOP_REFERENCE(interpreter,capture)); 48 mold_reg_set(interpreter,frame,2, SMOP_REFERENCE(interpreter,back));48 mold_reg_set(interpreter,frame,2,back); 49 49 50 50 SMOP_DISPATCH(interpreter,SMOP_RI(interpreter),SMOP__ID__goto,frame); -
v6/smop/src/smop_s1p_root_namespace.c
r22230 r22281 24 24 void smop_s1p_root_namespace_init() { 25 25 SMOP__S1P__RootNamespace = SMOP__S1P__Hash_create(); 26 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Hash",SMOP__S1P__Hash_create()); 27 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Array",SMOP__S1P__Array_create()); 28 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"$*OUT",SMOP__S1P__IO_create(SMOP__GlobalInterpreter)); 29 //smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Code",SMOP__S1P__Code_create(SMOP__NATIVE__bool_false)); 30 SMOP__Object* mold = SMOP__Mold_create(0,(SMOP__Object*[]) { NULL },1,(int[]) { 0 }); 31 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Mold",SMOP_REFERENCE(SMOP__GlobalInterpreter,mold)); 32 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::MoldFrame",SMOP__Mold__Frame_create(SMOP__GlobalInterpreter,mold)); 33 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Code",SMOP__S1P__Code_create()); 26 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Hash", SMOP__S1P__Hash); 27 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Array", SMOP__S1P__Array); 28 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"$*OUT", SMOP__S1P__IO_create(SMOP__GlobalInterpreter)); 29 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Mold", SMOP__Mold); 30 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::MoldFrame", SMOP__Mold__Frame); 31 smop_s1p_root_namespace_insert(SMOP__GlobalInterpreter,"::Code", SMOP__S1P__Code); 34 32 } 35 33 -
v6/smop/src/smop_slime_node.c
r22017 r22281 181 181 memcpy(local, external, u); 182 182 local[u] = 0; 183 fprintf(stderr, "[ node] eval \"%s\".\n", local);183 fprintf(stderr, "[SMOP_SLIME_DEBUG] eval \"%s\" on \"%s\".\n", local, ((SMOP__ResponderInterface*)responder)); 184 184 free(local); 185 185 } else { 186 fprintf(stderr, "[ node] eval.\n");186 fprintf(stderr, "[SMOP_SLIME_DEBUG] eval on \"%s\".\n", ((SMOP__ResponderInterface*)responder)); 187 187 } 188 188 #endif -
v6/smop/tools/ri
r22270 r22281 96 96 } 97 97 98 if (invocant) SMOP_RELEASE(interpreter,invocant); 98 99 SMOP_RELEASE(interpreter,capture); 99 100 return ret;
