Revision: 6149
Author: [email protected]
Date: Tue Jan  4 03:36:20 2011
Log: Add constraints verification to LAllocator::MarkAsCall().

Review URL: http://codereview.chromium.org/6069012
http://code.google.com/p/v8/source/detail?r=6149

Modified:
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/lithium-allocator.cc

=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Mon Jan 3 08:57:46 2011 +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Tue Jan 4 03:36:20 2011
@@ -2036,7 +2036,7 @@


 LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) {
-  LInstruction* result = new LTypeof(Use(instr->value()));
+  LInstruction* result = new LTypeof(UseAtStart(instr->value()));
   return MarkAsCall(DefineFixed(result, eax), instr);
 }

=======================================
--- /branches/bleeding_edge/src/lithium-allocator.cc Mon Jan 3 11:16:29 2011 +++ /branches/bleeding_edge/src/lithium-allocator.cc Tue Jan 4 03:36:20 2011
@@ -1586,7 +1586,27 @@


 void LAllocator::MarkAsCall() {
-  current_summary()->MarkAsCall();
+  // Call instructions can use only fixed registers as
+  // temporaries and outputs because all registers
+  // are blocked by the calling convention.
+  // Inputs can use either fixed register or have a short lifetime (be
+  // used at start of the instruction).
+  InstructionSummary* summary = current_summary();
+#ifdef DEBUG
+  ASSERT(summary->Output() == NULL ||
+         LUnallocated::cast(summary->Output())->HasFixedPolicy() ||
+         !LUnallocated::cast(summary->Output())->HasRegisterPolicy());
+  for (int i = 0; i < summary->InputCount(); i++) {
+    ASSERT(LUnallocated::cast(summary->InputAt(i))->HasFixedPolicy() ||
+           LUnallocated::cast(summary->InputAt(i))->IsUsedAtStart() ||
+           !LUnallocated::cast(summary->InputAt(i))->HasRegisterPolicy());
+  }
+  for (int i = 0; i < summary->TempCount(); i++) {
+    ASSERT(LUnallocated::cast(summary->TempAt(i))->HasFixedPolicy() ||
+           !LUnallocated::cast(summary->TempAt(i))->HasRegisterPolicy());
+  }
+#endif
+  summary->MarkAsCall();
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to