Skip to content

Commit

Permalink
Set the storeChanged bit:
Browse files Browse the repository at this point in the history
#268

Most of the interesting work in this CL consists of making NullnessPropagationStore (and, by extension, TransferInput) immutable so that I'm not deathly afraid to compute storeChanged from the result of oldStore.equals(newStore). As it turns out, I later introduced an updateStore() method that would by itself have done a pretty good job of localizing the mutation of NullnessPropagationStore. Maybe I don't need an immutable NullnessPropagationStore anymore, but I've kept it that way for now, partially because immutability is nice in general, partially because it might avoid unnecessary copies in the framework, and partially because I didn't see much reason to change it back.

There's some additional churn in this CL now that I don't mutate the NullnessPropagationStore/TransferInput in place: I split result() into noStoreChanges() and updateRegularStore(). This also lets me move some more work into updateRegularStore(). I figured that the renaming to updateRegularStore() would help explain what that method did and that the corresponding renaming to noStoreChanges() would maintain the parallelism between the two.

I also added some tests. All of them passed before this CL, and all of them pass after. I added the one only because I almost introduced a bug, got curious whether the tests would have caught it, and found that they wouldn't have. Now they would. I added the others (the loop tests) in the hope of proving that storeChanged is necessary, but they work with or without it. I'm leaving them because we probably should have some tests of loops. I'm still not sure how to prove that the storeChanged bit matters.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=79884827
  • Loading branch information
cpovirk authored and cushon committed Jan 9, 2015
1 parent fafa729 commit 6e60ecb
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 124 deletions.

0 comments on commit 6e60ecb

Please sign in to comment.