Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@6479e1b964] [1.6>1.7] [MERGE #3536 @meg…
Browse files Browse the repository at this point in the history
…-gupta] Do not peep closure stack symbols

Merge pull request #3536 from meg-gupta:fixclosure
  • Loading branch information
chakrabot authored and MSLaguana committed Sep 25, 2017
1 parent 7520bf6 commit e27adae
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion deps/chakrashim/core/lib/Backend/Lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10078,7 +10078,9 @@ Lowerer::CreateOpndForSlotAccess(IR::Opnd * opnd)
// Stack closure syms are made to look like slot accesses for the benefit of GlobOpt, so that it can do proper
// copy prop and implicit call bailout. But what we really want is local stack load/store.
// Don't do this for loop body, though, since we don't have the value saved on the stack.
return IR::SymOpnd::New(dstSym->m_stackSym, 0, TyMachReg, this->m_func);
IR::SymOpnd * closureSym = IR::SymOpnd::New(dstSym->m_stackSym, 0, TyMachReg, this->m_func);
closureSym->GetStackSym()->m_isClosureSym = true;
return closureSym;
}

int32 offset = dstSym->m_propertyId;
Expand Down
7 changes: 6 additions & 1 deletion deps/chakrashim/core/lib/Backend/Peeps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,14 @@ Peeps::ClearRegMap()
void
Peeps::SetReg(RegNum reg, StackSym *sym)
{
this->ClearReg(sym->scratch.peeps.reg);
this->ClearReg(reg);

if (sym->m_isClosureSym)
{
return;
}

this->ClearReg(sym->scratch.peeps.reg);
this->regMap[reg] = sym;
sym->scratch.peeps.reg = reg;
}
Expand Down
3 changes: 2 additions & 1 deletion deps/chakrashim/core/lib/Backend/Sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ StackSym::New(SymID id, IRType type, Js::RegSlot byteCodeRegSlot, Func *func)
stackSym->m_isArgCaptured = false;
stackSym->m_requiresBailOnNotNumber = false;
stackSym->m_isCatchObjectSym = false;
stackSym->m_isClosureSym = false;
stackSym->m_builtInIndex = Js::BuiltinFunction::None;
stackSym->m_slotNum = StackSym::InvalidSlot;

Expand Down Expand Up @@ -503,7 +504,7 @@ StackSym::CloneDef(Func *func)
newSym->m_allocated = m_allocated;
newSym->m_isInlinedArgSlot = m_isInlinedArgSlot;
newSym->m_isCatchObjectSym = m_isCatchObjectSym;

newSym->m_isClosureSym = m_isClosureSym;
newSym->m_type = m_type;

newSym->CopySymAttrs(this);
Expand Down
1 change: 1 addition & 0 deletions deps/chakrashim/core/lib/Backend/Sym.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ class StackSym: public Sym
uint8 m_isArgCaptured: 1; // True if there is a ByteCodeArgOutCapture for this symbol
uint8 m_nonEscapingArgObjAlias : 1;
uint8 m_isCatchObjectSym : 1; // a catch object sym (used while jitting loop bodies)
uint m_isClosureSym : 1;
IRType m_type;
Js::BuiltinFunction m_builtInIndex;

Expand Down

0 comments on commit e27adae

Please sign in to comment.