diff options
author | Andy Wingo <wingo@pobox.com> | 2015-01-19 16:57:42 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2015-01-22 13:03:11 +0100 |
commit | e2fafeb9012cbe5e3ec63326692a4cc3a22c318e (patch) | |
tree | c056156667ddc699727789114a75f1589a66237f /module/system/base | |
parent | 27b3b5b92d22cbf672d5b0ad20b4efe6cfa80ecf (diff) |
Keywords have a tc7
* libguile/tags.h (scm_tc7_keyword): Allocate a tc7, so that the VM can
have cheap keyword? tests.
* libguile/keywords.c:
* libguile/keywords.h: Adapt.
* libguile/goops.c (scm_class_of, scm_sys_goops_early_init): Capture
<keyword>.
* libguile/print.c (iprin1): Inline keyword printer.
* libguile/evalext.c (scm_self_evaluating_p): Add keywords here.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_tc16_keyword): Deprecate.
* module/language/cps/compile-bytecode.scm (compile-fun): Add keyword?
case, and bitvector? case while we're at it.
* module/language/cps/effects-analysis.scm (define-primitive-effects):
Add bytevector?, keyword?, and bitvector? cases.
* module/language/cps/primitives.scm (*branching-primcall-arities*): Add
keyword?.
* module/language/cps/types.scm (bitvector?, keyword?, bytevector?): Add
branch inferrers.
* module/language/tree-il/primitives.scm (*interesting-primitive-names*):
(*effect-free-primitives*):
(*effect+exception-free-primitives*): Add bytevector?, keyword?, and
bitvector?.
* module/oop/goops.scm (<keyword>): New class.
* module/system/base/types.scm (%tc7-keyword, cell->object): Add cases.
* module/system/vm/assembler.scm (br-if-keyword): New definition.
* module/system/vm/disassembler.scm (code-annotation): Add br-if-tc7
case for keywords.
* test-suite/tests/types.test ("clonable objects"): Update now that
keywords are cloneable.
Diffstat (limited to 'module/system/base')
-rw-r--r-- | module/system/base/types.scm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/module/system/base/types.scm b/module/system/base/types.scm index 6c1d40d7f..c051b3171 100644 --- a/module/system/base/types.scm +++ b/module/system/base/types.scm @@ -1,5 +1,5 @@ ;;; 'SCM' type tag decoding. -;;; Copyright (C) 2014 Free Software Foundation, Inc. +;;; Copyright (C) 2014, 2015 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 License as published by @@ -251,6 +251,7 @@ the matching bits, possibly with bitwise operations to extract it from BITS." (define %tc7-stringbuf 39) (define %tc7-dynamic-state 45) (define %tc7-frame 47) +(define %tc7-keyword 53) (define %tc7-program 69) (define %tc7-vm-continuation 71) (define %tc7-bytevector 77) @@ -472,6 +473,8 @@ using BACKEND." (inferior-object 'hash-table address)) (((_ & #x7f = %tc7-pointer) address) (make-pointer address)) + (((_ & #x7f = %tc7-keyword) symbol) + (symbol->keyword (cell->object symbol backend))) (((_ & #x7f = %tc7-vm-continuation)) (inferior-object 'vm-continuation address)) (((_ & #x7f = %tc7-weak-set)) |