Commit 4dc32825 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Add constraints verification to LAllocator::MarkAsCall().

Review URL: http://codereview.chromium.org/6069012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6149 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 4c258dc0
......@@ -2036,7 +2036,7 @@ LInstruction* LChunkBuilder::DoAccessArgumentsAt(HAccessArgumentsAt* instr) {
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);
}
......
......@@ -1586,7 +1586,27 @@ 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();
#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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment