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

Nonzeroing Move Hints (take3 branch) #26173

Merged
merged 11 commits into from
Jul 28, 2015

Commits on Jul 28, 2015

  1. Configuration menu
    Copy the full SHA
    3eb7dd7 View commit details
    Browse the repository at this point in the history
  2. Prep for dropflag hints: refactor trans:_match to pass around `Matc…

    …hInput` rather than `ValueRef`.
    
    (already thumbs-upped pre-rebase by nikomatsakis)
    
    The refactoring here is trivial because `trans::datum::Lvalue`
    currently carries no payload. However, future commits will start
    adding a payload to `Lvalue`, and thus will force us either
    
     1. to thread the payload through the `_match` code (a long term goal), or
    
     2. to ensure the payload has some reasonable default value.
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    9ef61f1 View commit details
    Browse the repository at this point in the history
  3. debugflag to turn off nonzeroing move hint optimization.

    (already thumbs-upped pre-rebase by nikomatsakis)
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    20aa27b View commit details
    Browse the repository at this point in the history
  4. Extend trans::datum::Lvalue so that it carrys an optional dropflag …

    …hint.
    
    Instrumented calls sites that construct Lvalues to ease tracking down
    cases that we might need to change whether or not they carry a hint.
    
    Note that this commit does not do anything to actually *construct*
    the `lldropflag_hints` map, nor does it change anything about codegen
    itself. Those parts are in follow-on commits.
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    a0f3f2a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d3d552b View commit details
    Browse the repository at this point in the history
  6. Add dropflag hints (stack-local booleans) for unfragmented paths in t…

    …rans.
    
    Added code to maintain these hints at runtime, and to conditionalize
    drop-filling and calls to destructors.
    
    In this early stage, we are using hints, so we are always free to
    leave out a flag for a path -- then we just pass `None` as the
    dropflag hint in the corresponding schedule cleanup call. But, once a
    path has a hint, we must at least maintain it: i.e. if the hint
    exists, we must ensure it is never set to "moved" if the data in
    question might actually have been initialized. It remains sound to
    conservatively set the hint to "initialized" as long as the true
    drop-flag embedded in the value itself is up-to-date.
    
    ----
    
    Here are some high-level details I want to point out:
    
     * We maintain the hint in Lvalue::post_store, marking the lvalue as
       moved. (But also continue drop-filling if necessary.)
    
     * We update the hint on ExprAssign.
    
     * We pass along the hint in once closures that capture-by-move.
    
     * You only call `drop_ty` for state that does not have an associated hint.
       If you have a hint, you must call `drop_ty_core` instead.
       (Originally I passed the hint into `drop_ty` as well, to make the
       connection to a hint more apparent, but the vast majority of
       current calls to `drop_ty` are in contexts where no hint is
       available, so it just seemed like noise in the resulting diff.)
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    dce1c61 View commit details
    Browse the repository at this point in the history
  7. During my own review, I convinced myself this was indeed a bug.

    Testing indicates bug would have been caught, albeit later than one
    might hope, during `sync::mpsc::tests::smoke_shared_port_gone2` test.
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    e25427a View commit details
    Browse the repository at this point in the history
  8. Revise intrinsic-move-val test to not require knowledge of whether fi…

    …lling drop is in use.
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    ff14eaf View commit details
    Browse the repository at this point in the history
  9. Reduced the Lvalue constructors to a kernel of three constructors.

    Updated all call sites that used the other contructors to uniformly
    call `Lvalue::new_with_hint`, passing along the appropriate kind
    of hint for each context.
    
    Placated tidy in a few other places in datum.rs.
    pnkfelix committed Jul 28, 2015
    Configuration menu
    Copy the full SHA
    494ce37 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    22796c8 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    b4dd765 View commit details
    Browse the repository at this point in the history