Bug 951528. r=jandem

This commit is contained in:
Kannan Vijayan 2013-12-20 18:11:21 -05:00
parent 1bdeb67c5f
commit dbdcf17535
4 changed files with 19 additions and 2 deletions

View File

@ -9235,6 +9235,7 @@ IonBuilder::jsop_setarg(uint32_t arg)
JS_ASSERT(script()->uninlineable() && !isInlineBuilder());
MSetFrameArgument *store = MSetFrameArgument::New(alloc(), arg, val);
modifiesFrameArguments_ = true;
current->add(store);
current->setArg(arg);
return true;

View File

@ -767,7 +767,13 @@ LinearScanAllocator::assign(LAllocation allocation)
}
}
if (reg && allocation.isMemory()) {
bool useAsCanonicalSpillSlot = allocation.isMemory();
// Only canonically spill argument values when frame arguments are not
// modified in the body.
if (mir->modifiesFrameArguments())
useAsCanonicalSpillSlot = allocation.isStackSlot();
if (reg && useAsCanonicalSpillSlot) {
if (reg->canonicalSpill()) {
JS_ASSERT(allocation == *reg->canonicalSpill());

View File

@ -127,6 +127,10 @@ class MIRGenerator
return asmJSGlobalAccesses_;
}
bool modifiesFrameArguments() const {
return modifiesFrameArguments_;
}
public:
CompileCompartment *compartment;
@ -146,6 +150,11 @@ class MIRGenerator
AsmJSGlobalAccessVector asmJSGlobalAccesses_;
uint32_t minAsmJSHeapLength_;
// Keep track of whether frame arguments are modified during execution.
// RegAlloc needs to know this as spilling values back to their register
// slots is not compatible with that.
bool modifiesFrameArguments_;
#if defined(JS_ION_PERF)
AsmJSPerfSpewer asmJSPerfSpewer_;

View File

@ -30,7 +30,8 @@ MIRGenerator::MIRGenerator(CompileCompartment *compartment,
performsAsmJSCall_(false),
asmJSHeapAccesses_(*alloc),
asmJSGlobalAccesses_(*alloc),
minAsmJSHeapLength_(AsmJSAllocationGranularity)
minAsmJSHeapLength_(AsmJSAllocationGranularity),
modifiesFrameArguments_(false)
{ }
bool