diff options
Diffstat (limited to 'module/system/repl/command.scm')
-rw-r--r-- | module/system/repl/command.scm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/module/system/repl/command.scm b/module/system/repl/command.scm index ac1fa0933..0024fd165 100644 --- a/module/system/repl/command.scm +++ b/module/system/repl/command.scm @@ -1,6 +1,6 @@ ;;; Repl commands -;; Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013, 2020 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013, 2020, 2021 Free Software Foundation, Inc. ;; This library is free software; you can redistribute it and/or ;; modify it under the terms of the GNU Lesser General Public @@ -22,10 +22,12 @@ (define-module (system repl command) #:use-module (system base syntax) #:use-module (system base pmatch) - #:use-module (system base compile) + #:autoload (system base compile) (compile-file) #:use-module (system repl common) #:use-module (system repl debug) - #:use-module (system vm disassembler) + #:autoload (system vm disassembler) (disassemble-image + disassemble-program + disassemble-file) #:use-module (system vm loader) #:use-module (system vm program) #:use-module (system vm trap-state) @@ -42,7 +44,7 @@ #:use-module ((ice-9 pretty-print) #:select ((pretty-print . pp))) #:use-module ((system vm inspect) #:select ((inspect . %inspect))) #:use-module (rnrs bytevectors) - #:use-module (statprof) + #:autoload (statprof) (statprof) #:export (meta-command define-meta-command)) @@ -55,7 +57,7 @@ (module (module m) (import use) (load l) (reload re) (binding b) (in)) (language (language L)) (compile (compile c) (compile-file cc) - (expand exp) (optimize opt) + (expand exp) (optimize opt) (optimize-cps optx) (disassemble x) (disassemble-file xx)) (profile (time t) (profile pr) (trace tr)) (debug (backtrace bt) (up) (down) (frame fr) @@ -488,6 +490,11 @@ Run the optimizer on a piece of code and print the result." (run-hook before-print-hook x) (pp x))) +(define-meta-command (optimize-cps repl (form)) + "optimize-cps EXP +Run the CPS optimizer on a piece of code and print the result." + (repl-optimize-cps repl (repl-parse repl form))) + (define-meta-command (disassemble repl (form)) "disassemble EXP Disassemble a compiled procedure." |