Skip to content

Instantly share code, notes, and snippets.

@stassats
stassats / xref.lisp
Created March 31, 2024 00:54
xref call-tree
(defun call-tree (function output-file &optional allow-packages)
(with-open-file (stream output-file :if-exists :supersede
:if-does-not-exist :create
:direction :output)
(write-line "digraph G {" stream)
(write-line "node [fontname = \"monospace\"];" stream)
(write-line "node [shape=box];" stream)
(let ((id 0)
(ids (make-hash-table :test #'eq))
(allow-packages (mapcar #'find-package allow-packages)))
diff --git a/swank/sbcl.lisp b/swank/sbcl.lisp
index a09e04b3..78038659 100644
--- a/swank/sbcl.lisp
+++ b/swank/sbcl.lisp
@@ -979,7 +979,8 @@ QUALITIES is an alist with (quality . value)"
(make-location `(:file ,(namestring
(translate-logical-pathname pathname)))
'(:position 1)
- (when (eql type :function)
+ (when (and (eql type :function)
git clone git://git.code.sf.net/p/sbcl/sbcl-page
cp ~/lisp/impl/sbcl /tmp/sbcl
cd /tmp/sbcl
git checkout sbcl-2.0.0
cd ~/c/sbcl-page
git pull
rmdir sbcl
ln -s /tmp/sbcl .
(defun foo (&rest params)
(if params
(assert (every #'null params))))
(defvar *x*
(make-list 10000))
(loop repeat 8
do (sb-thread:make-thread
(lambda ()
#define _GNU_SOURCE
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include <fenv.h>
jmp_buf unwind;
void handler(int signum)
{
(sb-c:defknown simd-ref ((simple-array double-float (*)) sb-int:index)
(simd-pack double-float)
(sb-c:movable sb-c:flushable sb-c:always-translatable)
:overwrite-fndb-silently t)
(define-vop (simd-ref)
(:translate simd-example::simd-ref)
(:policy :fast-safe)
(:args (array :scs (descriptor-reg))
(index :scs (any-reg)))
(defun test (a b)
(declare (optimize speed (debug 1)))
(labels ((fun ()
10))
(if a
(if b
(+ (fun) 2)
(fun)))))
(defun test (a b)
diff --git a/src/assembly/master.lisp b/src/assembly/master.lisp
index 24393760f..b5d3186f8 100644
--- a/src/assembly/master.lisp
+++ b/src/assembly/master.lisp
@@ -4,6 +4,7 @@
(make-pathname :type "lisp"))
:verbose nil :print nil))
'("src/assembly/target/tramps"
+ "src/assembly/target/runtime-rtns"
"src/assembly/target/assem-rtns"
(defun foo (f a b)
(declare (optimize (debug 1)))
(labels ((fun (z)
(let ((m z))
;; delays type derivation of FUN as FIXNUM until constraint propagation
;; making sure SUBSTITUTE-SINGLE-USE-LVAR runs first.
(if (typep m 'fixnum)
m
0))))
(declare (inline fun))
# -*- makefile -*- for the C-level run-time support for SBCL
# This software is part of the SBCL system. See the README file for
# more information.
#
# This software is derived from the CMU CL system, which was
# written at Carnegie Mellon University and released into the
# public domain. The software is in the public domain and is
# provided with absolutely no warranty. See the COPYING and CREDITS
# files for more information.