Changeset 12631 in project for chicken/trunk


Ignore:
Timestamp:
11/28/08 10:57:21 (12 years ago)
Author:
felix winkelmann
Message:

disabled checks in expand; fix in build-rules for setup-*.import.scm; folded procedure resolution and global var retrieval runtime functions

Location:
chicken/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/c-backend.scm

    r12546 r12631  
    305305                             (expr-args args i)
    306306                             (gen ");") ) ) )
     307                     ((and (eq? '##core#global (node-class fn))
     308                           (not unsafe)
     309                           (not no-procedure-checks)
     310                           (not (first params)))
     311                      (let* ((gparams (node-parameters fn))
     312                             (index (first gparams))
     313                             (safe (second gparams))
     314                             (block (third gparams))
     315                             (carg #f))
     316                        (gen #t "((C_proc" nf ")")
     317                        (cond (block
     318                               (set! carg (string-append "lf[" (number->string index) "]"))
     319                               (if safe
     320                                   (gen "C_retrieve_proc(" carg ")")
     321                                   (gen "C_retrieve2_symbol_proc(" carg ","
     322                                        (c-ify-string (symbol->string (fourth gparams))) #\)) ) )
     323                              (safe
     324                               (set! carg
     325                                 (string-append "*((C_word*)lf[" (number->string index) "]+1)"))
     326                               (gen "C_retrieve_proc(" carg ")"))
     327                              (else
     328                               (set! carg
     329                                 (string-append "*((C_word*)lf[" (number->string index) "]+1)"))
     330                               (gen "C_retrieve_symbol_proc(lf[" index "])") ))
     331                        (gen ")(" nf #\, carg #\,)
     332                        (expr-args args i)
     333                        (gen ");") ) )
    307334                     (else
    308335                      (gen #t #\t nc #\=)
  • chicken/trunk/chicken.h

    r11149 r12631  
    12631263C_fctexport C_word C_fcall C_retrieve2(C_word val, char *name) C_regparm;
    12641264C_fctexport void *C_fcall C_retrieve_proc(C_word closure) C_regparm;
     1265C_fctexport void *C_fcall C_retrieve_symbol_proc(C_word sym) C_regparm;
     1266C_fctexport void *C_fcall C_retrieve2_symbol_proc(C_word val, char *name) C_regparm;
    12651267C_fctexport C_word C_fcall C_permanentp(C_word x) C_regparm;
    12661268C_fctexport int C_in_stackp(C_word x) C_regparm;
  • chicken/trunk/expand.scm

    r12630 r12631  
    4949(cond-expand
    5050 ((not debugbuild)
     51  (declare
     52    (no-bound-checks)
     53    (no-procedure-checks))
    5154  (cond-expand
    5255   (hygienic-macros
  • chicken/trunk/rules.make

    r12630 r12631  
    12601260        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
    12611261setup-api.import.c: $(SRCDIR)setup-api.scm
    1262         $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1262        $(CHICKEN) $(SRCDIR)setup-api.import.scm $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
    12631263setup-download.import.c: $(SRCDIR)setup-download.scm
    1264         $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1264        $(CHICKEN) $(SRCDIR)setup-download.import.scm $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
    12651265setup-utils.import.c: $(SRCDIR)setup-utils.scm
    1266         $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1266        $(CHICKEN) $(SRCDIR)setup-utils.import.scm $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
    12671267
    12681268chicken.c: $(SRCDIR)chicken.scm $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
  • chicken/trunk/runtime.c

    r12476 r12631  
    35603560C_regparm C_word C_fcall C_retrieve(C_word sym)
    35613561{
    3562   C_word val = C_u_i_car(sym);
     3562  C_word val = C_block_item(sym, 0);
    35633563
    35643564  if(val == C_SCHEME_UNBOUND)
     
    36193619{
    36203620  closure = resolve_procedure(closure, NULL);
     3621
     3622#ifndef C_NO_APPLY_HOOK
     3623  if(C_block_item(apply_hook_symbol, 0) != C_SCHEME_FALSE) {
     3624    C_mutate(&C_block_item(last_applied_procedure_symbol, 0), closure);
     3625    return (void *)C_block_item(C_block_item(apply_hook_symbol, 0), 0);
     3626  }
     3627#endif
     3628
     3629  return (void *)C_block_item(closure, 0);
     3630}
     3631
     3632
     3633C_regparm void *C_fcall C_retrieve_symbol_proc(C_word sym)
     3634{
     3635  C_word val = C_block_item(sym, 0);
     3636  C_word closure;
     3637
     3638  if(val == C_SCHEME_UNBOUND)
     3639    val = C_get_unbound_variable_value_hook(sym);
     3640
     3641  closure = resolve_procedure(val, NULL);
     3642
     3643#ifndef C_NO_APPLY_HOOK
     3644  if(C_block_item(apply_hook_symbol, 0) != C_SCHEME_FALSE) {
     3645    C_mutate(&C_block_item(last_applied_procedure_symbol, 0), closure);
     3646    return (void *)C_block_item(C_block_item(apply_hook_symbol, 0), 0);
     3647  }
     3648#endif
     3649
     3650  return (void *)C_block_item(closure, 0);
     3651}
     3652
     3653
     3654C_regparm void *C_fcall C_retrieve2_symbol_proc(C_word val, char *name)
     3655{
     3656  C_word closure;
     3657  C_word *p;
     3658  int len;
     3659
     3660  if(val == C_SCHEME_UNBOUND) {
     3661    len = C_strlen(name);
     3662    p = C_alloc(C_SIZEOF_STRING(len));  /* this is ok: we won't return from `C_retrieve2' (or the value isn't needed). */
     3663    val = get_unbound_variable_value(C_string2(&p, name));
     3664  }
     3665
     3666  closure = resolve_procedure(val, NULL);
    36213667
    36223668#ifndef C_NO_APPLY_HOOK
Note: See TracChangeset for help on using the changeset viewer.