     [ dup 1array ] [ "custom-inlining" word-prop ] bi* with-datastack
     first object swap eliminate-dispatch ;
 
+: inline-instance-check ( #call word -- ? )
+    over in-d>> second value-info literal>> dup class?
+    [ "predicate" word-prop '[ drop @ ] inline-word-def ] [ 3drop f ] if ;
+
 : do-inlining ( #call word -- ? )
     #! If the generic was defined in an outer compilation unit,
     #! then it doesn't have a definition yet; the definition

USING: accessors kernel arrays sequences math math.order
math.partial-dispatch generic generic.standard generic.math
classes.algebra classes.union sets quotations assocs combinators
words namespaces continuations
compiler.tree
compiler.tree.builder
compiler.tree.recursive

: remember-inlining ( word -- )
    history [ swap suffix ] change ;

: inline-word-def ( #call word quot -- ? )
    over history get memq? [
        3drop f
    ] [
        [
            swap remember-inlining
            dupd splicing-nodes >>body
            propagate-body
        ] with-scope
        t
    ] if ;

: inline-word ( #call word -- ? )
    dup def>> inline-word-def ;

: inline-method-body ( #call word -- ? )
    2dup should-inline? [ inline-word ] [ 2drop f ] if ;
