Fix a bug in the register allocator.
authorfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 30 Nov 2011 14:14:49 +0000 (14:14 +0000)
committerfschneider@chromium.org <fschneider@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 30 Nov 2011 14:14:49 +0000 (14:14 +0000)
Avoid spilling a live range that has a register use at the next instruction.
The register use position has to be after the end of the next instruction so
that we don't end up trying to split a live range at the beginning.

BUG=105112
Review URL: http://codereview.chromium.org/8743011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10095 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/lithium-allocator.cc

index 3ef518d..c4d8b1e 100644 (file)
@@ -234,7 +234,8 @@ bool LiveRange::CanBeSpilled(LifetimePosition pos) {
   // at the current or the immediate next position.
   UsePosition* use_pos = NextRegisterPosition(pos);
   if (use_pos == NULL) return true;
-  return use_pos->pos().Value() > pos.NextInstruction().Value();
+  return
+      use_pos->pos().Value() > pos.NextInstruction().InstructionEnd().Value();
 }