Commit 8bb88e85 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: Cleanup allocation folding states in lithium.

Port 6e15433d

R=hpayer@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=chromium:580959
LOG=N

Review-Url: https://codereview.chromium.org/1970563004
Cr-Commit-Position: refs/heads/master@{#36185}
parent ce7d7761
......@@ -5371,9 +5371,7 @@ void LCodeGen::DoAllocate(LAllocate* instr) {
flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR);
}
if (instr->hydrogen()->IsAllocationFolded()) {
flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED);
}
DCHECK(!instr->hydrogen()->IsAllocationFolded());
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
......@@ -5468,11 +5466,12 @@ void LCodeGen::DoDeferredAllocate(LAllocate* instr) {
void LCodeGen::DoFastAllocate(LFastAllocate* instr) {
DCHECK(instr->hydrogen()->IsAllocationFolded());
DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator());
Register result = ToRegister(instr->result());
Register scratch1 = ToRegister(instr->temp1());
Register scratch2 = ToRegister(instr->temp2());
AllocationFlags flags = NO_ALLOCATION_FLAGS;
AllocationFlags flags = ALLOCATION_FOLDED;
if (instr->hydrogen()->MustAllocateDoubleAligned()) {
flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT);
}
......@@ -5480,15 +5479,13 @@ void LCodeGen::DoFastAllocate(LFastAllocate* instr) {
DCHECK(!instr->hydrogen()->IsNewSpaceAllocation());
flags = static_cast<AllocationFlags>(flags | PRETENURE);
}
if (!instr->hydrogen()->IsAllocationFoldingDominator()) {
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
CHECK(size <= Page::kMaxRegularHeapObjectSize);
__ FastAllocate(size, result, scratch1, scratch2, flags);
} else {
Register size = ToRegister(instr->size());
__ FastAllocate(size, result, scratch1, scratch2, flags);
}
if (instr->size()->IsConstantOperand()) {
int32_t size = ToInteger32(LConstantOperand::cast(instr->size()));
CHECK(size <= Page::kMaxRegularHeapObjectSize);
__ FastAllocate(size, result, scratch1, scratch2, flags);
} else {
Register size = ToRegister(instr->size());
__ FastAllocate(size, result, scratch1, scratch2, flags);
}
}
......
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