Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Synthetic LambdaMetaFactory implementation to handle invokeDynamic #1056

Closed
wants to merge 13 commits into from

Commits on Apr 17, 2018

  1. Rebase all J8 changes to new HEAD

    This subsumes the following commits from  the old pull request:
    
    commit b28f85d
    Author: Brian Alliet <balliet@grammatech.com>
    Date:   Thu Mar 15 14:52:06 2018 -0400
    
        Generate bridge methods if FLAG_BRIDGES is specified for altMetafactory
    
        This isn't that well tested (and could use some tests). The only compiler
        I've found that actually generates these is ejc. This works for the one
        example (involving covariant return types) I have though.
    
    commit 3579b02
    Author: Brian Alliet <balliet@grammatech.com>
    Date:   Tue Jan 16 11:41:15 2018 -0500
    
        Support LambdaMetaFactory.altMetaFactory (in addition to metaFactory)
    
        This adds a few extra pieces of info for the runtime generated class (extra
        interfaces, bridge methods, and a serializable bit)
    
    commit 003a053
    Author: Brian Alliet <balliet@grammatech.com>
    Date:   Tue Feb 28 09:39:02 2017 -0500
    
        Wire up LambdaMetaFactory to src/soot/asm/AsmMethodSource
    
        We rewrite invokedynamic 'calls' to LambdaMetaFactory to normal invokestatic
        calls to the bootstrap method of the thunk created by our LambdaMetaFactory
        models.
    
        We *probably* want to keep these invokedynamic instructions actually, just
        with some special modeled target or something... I'm not sure. Doing it this
        way means nobody else needs to know anything about invokedynamic now.
    
    commit 027281f
    Author: Brian Alliet <balliet@grammatech.com>
    Date:   Tue Feb 28 09:34:30 2017 -0500
    
        Add 'LambdaMetaFactory' (maybe this should be renamed) which implements the
        'modeling' of java.lang.invoke.LambdaMetaFactory.
    
        We model this by making a real 'thunk' class which implements the functional
        interface of the lambda and dispatches to the real implementation. This is
        sort of like what RetroLambda does.
    
        This isn't wired up to the rest of soot yet.
    balliet-gt committed Apr 17, 2018
    Configuration menu
    Copy the full SHA
    e4018bc View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2018

  1. Configuration menu
    Copy the full SHA
    60279a8 View commit details
    Browse the repository at this point in the history
  2. Applied formatting.

    Converted G.out calls to logging
    mbenz89 committed Oct 31, 2018
    Configuration menu
    Copy the full SHA
    bb655d2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    14248f4 View commit details
    Browse the repository at this point in the history
  4. Formating of ASMMethodsource

    mbenz89 committed Oct 31, 2018
    Configuration menu
    Copy the full SHA
    da82cc6 View commit details
    Browse the repository at this point in the history
  5. Re-implemented bridging logic. The implementation just failed on call…

    …s to functional interfaces with generic types.
    mbenz89 committed Oct 31, 2018
    Configuration menu
    Copy the full SHA
    af5c9c0 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2018

  1. Fixes incorrect addition of MetaFactory implementation to Scene.

    The factory need to implement java.lang.Object and the FastHierarchy has to be invalidated after adding the MetaFactory to the Scene, so that it is found as valid implementer of the functional interface during call graph generation
    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    18504c0 View commit details
    Browse the repository at this point in the history
  2. Adds a very basic test case of the LambdaMetaFactory with a CHA call …

    …graph.
    
    Test case is copied from the 'Java Call Graph Test Suite (JCG)' project (https://bitbucket.org/delors/jcg/src/master/)
    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    992c708 View commit details
    Browse the repository at this point in the history
  3. Adds test configurations for RTA, VTA and SPARK.

    VTA and SPARK is currently failing. More tests to follow
    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    1a2eb8d View commit details
    Browse the repository at this point in the history
  4. Adds support for instance invokes in the interface implementing method.

    Fixes a parameter indexing bug.
    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    20902f3 View commit details
    Browse the repository at this point in the history
  5. Finally found bug that prevented SPARK and VTA working with the synth…

    …etic LambdaMetaFactory for years!
    
    The TypeManager cached the FastHierarchy and thereby missed its invalidation after adding the synthetic LambdaMetaFactory.
    The TypeManager now uses a Scene managed FastHierarchy and thus can correctly find implementers of functional interfaces added after the first instance of FastHierarchy was built.
    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    ed05b76 View commit details
    Browse the repository at this point in the history
  6. Fixes formatting and license

    mbenz89 committed Nov 2, 2018
    Configuration menu
    Copy the full SHA
    681a46e View commit details
    Browse the repository at this point in the history

Commits on Dec 20, 2018

  1. Implement parameter adaptation in LambdaMetaFactory

    Implemented modeling of parameter adaptation. This is required to
    handle conversion of primitives to their wrapper types
    (boxing and unboxing).
    
    Enabled writing generated classes to another format, such as .class.
    
    Generated class names follow an inner class naming pattern.
    
    Removed BridgeMethodSource; ThunkMethodSource handles all cases.
    The samMethodType and the bridges are
    signatures to be implemented by the functional object,
    and each one delegates to the implMethod.
    Jon Mathews authored and mbenz89 committed Dec 20, 2018
    Configuration menu
    Copy the full SHA
    7dbba98 View commit details
    Browse the repository at this point in the history