(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* test-suite/tests/elisp-compiler.test ("catch without exception" test)
("catch and throw" test, "unwind-protect" test): Switch from pass-if
to expect-fail.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* test-suite/tests/elisp-compiler.test (compile-test): Update to support
expect-fail.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm: Remove import of
"(language tree-il eval)".
(defmacro): Use standard "eval".
* module/language/elisp/runtime.scm: Remove import of "(language tree-il eval)".
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/boot.el (eval): Update with simplified definition.
* module/language/elisp/compile-tree-il.scm: Import "(language tree-il eval)".
(eval-when-compile): Use eval-elisp.
(defmacro): Use eval-tree-il.
* module/language/elisp/runtime.scm: Import "(language tree-il eval)".
(eval-elisp): Use "eval" to evaluate compiled form within current-module.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm (compile-pair): Use
compile-expr-1 instead of compile-expr.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm (defmacro): Check to see
whether toplevel? is true before compiling a macro.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm (let): Conditionally invoke
make-body within make-dynlet or just on its own depending on whether
or not dynamic? is null?.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm (progn): Use compile-expr-1
instead of compile-expr.
(toplevel?, compile-time-too?): New fluids.
(eval-when): New special form.
(compile-expr, compile-expr-1): compile-expr is renamed to
compile-expr-1, and compile-expr is now a procedure which, if
fulid-ref of toplevel? is true, will call compile-expr-1 with
toplevel? fulid bound to #f. Otherwise, continue with compile-expr-1.
(compile-tree-il): Set toplevel? and compile-time-too? fluids to #t
during evaluation.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/boot.el (null, consp, listp, car, cdr): Update
to use defsubst.
(atom): New variable, using defsubst.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/boot.el (%define-compiler-macro): New macro.
* module/language/elisp/compile-tree-il.scm: New function.
(compile-pair): Update to handle %compiler-macro condition.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/compile-tree-il.scm (defconst, defvar): Use
proclaim-special!.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/boot.el
(progn, eval-when-compile, if, defconst, defvar, setq, let, flet)
(labels, let*, function, defmacro, quote): Removed.
* module/language/elisp/compile-tree-il.scm (special-operators): Removed.
(compound-pair): Use find-operator to check if a 'special-operator
rather than checking the now removed special-operators table.
* module/language/elisp/runtime.scm (defspecial): Update to use
set-symbol-function!
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/runtime.scm (value-slot-module)
(function-slot-module, plist-slot-module): Update to set #:pure to #t.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/system/vm/assembler.scm (intern-constant): Switch from using
vector-ref/immediate to make-short-immediate.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/runtime.scm:
(symbol-default-bound?, symbol-default-value, set-symbol-default-value!):
New procedure aliases. Export their symbols.
(emacs!): Update to accept new parameters dref, dset, dboundp.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/elisp/bindings.scm (get-lexical-binding)
(get-function-binding): Use cadr instead of fluid-ref on slot.
(with-fluids**): New procedure.
(with-symbol-bindings, with-function-bindings): Use with-fluids**.
Also stop using "make-fluid", use "(list #f #f)" instead as default
lexical-bindings hashtable value.
(with-lexical-bindings): Drop the error checking for invalid targets.
* module/language/elisp/boot.el (defun, save-excursion)
(save-current-buffer, save-restriction, track-mouse, setq-default)
(catch, condition-case): New macros.
(omega, eval, gensym, interactive, autoload-do-load, fset, prin1)
(backtrace-frame, backtrace, %set-eager-macroexpansion-mode): New functions.
(null, consp, listp, car, cdr, make-symbol, signal): Wrap in eval-and-compile.
(prog1, cond, or, while): Update to make use of gensym.
(unwind-protect): Switch from funcall to %funcall.
(%functionp): Rename from functionp.
(%indirect-function): Update to use %functionp instead of functionp.
Add check for if object is null, signaling void-function. Instead of
calling symbol-function directly, call via %funcall from the module
"(language elisp runtime)".
(fset): Significant additions and refactoring.
(gload): Renamed from fload.
(defvaralias, nthcdr, nth, eq): Move functions to a different location.
(eq): Also stop using null.
(dolist): Remove quasiquoting, build list manually.
(random): Fix indentation.
(progn, eval-when-compile, if, defconst, defvar, setq, let, flet)
(labels, let*, function, defmacro, quote): Protect as special
operators by raising error if invoked as a function.
* module/language/elisp/compile-tree-il.scm: Import "(ice-9 format)".
Export compile-%function.
(lexical-binding, handle-var-def, defun, valid-symbol-list-arg?)
(process-options!): Remove.
(reference-variable): Adjust functions passed to access-variable.
(global?): Drop module parameter, use value-slot instead.
(ensure-globals!, set-variable!, parse-body-1, parse-lambda-list)
(compile-lambda, defconst, defvar, let, let*, compile-pair): Refactor.
(reference-function): Use '(elisp-functions) instead of function-slot.
(bind-lexically?): Drop module parameter, simplify.
(make-dynlet): Switch from using make-primcall to make-call.
(find-operator): Switch from using resolve-interface/resolve-module
to using function-slot.
(if, defconst, defvar, let, let*, flet, labels, guile-ref)
(guile-private-ref, guile-primitive, defmacro, `, quote, %funcall)
(%set-lexical-binding-mode): Add error checking.
(setq): Pass in args to report-error.
(function): Simplified, now calling %function.
(%function): New function, based on prior "function". Refactor, including
adding support for matching against a closure.
(%set-lexical-binding-mode): Switch from using fluid-set! to
set-lexical-binding-mode.
(special-operators): New variable. Build from following for-each
statement.
(compile-tree-il): Drop call to "process-options!"
* module/language/elisp/lexer.scm: Import "(language elisp runtime)".
(lex): Switch from using "list->string" to "make-lisp-string".
* module/language/elisp/runtime.scm: Use modules "(ice-9 format)",
"(system base compile)".
Remove from export list list, removing ensure-fluid!, symbol-fluid!,
set-symbol-fluid!. Add to export list ensure-dynamic!, symbol-name,
symbol-plist, set-symbol-plist!, bind-symbol, symbol-desc, proclaim-symbol!
special? emacs! unbound, lexical-binding?, set-lexical-binding-mode,
log!, eval-elisp, local-eval-elisp, make-lisp-string, lisp-string?
(make-list-string, lisp-string?) New function aliases.
(value-slot-module, function-slot-module): Adjust module resolution.
(nil_, t_): New variables.
(ensure-fluid!, symbol-fluid, set-symbol-fluid!): Removed.
(lexical-binding, unbound): New variables.
(lexical-binding?, set-lexical-binding-mode, unbound, dynamic?)
(make-dynamic, dynamic-ref, dynamic-set!, dynamic-unset!)
(dynamic-bound?, dynamic-bind, ensure-present!, ensure-desc!)
(schemify, symbol-name, symbol-desc, ensure-dynamic!, symbol-dynamic)
(set-symbol-plist!, special?, proclaim-special!, emacs!, eval-elisp)
(make-string): New procedures.
(symbol-value): Use dynamic-ref! instead of fluid-ref!.
(set-symbol-value!): Use dynamic-set! instead of fluid-set!.
(symbol-function, set-symbol-function!, symbol-bound?)
(symbol-fbound?, makunbound!, fmakunbound!): Refactor, including
adjusting how module resolution is being done.
* module/language/elisp/spec.scm: Import module "(system vm vm)".
Setup elisp-symbols, elisp-functions, elisp-plists.
Use "set-default-vm-engine!" and "set-vm-engine!" to be set to
'debug.
(elisp): Comment out joiner.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/language/cps/types.scm (constant-type): No longer error
if type not determined. Return &all-types instead.
* libguile/symbols.c (lookup_uninterned_symbol)
(lookup_interned_latin1_symbol, lookup_interned_utf8_symbol)
(scm_i_str2symbol): Take an `obarray' argument. All callers changed.
(scm_make_obarray, scm_find_symbol, scm_intern, scm_unintern)
(scm_obarray_for_each): New functions.
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* module/system/vm/assembler.scm (intern-constant, link-data):
Update to check "symbol-interned?".
(Best-ability ChangeLog annotation added by Christopher Allan Webber.)
* libguile/loader.c (load_thunk_from_memory): Refactor, adding
"constants" argument and passing to "init" if appropriate.
(load_thunk_from_file): Call "load-thunk-from-memory" with
"constants" set to #f.
(scm_load_thunk_from_memory): Instead of a bytevector, accept
a cons of "(bytevector . constants)", where constants is either
a vector or #f. Pass this into "load_thunk_from_memory".
* module/language/bytecode/spec.scm: Adapt printer.
* module/language/cps/compile-bytecode.scm (compile-bytecode):
New variable.
* module/system/repl/command.scm (disassemble):
Adapt to expect pair which includes bytevector as its car.
* module/system/vm/assembler.scm <asm>: Add "to-file?" slot.
(fresh-block): New variable.
(make-assembler): Adapt to expect "to-file?" keyword argument.
(intern-constant): Support "asm-to-file?" in checks.
(emit-init-constants, link-data): Likewise.
(link-assembly): Update logic for handling "(bytevector . constants)"
pair, as well as the expectations of its invocation by compile-bytecode.
* module/language/cps/types.scm (type-entry-saturating-union): Fix range
saturation in the negative direction. Previously we were artificially
truncating negative range ends to zero.
* module/statprof.scm: Remove most of the commentary, as it was
duplicated in the manual and was getting out of date.
(stats): Remove self-secs-per-call and cum-secs-per-call fields as
they can be computed from the other fields.
(statprof-call-data->stats): Adapt.
(statprof-stats-self-secs-per-call):
(statprof-stats-cum-secs-per-call): New functions.
(statprof-display/flat): Don't print the seconds-per-call fields, as
we are no longer stopping the clock around call counters. Anyway
these times were quite misleading.
(with-statprof): Deprecate. It took its keyword arguments at the
beginning; very complicated! Better to use the `statprof' function.
(`statprof' was introduced after `with-statprof' and then
`with-statprof' was adapted to use it.)
* doc/ref/statprof.texi (Statprof): Port this documentation away from
the automatically generated text and update it for the new interfaces
like #:display-style.
* module/system/base/syntax.scm (record-case): Remove comment that
referenced with-statprof. Add comment indicating that record-case
should be replaced.
* doc/ref/scheme-using.texi (Profile Commands): Update to mention
keyword arguments and to link to the statprof documentation.
* module/statprof.scm: Update commentary.
(count-call): Don't bother stopping and starting the timer. The
overhead of call counting perturbs timing too much already, and
somewhat paradoxically stopping and starting the timer takes too much
time.
(skip-count-call): New function.
(stack-samples->procedure-data, stack-samples->callee-lists): If we
are counting calls, skip any part of the stack that is inside
count-call.
* module/system/repl/debug.scm (print-locals): Adapt to
frame-binding-ref change.
* module/system/vm/frame.scm (<binding>): Add `frame' field.
(available-bindings): Capture the frame.
(binding-ref, binding-set!): New functions, accessing a local variable
value directly from a frame.
(frame-binding-ref, frame-binding-set!): Remove. As these are very
low-level debugging interfaces introduced in 2.0, never documented,
and quite tied to the VM, we feel comfortable making this change.
(frame-call-representation): Adapt to available-bindings change.
(frame-environment, frame-object-binding): Adapt to binding-ref
interface change.
* doc/ref/vm.texi (Stack Layout): Mention that slots can be re-used.
Update disassembly in example.
* doc/ref/api-debug.texi (Frames): Remove documentation for
frame-local-ref, frame-local-set!, and frame-num-locals. Replace with
documentation for frame-bindings, binding accessors, and binding-ref /
binding-set!.
* libguile/frames.h (scm_frame_num_locals, scm_frame_local_ref)
(scm_frame_local_set_x): Remove. As long as we are changing the
interface in a backward-incompatible way, we might as well remove
these.
* libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref)
(scm_frame_local_set_x, scm_init_frames_builtins, scm_init_frames):
Arrange to make frame-local-ref et al private to frames.scm.
* module/system/vm/frame.scm: Load scm_init_frames_builtins extensions.
(frame-instruction-pointer-or-primitive-procedure-name): New public
function.
(frame-binding-ref, frame-binding-set!): Allow binding objects as
vars.
* module/system/repl/debug.scm (print-locals): Pass binding directly to
frame-binding-ref.
* module/statprof.scm (sample-stack-procs, count-call): Use new
frame-instruction-pointer-or-primitive-procedure-name function.
* module/system/vm/assembler.scm (define-byte-order-swapper): New
helper.
(byte-swap/2!, byte-swap/4!, byte-swap/8!): New functions.
(link-data): Swap bytes in uniform vectors on foreign byte orders.
* am/bootstrap.am: New file, factored out of bootstrap/Makefile.am.
* bootstrap/Makefile.am: Use bootstrap.am.
* prebuilt/Makefile.am:
* prebuilt/i686-pc-linux-gnu/Makefile.am:
* prebuilt/mips-unknown-linux-gnu/Makefile.am:
* prebuilt/x86_64-unknown-linux-gnu/Makefile.am: New files.
* configure.ac: Output the prebuilt/ makefiles.
* Makefile.am: Descend into prebuilt/ when making dist.
* meta/uninstalled-env.in: Arrange to put prebuilt/ in the beginning of
the GUILE_LOAD_COMPILED_PATH. Also fix a case where bootstrap/ wasn't
being correctly added to the load path.
* module/system/vm/assembler.scm (immediate-bits): Rename from
immediate?, and return the bits. Take asm argument so that we measure
what's an immediate not on the host but for the target. Adapt all
callers.
(write-immediate): Take bits instead of SCM object. Adapt callers.
(write-placeholder): New helper, to write bits for #f. Adapt callers
that wrote #f to use write-placeholder.