Commit cc48d2b1 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: Use a different map to distinguish eval contexts

Port 53fdf9d1

Original Commit Message:

    eval() may introduce a scope which needs to be represented as a context at
    runtime, e.g.,

      eval('var x; let y; ()=>y')

    introduces a variable y which needs to have a context allocated for it. However,
    when traversing upwards to find the declaration context for a variable which leaks,
    as the declaration of x does above, this context has to be understood to not be
    a declaration context in sloppy mode.

    This patch makes that distinction by introducing a different map for eval-introduced
    contexts. A dynamic search for the appropriate context will continue past an eval
    context to find the appropriate context. Marking contexts as eval contexts rather
    than function contexts required updates in each compiler backend.

R=littledan@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=v8:5295, chromium:648719
LOG=N

Review-Url: https://codereview.chromium.org/2590343002
Cr-Commit-Position: refs/heads/master@{#41872}
parent a6749915
......@@ -208,7 +208,8 @@ void FullCodeGenerator::Generate() {
}
if (slots <= FastNewFunctionContextStub::MaximumSlots()) {
FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type());
__ mov(FastNewFContextDescriptor::SlotsRegister(), Operand(slots));
__ mov(FastNewFunctionContextDescriptor::SlotsRegister(),
Operand(slots));
__ CallStub(&stub);
// Result of FastNewFunctionContextStub is always in new space.
need_write_barrier = false;
......
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