Use -unsafe words with pair methods.
parent
bddd66f5f3
commit
b571a42679
|
@ -65,7 +65,7 @@ M: integer (bitfield-quot) ( spec -- quot )
|
|||
[ swapd shift bitor ] curry ;
|
||||
|
||||
M: pair (bitfield-quot) ( spec -- quot )
|
||||
first2 over word? [ [ swapd execute ] dip ] [ ] ?
|
||||
first2-unsafe over word? [ [ swapd execute ] dip ] [ ] ?
|
||||
[ shift bitor ] append 2curry ;
|
||||
|
||||
PRIVATE>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.data arrays byte-arrays compiler.units destructors
|
||||
io kernel libc math quotations sequences stack-checker system tr
|
||||
vocabs words ;
|
||||
USING: alien alien.data arrays byte-arrays compiler.units
|
||||
destructors io kernel libc math quotations sequences
|
||||
sequences.private stack-checker system tr vocabs words ;
|
||||
IN: tools.disassembler
|
||||
|
||||
GENERIC: disassemble ( obj -- )
|
||||
|
@ -29,11 +29,14 @@ M: byte-array disassemble
|
|||
2array disassemble
|
||||
] with-destructors ;
|
||||
|
||||
M: pair disassemble first2 [ (>address) ] bi@ disassemble* [ tabs>spaces print ] each ;
|
||||
M: pair disassemble
|
||||
first2-unsafe [ (>address) ] bi@ disassemble*
|
||||
[ tabs>spaces print ] each ;
|
||||
|
||||
M: word disassemble word-code 2array disassemble ;
|
||||
|
||||
M: quotation disassemble [ dup infer define-temp ] with-compilation-unit disassemble ;
|
||||
M: quotation disassemble
|
||||
[ dup infer define-temp ] with-compilation-unit disassemble ;
|
||||
|
||||
cpu x86?
|
||||
"tools.disassembler.udis"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2006, 2010 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays classes combinators kernel make math
|
||||
math.order math.parser sequences strings words ;
|
||||
math.order math.parser sequences sequences.private strings words ;
|
||||
IN: effects
|
||||
|
||||
TUPLE: effect
|
||||
|
@ -53,7 +53,7 @@ M: string effect>string ;
|
|||
M: object effect>string drop "object" ;
|
||||
M: word effect>string name>> ;
|
||||
M: integer effect>string number>string ;
|
||||
M: pair effect>string first2 [ effect>string ] bi@ ": " glue ;
|
||||
M: pair effect>string first2-unsafe [ effect>string ] bi@ ": " glue ;
|
||||
|
||||
: stack-picture ( seq -- string )
|
||||
[ [ effect>string % CHAR: \s , ] each ] "" make ;
|
||||
|
@ -77,7 +77,7 @@ M: effect effect>string ( effect -- string )
|
|||
GENERIC: effect>type ( obj -- type )
|
||||
M: object effect>type drop object ;
|
||||
M: word effect>type ;
|
||||
M: pair effect>type second effect>type ;
|
||||
M: pair effect>type second-unsafe effect>type ;
|
||||
M: classoid effect>type ;
|
||||
|
||||
: effect-in-types ( effect -- input-types )
|
||||
|
|
Loading…
Reference in New Issue