Parent Directory | Revision Log
|Links to HEAD:||(view) (annotate)|
|Links to release-19b-pre2:||(view) (annotate)|
Fix problems with THE detected by Paul Dietz' tests. This also fixes the problem that CMUCL generated RETURN-MULTIPLE without a good reason. * src/compiler/checkgen.lisp (values-types-asserted): Use coerce-to-values again. Add fixme comments and #+nil code for known problems; these aren't new problem, though. * src/code/type.lisp (coerce-to-values): Don't add &rest t, which is the business of THE. (values) <type translator>: Disallow &key and &allow-other-keys. * src/compiler/ir1tran.lisp (the) <IR1 translator>: Add &rest t where appropriate, or-in null type into required types, for missing values.
Fix for various ANSI test cases that fail when compiled because argument type checks are constant-folded away. * src/compiler/ir1opt.lisp (constant-fold-call): In safe code, don't constant-fold a call if one of its arguments requires a type check. * src/compiler/checkgen.lisp (probable-type-check-p): Return true for :error type-checks if safety = 3. Fix ENDP.* test failures when running tests compiled. From SBCL, basically. * src/compiler/ir1opt.lisp (ir1-optimize, ir1-optimize-if): Don't eliminate if-tests requiring type checks. * src/compiler/checkgen.lisp (continuation-check-types): Add parameter force-hairy. (generate-type-checks): Call continuation-check-types with force-hairy true for :error continuations in safe code.
The SEQUENCE-COUNT type was previously used in c:fndb, but since C::SEQUENCE-COUNT /= KERNEL::SEQUENCE-COUNT, it was an unknown type. Please read boot4.lisp. * src/code/exports.lisp ("KERNEL"): Export sequence-count. * src-types/bootfiles/18e/boot4.lisp: New file. Make compute-effective-slot-definition AMOP compliant. Patch from Kevin Rosenberg. * src/pcl/std-class.lisp (compute-slots): Pass slot name to compute-effective-slot-definition. (compute-slots): Likewise. (compute-effective-slot-definition): Add parameter slot-name. * src/pcl/generic-functions.lisp (compute-effective-slot-definition): Add second parameter slot-name. Allow non-keyword keyword names in lambda lists. This fixes test cases STRUCTURE-BOA-TEST-15/[1-8], and FLET.30. * src/compiler/node.lisp (arg-info): Accept non-keyword keyword names. * src/code/type.lisp (key-info): Likewise. Fix type system bugs detected by Paul Dietz' test suite This is to a large extent a port from SBCL. * src/code/type.lisp: Mostly rewritten with code ported from SBCL. * src/compiler/typetran.lisp (ir1-transform-type-predicate): Return nil if type is *empty-type*. (source-transform-negation-typep) (source-transform-intersection-typep): New functions. (source-transform-array-typep): Handle unknown array element types. (typep): Add handling of negation and intersection types. * src/compiler/srctran.lisp (make-canonical-union-type): Simplify, now that #'type-union is smarter. (ir1-transform-<-helper): Give up on non-numeric, non-member types. * src/compiler/checkgen.lisp (type-test-cost): Add a case for intersection-type. (values-types-asserted): Don't use coerce-to-values, see the comment there. * src/compiler/array-tran.lisp (array-dimension): Accept :maybe as array-type-complexp. * src/code/pred.lisp (%%typep): Add handling of negation-types and intersection-types. Change cases of hairy-types, union-types, and arrays with unknown element type. * src/code/exports.lisp ("KERNEL"): Export negation-type, negation-type-type, intersection-type, intersection-type-types. * src/code/class.lisp (sealed-class-intersection): Return one value. (class :simple-intersection): Return one value, return nil in the default case. (class :complex-subtypep-arg2): New type method.
Enhancement to continuation-check-types: even when the proven type represents an unknown number of values, if Cont's destination receives only a single value, generate a :hairy type check for the single-values-type of the asserted type.
Reworking of the values-type system to overcome a number of inconsistencies causing problems: o Redefine coerce-to-values to convert a single value type into (values type), rather than the former definition (values type &rest t). A single value type such as fixnum is now equivalent to (values fixnum). Values-type-union and values-type-intersection will canonicalise values types with a single value such as (values fixnum) back to a single value type such as fixnum. o Now when the compiler makes assertions for the first value of continuations that may be generating multiple values it asserts the type as (values type &rest t), or as (value &optional type &rest t) if it is not sure that the continuation does generate a value. o Enhance the type check generation to better handle the now common values types with optional and rest arguments. Add the new function Values-types-asserted which converts asserted optional and rest arguments to required arguments that have been proven to be delivered, Thus an assertion such as (values &optional fixnum &rest t) will generate a fixnum type check if the proven type if (values t). o The compiler is now far more likely to pickup attempts to use an assertion to select a subset of values. For example (the (values fixnum) (values x y)) will generated a compiler warning. o Update single values type assertions where appropriate to clarify that the received values may be optional or that multiple values may be received. For example, a macro argument which had been asserted to be a list via (the list ,...) would now be asserted to be (the (values &optional list &rest t)) etc. o Have the IR1 translator for THE convert single value types into (values &optional type &rest t) so that code such as (the fixnum (values x y)) will still work acceptably. This does not restrict the possible type assertions as the values types may be used and are not modified.
o Recheck the asserted against the proven type for each type in a values-type, because the continuation is flagged for a type check if any of the types needs to be checked and some may not need checking. o Split the function no-function-values-types out into a call to values-type followed by the new function no-function-types as this later functionality is useful on its own.
Implement a specializing CONS class as per issue CONS-TYPE-SPECIFIER:ADD. The new cons-type which maintains the specialised CAR and CDR types: o Typep recurses, checking the respective car and cdr specialisations; two cons-types are type= if both their car and cdr types are type=. o Subtypep recurses, applying subtypep to the respective car and cdr types. If both sub-tests return true then the cons test returns true with a win only when both sub-tests win. If either sub-test returns false then the cons tests returns false with a win if either of sub-tests win. o Type-intersection is applied to the respective car and cdr types, and wins if both win. o The type-union of two cons-types handles cases for which either the respective car or cdr types are type=, in which case type-union is applied to the other type. This avoid returning an overly general result. o Ctype-of a cons object simply returns (cons * *); and does not attempt to recurse. o The compiler recursively checks the specialised type of the cons-type, which allows it to also use this type information to derive the result type car and cdr. Inline code is currently only generated when natively compiling.
Fix doc. typos "the the" -> "the".
Delay the generation of the type checks delayed until all the type check decisions have been made because the generation of the type checks creates new nodes who's derived types aren't always updated which may lead to inappropriate template choices due to the modification of argument types.
Fix headed boilerplate.
Fix compiler warnings.
Changed erroneous calls to be :ERROR kind, not :FULL
If *byte-compiling*, only do compile-type type error checking. No check conversion is done, since this violates stack discipline. All type checks are done on the fly during byte conversion.
Don't call CONTINUATION-CHECK-TYPES if PROBABLE-TYPE-CHECK-P returns NIL. This lets type checking assume that the continuation does have a DEST, and also avoids some unnecessary work.
Moved *type-predicate* and *predicate-type* into the backend structure.
Added a switch the disable the complementing optimization of type checks (for testing its effectiveness.)
New file header with RCS stuff.
Changed MAYBE-NEGATE-CHECK to allow weakened checks to be simple when debug-info is not important, so that we can use CHECK-STRUCTURE, etc. Changed TYPE-TEST-COST to penalize predicates as opposed to check templates so that we will use a check template in favor of a "same cost" predicate.
Pass *backend* to sc-or-lose and friends to assure we extract the info from the correct backend for runtime.
Changed DO-TYPE-WARNING to ignore uses whose type is NIL, and also tweaked output format a bit.
Force type check conversion of continuations that may be forced to unknown values even though they are really fixed-values (and people might be depending on the check, like non-local RETURN-FROM.) Don't do an inline type check for the argument of a full call, even when we are "sure" that there is an error, since the user might want to fix the problem by redefining the callee, and not by changing the caller (or callers.) Spiffed up type error warnings to use the variable we are binding to as context when doing a local call. Also, instead of saying we "got NIL", we say we got an expression that didn't return. Changed type error checking to consistently flame about all losing uses of a continuation, instead of maybe only flaming about the first one, or even totally missing it if the first use we see is non-erroneous but hairy. Also, don't do type warnings on continuations with :DELETE TYPE-CHECK, since those are the result of hairy type checks.
Fixed GENERATE-TYPE-CHECKS to always give a warning when any use of the continuation is incorrect, instead of only warning when the first use happened to be incorrect.
Flushed cleanup hackery, since the lexenv changes make this unnecessary.
Added use of *unparse-function-type-simplify* to prevent complex function types from being checked, even when they are buried in other types (like OR.)
Added NO-FUNCTION-VALUES-TYPES and made people use it so that they aren't confused by complex function types.
Changed MAYBE-WEAKEN-CHECK to accept a type if there is a predicate for that exact type, rather than possibly blowing off the check entirely.
Oops... We can't negate a check and weaken it too. Choose whichever is cheaper.
Changed PROBABLE-TYPE-CHECK-P to return T when we are unable to determine when VALID-FUNCTION-USE is unable to determine the whether the template applies. If the VOP operand is unrestrictive, but we know it is of an unknown type, then the type-operation will fail but the template can still be selected, since PRIMITIVE-TYPE isn't fooled.
Changed type check weakening not to choose supertypes that are union types (i.e. COMMON). Also, we don't preserve the original check just because there was some supertype predicate.
Type warnings only inhibited when brevity = 3.
Added type check weakening (conditional on policy), and made type checks be totally flushed only when safety = 0. Also, when printing a type warning, check to see if the losing value is a constant, and if so, print it instead of its type.
Added code to make known calls unknown if there is an argument with a type error.
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.
|Powered by ViewVC 1.1.5|