Ignore:
Timestamp:
Sep 2, 2012, 2:27:23 PM (13 years ago)
Author:
[email protected]
Message:

Refactored scope chain opcodes to support optimization for named function expressions
https://bugs.webkit.org/show_bug.cgi?id=95658

Reviewed by Sam Weinig.

Renamed

push_scope => push_with_scope
push_new_scope => push_name_scope

to clarify the difference between them.

Changed push_with_scope and push_name_scope not to save the new scope in
a temporary register, since doing so made optimization harder.

(The old behavior was a hold-over from when the scope chain wasn't
a GC object, and wouldn't be marked otherwise. Now, the scope chain is
marked because it is a GC object pointed to by the call frame.)

Changed push_name_scope to accept an operand specifying the attributes
for the named property, instead of assuming DontDelete, because a named
function expression needs ReadOnly|DontDelete.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::highestUsedRegister): Removed this function,
which used to be related to preserving saved scope object temporaries,
because it had no callers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r127191 r127393  
    17571757{
    17581758    generator.emitDebugHook(WillExecuteStatement, firstLine(), lastLine(), column());
    1759    
    1760     RefPtr<RegisterID> scope = generator.newTemporary();
    1761     generator.emitNode(scope.get(), m_expr); // scope must be protected until popped
     1759
     1760    RefPtr<RegisterID> scope = generator.emitNode(m_expr);
    17621761    generator.emitExpressionInfo(m_divot, m_expressionLength, 0);
    1763     generator.emitPushScope(scope.get());
     1762    generator.emitPushWithScope(scope.get());
    17641763    RegisterID* result = generator.emitNode(dst, m_statement);
    17651764    generator.emitPopScope();
     
    19971996        }
    19981997       
    1999         generator.emitPushNewScope(exceptionRegister.get(), m_exceptionIdent, exceptionRegister.get());
     1998        generator.emitPushNameScope(m_exceptionIdent, exceptionRegister.get(), DontDelete);
    20001999        generator.emitNode(dst, m_catchBlock);
    20012000        generator.emitPopScope();
Note: See TracChangeset for help on using the changeset viewer.