Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: src/lithium-allocator.cc

Issue 6069012: Add constraints verification to LAllocator::MarkAsCall(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-allocator.cc
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
index fb24cc1bf94dcf3b1ea5e1817fdc20a82612cbe5..d40604f12212d250196c5a2c3150d3055d8c8659 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -1586,7 +1586,25 @@ RegisterKind LAllocator::RequiredRegisterKind(int virtual_register) const {
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();
+ ASSERT(summary->Output() == NULL ||
+ LUnallocated::cast(summary->Output())->HasFixedPolicy() ||
Kevin Millikin (Chromium) 2011/01/04 11:21:23 You could define a predicate on LUnallocated: boo
+ !LUnallocated::cast(summary->Output())->HasRegisterPolicy());
+ for (int i = 0; i < summary->InputCount(); i++) {
+ ASSERT(LUnallocated::cast(summary->InputAt(i))->HasFixedPolicy() ||
Kevin Millikin (Chromium) 2011/01/04 11:21:23 I'd prefer to have the for loops wrapped in #ifdef
+ 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());
+ }
+ summary->MarkAsCall();
}
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698