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