]> gitweb.factorcode.org Git - factor.git/commit
Support declaring intervals as well as classes for the optimizing compiler
authortimor <timor.dd@googlemail.com>
Thu, 15 Aug 2019 09:40:26 +0000 (11:40 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 3 Mar 2021 04:58:56 +0000 (20:58 -0800)
commita1b6f4672be184ee9ff9a06ce2819f0f5a459bba
tree7313ba5141264c697bbf9868ac5804bfbbed1101
parente80dd07ba38c35d1f1b7698e44094c26cf9bb9de
Support declaring intervals as well as classes for the optimizing compiler

A `{ class } declare` call will now also refine the value info if the `class`
word has a valid interval in the "declared-interval" property.

This allows certain optimizations during value propagation passes in the
frontend compiler.

For easier usage, a new vocabulary `math.intervals.predicates` is supplied.

Union and intersection classes are also considered when determining the interval.

The compiler makes use of this in `compile.tree.propagation.info` in
`class-interval`.

This also ensures that whenever the frontend determines that a value has a class
with interval declaration, the interval slot of the value-info is initialized
correctly.
basis/compiler/tree/propagation/info/info.factor
basis/compiler/tree/propagation/simple/simple.factor
basis/math/intervals/predicates/predicates-docs.factor [new file with mode: 0644]
basis/math/intervals/predicates/predicates-tests.factor [new file with mode: 0644]
basis/math/intervals/predicates/predicates.factor [new file with mode: 0644]
basis/math/intervals/predicates/summary.txt [new file with mode: 0644]
core/classes/classes.factor