|
|
Created:
4 years, 1 month ago by Leszek Swirski Modified:
4 years ago Reviewers:
Michael Starzinger CC:
v8-reviews_googlegroups.com, rmcilroy Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
Description[turbofan] Access merge environment map more efficiently
Committed: https://crrev.com/8590e8d4d5fca9bee6613f55761af000d5fd1ddb
Cr-Commit-Position: refs/heads/master@{#41481}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Replace array-like access with insert+iterator #Patch Set 3 : Revert "Replace array-like access with insert+iterator" #Messages
Total messages: 22 (13 generated)
The CQ bit was checked by leszeks@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
leszeks@chromium.org changed reviewers: + mstarzinger@chromium.org
Hi Michi, I noticed some small inefficiencies in the way we were accessing the merge environments in BGB, so I went ahead and fixed them. Can you take a look please?
LGTM with a question. https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... File src/compiler/bytecode-graph-builder.cc (right): https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... src/compiler/bytecode-graph-builder.cc:1899: auto it = merge_environments_.find(current_offset); question: Any reason to use an iterator here and a reference type below? I would vote for sticking to one or the other in both functions for the sake of readability.
I'll wait for a reply to my reply before submitting. https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... File src/compiler/bytecode-graph-builder.cc (right): https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... src/compiler/bytecode-graph-builder.cc:1899: auto it = merge_environments_.find(current_offset); On 2016/12/01 14:47:48, Michael Starzinger wrote: > question: Any reason to use an iterator here and a reference type below? I would > vote for sticking to one or the other in both functions for the sake of > readability. Indeed there is: the find+iterator does not create a new entry in the map if one didn't exist already, while the array-style accessor does. I could use insert() below to also use an iterator if you want?
https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... File src/compiler/bytecode-graph-builder.cc (right): https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... src/compiler/bytecode-graph-builder.cc:1899: auto it = merge_environments_.find(current_offset); On 2016/12/01 14:52:36, Leszek Swirski wrote: > On 2016/12/01 14:47:48, Michael Starzinger wrote: > > question: Any reason to use an iterator here and a reference type below? I > would > > vote for sticking to one or the other in both functions for the sake of > > readability. > > Indeed there is: the find+iterator does not create a new entry in the map if one > didn't exist already, while the array-style accessor does. I could use insert() > below to also use an iterator if you want? Yes, I would prefer that. Thanks!
The CQ bit was checked by leszeks@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/12/01 15:00:51, Michael Starzinger wrote: > https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... > File src/compiler/bytecode-graph-builder.cc (right): > > https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... > src/compiler/bytecode-graph-builder.cc:1899: auto it = > merge_environments_.find(current_offset); > On 2016/12/01 14:52:36, Leszek Swirski wrote: > > On 2016/12/01 14:47:48, Michael Starzinger wrote: > > > question: Any reason to use an iterator here and a reference type below? I > > would > > > vote for sticking to one or the other in both functions for the sake of > > > readability. > > > > Indeed there is: the find+iterator does not create a new entry in the map if > one > > didn't exist already, while the array-style accessor does. I could use > insert() > > below to also use an iterator if you want? > > Yes, I would prefer that. Thanks! Done. Not sure if this is more readable, what do you think?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... File src/compiler/bytecode-graph-builder.cc (right): https://codereview.chromium.org/2521313002/diff/1/src/compiler/bytecode-graph... src/compiler/bytecode-graph-builder.cc:1899: auto it = merge_environments_.find(current_offset); On 2016/12/01 15:00:51, Michael Starzinger wrote: > On 2016/12/01 14:52:36, Leszek Swirski wrote: > > On 2016/12/01 14:47:48, Michael Starzinger wrote: > > > question: Any reason to use an iterator here and a reference type below? I > > would > > > vote for sticking to one or the other in both functions for the sake of > > > readability. > > > > Indeed there is: the find+iterator does not create a new entry in the map if > one > > didn't exist already, while the array-style accessor does. I could use > insert() > > below to also use an iterator if you want? > > Yes, I would prefer that. Thanks! As discussed offline: Either is fine with me. Take your pick. :)
The CQ bit was checked by leszeks@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mstarzinger@chromium.org Link to the patchset: https://codereview.chromium.org/2521313002/#ps40001 (title: "Revert "Replace array-like access with insert+iterator"")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 40001, "attempt_start_ts": 1480934526908850, "parent_rev": "8c5e2c5e937a1334c9489377539377549621ff93", "commit_rev": "198bc3f1027fdefaa7e35269198be2833d25ae5d"}
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== [turbofan] Access merge environment map more efficiently ========== to ========== [turbofan] Access merge environment map more efficiently Committed: https://crrev.com/8590e8d4d5fca9bee6613f55761af000d5fd1ddb Cr-Commit-Position: refs/heads/master@{#41481} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/8590e8d4d5fca9bee6613f55761af000d5fd1ddb Cr-Commit-Position: refs/heads/master@{#41481} |