Skip to content
  • Andy Wingo's avatar
    Remove primitive?, add primitive-code? · 8af3423e
    Andy Wingo authored
    We need to be able to identify frames that are primitive applications
    without assuming that slot 0 in a frame is an SCM value and without
    assuming that value is the procedure being applied.
    
    * libguile/gsubr.c (scm_i_primitive_code_p): New helper.
      (scm_i_primitive_arity): Use the new helper.
    * libguile/gsubr.h: Declare the new helper.
    
    * libguile/programs.h:
    * libguile/programs.c (scm_program_code_p): New function, replacing
      scm_primitive_p.
      (scm_primitive_call_ip): Fix FUNC_NAME definition.
    
    * module/statprof.scm (sample-stack-procs, count-call): Identify
      primitive frames from the IP, not the frame-procedure.  Avoids the
      assumption that slot 0 in a frame is a SCM value.
      (statprof-proc-call-data): Adapt to primitive-code? change.
    
    * module/system/vm/frame.scm (frame-call-representation): Identify
      primitive frames from the IP, not the closure.  Still more work to do
      here to avoid assuming slot 0 is a procedure.
    
    * module/system/vm/program.scm: Export primitive-code? instead of
      primitive?.
      (program-arguments-alist, program-arguments-alists): Identify
      primitives from the code instead of the flags on the program.  Not
      sure this is a great change, but it does avoid having to define a
      primitive? predicate in Scheme.
    8af3423e