Ignore:
Timestamp:
Oct 31, 2014, 2:27:10 PM (11 years ago)
Author:
[email protected]
Message:

Add scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope
https://bugs.webkit.org/show_bug.cgi?id=138252

Reviewed by Geoffrey Garen.

Added scope operand to op_push_with_scope, op_push_name_scope and op_pop_scope.
Although the scope register is filled in with the ScopeChain register for all
three bytecodes, this operand is not used in the processing of the bytecodes.
That will be addressed in a future patch.

  • bytecode/BytecodeList.json: Lengthened the three bytecodes.
  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::dumpBytecode): Added code to dump the scope operand.

  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitPopScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::emitPopScopes):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::scopeRegister):
Added scope register to these emit functions and the bytecodes they emit.
New m_scopeRegister and accessor.

  • bytecompiler/NodesCodegen.cpp:

(JSC::ContinueNode::emitBytecode):
(JSC::BreakNode::emitBytecode):
(JSC::ReturnNode::emitBytecode):
(JSC::WithNode::emitBytecode):
(JSC::TryNode::emitBytecode):
Created a RegisterID for the ScopeChain register and used it to emit the updated
bytecodes.

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_push_name_scope):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_push_name_scope):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:

Updated the operand indecies for the processing of the updated bytecodes.

File:
1 edited

Legend:

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

    r174821 r175426  
    22512251    ASSERT(scope);
    22522252
    2253     generator.emitPopScopes(scope->scopeDepth());
     2253    generator.emitPopScopes(generator.scopeRegister(), scope->scopeDepth());
    22542254    generator.emitJump(scope->continueTarget());
    22552255}
     
    22782278    ASSERT(scope);
    22792279
    2280     generator.emitPopScopes(scope->scopeDepth());
     2280    generator.emitPopScopes(generator.scopeRegister(), scope->scopeDepth());
    22812281    generator.emitJump(scope->breakTarget());
    22822282}
     
    22992299    if (generator.scopeDepth()) {
    23002300        returnRegister = generator.emitMove(generator.newTemporary(), returnRegister.get());
    2301         generator.emitPopScopes(0);
     2301        generator.emitPopScopes(generator.scopeRegister(), 0);
    23022302    }
    23032303
     
    23142314    RefPtr<RegisterID> scope = generator.emitNode(m_expr);
    23152315    generator.emitExpressionInfo(m_divot, m_divot - m_expressionLength, m_divot);
    2316     generator.emitPushWithScope(scope.get());
     2316    generator.emitPushWithScope(generator.scopeRegister(), scope.get());
    23172317    generator.emitNode(dst, m_statement);
    2318     generator.emitPopScope();
     2318    generator.emitPopScope(generator.scopeRegister());
    23192319}
    23202320
     
    25562556            tryData = generator.pushTry(here.get());
    25572557        }
    2558        
    2559         generator.emitPushCatchScope(m_exceptionIdent, exceptionRegister.get(), DontDelete);
     2558
     2559        generator.emitPushCatchScope(generator.scopeRegister(), m_exceptionIdent, exceptionRegister.get(), DontDelete);
    25602560        generator.emitNode(dst, m_catchBlock);
    2561         generator.emitPopScope();
     2561        generator.emitPopScope(generator.scopeRegister());
    25622562        generator.emitLabel(catchEndLabel.get());
    25632563    }
Note: See TracChangeset for help on using the changeset viewer.