Merge branch 'master' of git://factorcode.org/git/factor
commit
09cd5b3446
|
@ -1,5 +1,5 @@
|
|||
IN: alien.tests
|
||||
USING: alien alien.accessors alien.syntax byte-arrays arrays
|
||||
USING: accessors alien alien.accessors alien.syntax byte-arrays arrays
|
||||
kernel kernel.private namespaces tools.test sequences libc math
|
||||
system prettyprint layouts ;
|
||||
|
||||
|
@ -65,6 +65,10 @@ cell 8 = [
|
|||
|
||||
[ f ] [ 0 B{ 1 2 3 } <displaced-alien> pinned-c-ptr? ] unit-test
|
||||
|
||||
[ f ] [ 0 B{ 1 2 3 } <displaced-alien> 1 swap <displaced-alien> pinned-c-ptr? ] unit-test
|
||||
|
||||
[ t ] [ 0 B{ 1 2 3 } <displaced-alien> 1 swap <displaced-alien> underlying>> byte-array? ] unit-test
|
||||
|
||||
[ "( displaced alien )" ] [ 0 B{ 1 2 3 } <displaced-alien> unparse ] unit-test
|
||||
|
||||
[ f ] [ DLL" fadfasdfsada" dll-valid? ] unit-test
|
||||
|
|
|
@ -2,20 +2,31 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors assocs words sequences arrays compiler
|
||||
tools.time io.styles io prettyprint vocabs kernel sorting
|
||||
generator optimizer math math.order ;
|
||||
generator optimizer math math.order math.statistics combinators ;
|
||||
IN: report.optimizer
|
||||
|
||||
: count-optimization-passes ( nodes n -- n )
|
||||
>r optimize-1
|
||||
[ r> 1+ count-optimization-passes ] [ drop r> ] if ;
|
||||
|
||||
: results
|
||||
[ [ second ] prepose compare ] curry sort 20 tail*
|
||||
print
|
||||
: table. ( alist -- )
|
||||
20 short tail*
|
||||
standard-table-style
|
||||
[
|
||||
[ [ [ pprint-cell ] each ] with-row ] each
|
||||
] tabular-output ; inline
|
||||
] tabular-output ;
|
||||
|
||||
: results ( results quot title -- )
|
||||
print
|
||||
[ second ] prepose
|
||||
[ [ compare ] curry sort table. ]
|
||||
[
|
||||
map
|
||||
[ "Mean: " write mean >float . ]
|
||||
[ "Median: " write median >float . ]
|
||||
[ "Standard deviation: " write std >float . ]
|
||||
tri
|
||||
] 2bi ; inline
|
||||
|
||||
: optimizer-measurements ( -- alist )
|
||||
all-words [ compiled>> ] filter
|
||||
|
@ -26,8 +37,10 @@ IN: report.optimizer
|
|||
] { } map>assoc ;
|
||||
|
||||
: optimizer-measurements. ( alist -- )
|
||||
[ [ first ] "Worst number of optimizer passes:" results ]
|
||||
[ [ second ] "Worst compile times:" results ] bi ;
|
||||
{
|
||||
[ [ first ] "Optimizer passes:" results ]
|
||||
[ [ second ] "Compile times:" results ]
|
||||
} cleave ;
|
||||
|
||||
: optimizer-report ( -- )
|
||||
optimizer-measurements optimizer-measurements. ;
|
||||
|
|
|
@ -62,7 +62,7 @@ CELL allot_alien(CELL delegate, CELL displacement)
|
|||
{
|
||||
F_ALIEN *delegate_alien = untag_object(delegate);
|
||||
displacement += delegate_alien->displacement;
|
||||
alien->alien = F;
|
||||
alien->alien = delegate_alien->alien;
|
||||
}
|
||||
else
|
||||
alien->alien = delegate;
|
||||
|
|
Loading…
Reference in New Issue