https://codereview.chromium.org/15533004/diff/17012/src/hydrogen.cc
File src/hydrogen.cc (right):
https://codereview.chromium.org/15533004/diff/17012/src/hydrogen.cc#newcode2509
src/hydrogen.cc:2509: HSimulate*
HGraph::ZapEnvironmentSlotInNextSimulate(int index,
In this function, we have to walk forward in the graph to find the next
simulate in order to zap a dead environment slot. This could go
quadratic for N dead instructions with a simulate at the end of the
block. But recall, we've done a backwards walk in the iterative phase.
You could, for example, keep track of the last simulate seen in the
backward walk and store a pointer to it explicitly in the
HEnvironment{Bind,Lookup}. Then you can kill it in O(1).
https://codereview.chromium.org/15533004/diff/17012/src/hydrogen.cc#newcode2712
src/hydrogen.cc:2712: // Analysis finished. Zap dead environment slots.
I don't think we need the last pass over the blocks. We have the correct
live_in information for every block in the graph.
I think it would be more clear (and also more efficient) to have a
liveness field for each HEnvironment{Bind,Lookup} instruction in the
graph. Set the liveness during the iterative phase (since when an
HEnvironment{Bind,Lookup} becomes live, it never becomes dead again).
Collect all HEnvironment{Bind,Lookup} instructions into a list which you
can inspect at the end. In the last pass, do the ZapEnvironmentSlot()
for the dead ones, then remove all of them from the graph. You can use
the live_in vectors for the blocks directly in UpdateLivenessAtBlockEnd,
which kills values selectively in successors. This saves two whole
passes over the hydrogen graph.
https://codereview.chromium.org/15533004/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.