Change the algorithm and generated code for parallel moves on IA32.
authorkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Jan 2011 11:25:36 +0000 (11:25 +0000)
committerkmillikin@chromium.org <kmillikin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Jan 2011 11:25:36 +0000 (11:25 +0000)
commit437914da90af8fa885d6f011ba3cec682d658a7f
tree30617bc3b4713eb5146decba07d77898dae184bd
parent3342871af5d43c4e6892b8e401b52c9337ff5c94
Change the algorithm and generated code for parallel moves on IA32.

Instead of spilling and then immediately restoring eax to resolve
memory to memory moves, the gap move resolver now tracks registers
that are known to be free and uses one if available.  If not it spills
but restores lazily when the spilled value is needed or at the end of
the algorithm.

Instead of using esi for resolving cycles and assuming it is free to
overwrite because it can be rematerialized, the gap move resolver now
resolves cycles using swaps, possibly using a free register as above.

The algorithm is also changed to be simpler: a recursive depth-first
traversal of the move dependence graph.  It uses a list of moves to be
performed (because it mutates the moves themselves), but does not use
any auxiliary structure other than the control stack.  It does not
build up a separate list of scheduled moves to be interpreted by the
code generate, but emits code on the fly.

Review URL: http://codereview.chromium.org/6263005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6344 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
13 files changed:
src/SConscript
src/arm/lithium-codegen-arm.cc
src/ia32/lithium-codegen-ia32.cc
src/ia32/lithium-codegen-ia32.h
src/ia32/lithium-gap-resolver-ia32.cc [new file with mode: 0644]
src/ia32/lithium-gap-resolver-ia32.h [new file with mode: 0644]
src/ia32/lithium-ia32.cc
src/lithium-allocator.cc
src/lithium-allocator.h
src/lithium.cc
src/lithium.h
src/x64/lithium-codegen-x64.cc
tools/gyp/v8.gyp