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

Side by Side 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, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 } else if (double_artificial_registers_.Contains( 1579 } else if (double_artificial_registers_.Contains(
1580 virtual_register - first_artificial_register_)) { 1580 virtual_register - first_artificial_register_)) {
1581 return DOUBLE_REGISTERS; 1581 return DOUBLE_REGISTERS;
1582 } 1582 }
1583 1583
1584 return GENERAL_REGISTERS; 1584 return GENERAL_REGISTERS;
1585 } 1585 }
1586 1586
1587 1587
1588 void LAllocator::MarkAsCall() { 1588 void LAllocator::MarkAsCall() {
1589 current_summary()->MarkAsCall(); 1589 // Call instructions can use only fixed registers as
1590 // temporaries and outputs because all registers
1591 // are blocked by the calling convention.
1592 // Inputs can use either fixed register or have a short lifetime (be
1593 // used at start of the instruction).
1594 InstructionSummary* summary = current_summary();
1595 ASSERT(summary->Output() == NULL ||
1596 LUnallocated::cast(summary->Output())->HasFixedPolicy() ||
Kevin Millikin (Chromium) 2011/01/04 11:21:23 You could define a predicate on LUnallocated: boo
1597 !LUnallocated::cast(summary->Output())->HasRegisterPolicy());
1598 for (int i = 0; i < summary->InputCount(); i++) {
1599 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
1600 LUnallocated::cast(summary->InputAt(i))->IsUsedAtStart() ||
1601 !LUnallocated::cast(summary->InputAt(i))->HasRegisterPolicy());
1602 }
1603 for (int i = 0; i < summary->TempCount(); i++) {
1604 ASSERT(LUnallocated::cast(summary->TempAt(i))->HasFixedPolicy() ||
1605 !LUnallocated::cast(summary->TempAt(i))->HasRegisterPolicy());
1606 }
1607 summary->MarkAsCall();
1590 } 1608 }
1591 1609
1592 1610
1593 void LAllocator::RecordDefinition(HInstruction* instr, LUnallocated* operand) { 1611 void LAllocator::RecordDefinition(HInstruction* instr, LUnallocated* operand) {
1594 operand->set_virtual_register(instr->id()); 1612 operand->set_virtual_register(instr->id());
1595 current_summary()->SetOutput(operand); 1613 current_summary()->SetOutput(operand);
1596 } 1614 }
1597 1615
1598 1616
1599 void LAllocator::RecordTemporary(LUnallocated* operand) { 1617 void LAllocator::RecordTemporary(LUnallocated* operand) {
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 LiveRange* current = live_ranges()->at(i); 2138 LiveRange* current = live_ranges()->at(i);
2121 if (current != NULL) current->Verify(); 2139 if (current != NULL) current->Verify();
2122 } 2140 }
2123 } 2141 }
2124 2142
2125 2143
2126 #endif 2144 #endif
2127 2145
2128 2146
2129 } } // namespace v8::internal 2147 } } // namespace v8::internal
OLDNEW
« 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