Chromium Code Reviews| 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(); |
| } |