⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 175998 in webkit


Ignore:
Timestamp:
Nov 11, 2014, 6:33:43 PM (12 years ago)
Author:
msaboff@apple.com
Message:

Use scope register when processing op_resolve_scope in LLInt and Baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=138637

Reviewed by Mark Lam.

Filled out op_resolve_scope processing to use the scope operand to access the current
scope chain.

  • jit/JIT.h:
  • jit/JITInlines.h:

(JSC::JIT::callOperation):

  • jit/JITOperations.cpp:
  • jit/JITOperations.h:

Added scope virtual register parameter to emitResolveClosure(). Added new callOperation() to
support the additional argument.

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitResolveClosure):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitSlow_op_resolve_scope):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitResolveClosure):
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitSlow_op_resolve_scope):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):
Added "scope" parameter to emitResolveClosure(). Passed scope register index to slow path.
Used scope virtual register instead of JSStack::ScopeChain.

Location:
trunk/Source/JavaScriptCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r175993 r175998  
     12014-11-11  Michael Saboff  <msaboff@apple.com>
     2
     3        Use scope register when processing op_resolve_scope in LLInt and Baseline JIT
     4        https://bugs.webkit.org/show_bug.cgi?id=138637
     5
     6        Reviewed by Mark Lam.
     7
     8        Filled out op_resolve_scope processing to use the scope operand to access the current
     9        scope chain.
     10
     11        * jit/JIT.h:
     12        * jit/JITInlines.h:
     13        (JSC::JIT::callOperation):
     14        * jit/JITOperations.cpp:
     15        * jit/JITOperations.h:
     16        Added scope virtual register parameter to emitResolveClosure().  Added new callOperation() to
     17        support the additional argument.
     18
     19        * jit/JITPropertyAccess.cpp:
     20        (JSC::JIT::emitResolveClosure):
     21        (JSC::JIT::emit_op_resolve_scope):
     22        (JSC::JIT::emitSlow_op_resolve_scope):
     23        * jit/JITPropertyAccess32_64.cpp:
     24        (JSC::JIT::emitResolveClosure):
     25        (JSC::JIT::emit_op_resolve_scope):
     26        (JSC::JIT::emitSlow_op_resolve_scope):
     27        * llint/LLIntSlowPaths.cpp:
     28        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
     29        Added "scope" parameter to emitResolveClosure().  Passed scope register index to slow path.
     30        Used scope virtual register instead of JSStack::ScopeChain.
     31
    1322014-11-11  Joseph Pecoraro  <pecoraro@apple.com>
    233
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r175762 r175998  
    626626
    627627        void emitVarInjectionCheck(bool needsVarInjectionChecks);
    628         void emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned depth);
     628        void emitResolveClosure(int dst, int scope, bool needsVarInjectionChecks, unsigned depth);
    629629        void emitLoadWithStructureCheck(int scope, Structure** structureSlot);
    630630        void emitGetGlobalProperty(uintptr_t* operandSlot);
     
    706706        MacroAssembler::Call callOperation(WithProfileTag, J_JITOperation_EPc, int, Instruction*);
    707707        MacroAssembler::Call callOperation(J_JITOperation_EZ, int, int32_t);
     708        MacroAssembler::Call callOperation(J_JITOperation_EZZ, int, int32_t, int32_t);
    708709        MacroAssembler::Call callOperation(P_JITOperation_EJS, GPRReg, size_t);
    709710        MacroAssembler::Call callOperation(S_JITOperation_ECC, RegisterID, RegisterID);
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r175766 r175998  
    277277}
    278278
     279ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EZZ operation, int dst, int32_t arg1, int32_t arg2)
     280{
     281    setupArgumentsWithExecState(TrustedImm32(arg1), TrustedImm32(arg2));
     282    return appendCallWithExceptionCheckSetJSValueResult(operation, dst);
     283}
     284
    279285ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(S_JITOperation_ECC operation, RegisterID regOp1, RegisterID regOp2)
    280286{
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r175762 r175998  
    17191719}
    17201720
    1721 EncodedJSValue JIT_OPERATION operationResolveScope(ExecState* exec, int32_t identifierIndex)
     1721EncodedJSValue JIT_OPERATION operationResolveScope(ExecState* exec, int32_t scopeReg, int32_t identifierIndex)
    17221722{
    17231723    VM& vm = exec->vm();
    17241724    NativeCallFrameTracer tracer(&vm, exec);
    17251725    const Identifier& ident = exec->codeBlock()->identifier(identifierIndex);
    1726     return JSValue::encode(JSScope::resolve(exec, exec->scope(), ident));
     1726    JSScope* scope = exec->uncheckedR(scopeReg).Register::scope();
     1727    return JSValue::encode(JSScope::resolve(exec, scope, ident));
    17271728}
    17281729
  • trunk/Source/JavaScriptCore/jit/JITOperations.h

    r175762 r175998  
    311311char* JIT_OPERATION operationSwitchImmWithUnknownKeyType(ExecState*, EncodedJSValue key, size_t tableIndex) WTF_INTERNAL;
    312312char* JIT_OPERATION operationSwitchStringWithUnknownKeyType(ExecState*, EncodedJSValue key, size_t tableIndex) WTF_INTERNAL;
    313 EncodedJSValue JIT_OPERATION operationResolveScope(ExecState*, int32_t identifierIndex) WTF_INTERNAL;
     313EncodedJSValue JIT_OPERATION operationResolveScope(ExecState*, int32_t scope, int32_t identifierIndex) WTF_INTERNAL;
    314314EncodedJSValue JIT_OPERATION operationGetFromScope(ExecState*, Instruction* bytecodePC) WTF_INTERNAL;
    315315void JIT_OPERATION operationPutToScope(ExecState*, Instruction* bytecodePC) WTF_INTERNAL;
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r175593 r175998  
    591591}
    592592
    593 void JIT::emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned depth)
     593void JIT::emitResolveClosure(int dst, int scope, bool needsVarInjectionChecks, unsigned depth)
    594594{
    595595    emitVarInjectionCheck(needsVarInjectionChecks);
    596     emitGetVirtualRegister(JSStack::ScopeChain, regT0);
     596    emitGetVirtualRegister(scope, regT0);
    597597    for (unsigned i = 0; i < depth; ++i)
    598598        loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
     
    603603{
    604604    int dst = currentInstruction[1].u.operand;
     605    int scope = currentInstruction[2].u.operand;
    605606    ResolveType resolveType = static_cast<ResolveType>(currentInstruction[4].u.operand);
    606607    unsigned depth = currentInstruction[5].u.operand;
     
    617618    case ClosureVar:
    618619    case ClosureVarWithVarInjectionChecks:
    619         emitResolveClosure(dst, needsVarInjectionChecks(resolveType), depth);
     620        emitResolveClosure(dst, scope, needsVarInjectionChecks(resolveType), depth);
    620621        break;
    621622    case Dynamic:
     
    636637
    637638    linkSlowCase(iter);
     639    int32_t scope = currentInstruction[2].u.operand;
    638640    int32_t indentifierIndex = currentInstruction[3].u.operand;
    639     callOperation(operationResolveScope, dst, indentifierIndex);
     641    callOperation(operationResolveScope, dst, scope, indentifierIndex);
    640642}
    641643
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r175471 r175998  
    613613}
    614614
    615 void JIT::emitResolveClosure(int dst, bool needsVarInjectionChecks, unsigned depth)
     615void JIT::emitResolveClosure(int dst, int scope, bool needsVarInjectionChecks, unsigned depth)
    616616{
    617617    emitVarInjectionCheck(needsVarInjectionChecks);
    618618    move(TrustedImm32(JSValue::CellTag), regT1);
    619     emitLoadPayload(JSStack::ScopeChain, regT0);
     619    emitLoadPayload(scope, regT0);
    620620    for (unsigned i = 0; i < depth; ++i)
    621621        loadPtr(Address(regT0, JSScope::offsetOfNext()), regT0);
     
    626626{
    627627    int dst = currentInstruction[1].u.operand;
     628    int scope = currentInstruction[2].u.operand;
    628629    ResolveType resolveType = static_cast<ResolveType>(currentInstruction[4].u.operand);
    629630    unsigned depth = currentInstruction[5].u.operand;
     
    641642    case ClosureVar:
    642643    case ClosureVarWithVarInjectionChecks:
    643         emitResolveClosure(dst, needsVarInjectionChecks(resolveType), depth);
     644        emitResolveClosure(dst, scope, needsVarInjectionChecks(resolveType), depth);
    644645        break;
    645646    case Dynamic:
     
    660661
    661662    linkSlowCase(iter);
     663    int32_t scope = currentInstruction[2].u.operand;
    662664    int32_t indentifierIndex = currentInstruction[3].u.operand;
    663     callOperation(operationResolveScope, dst, indentifierIndex);
     665    callOperation(operationResolveScope, dst, scope, indentifierIndex);
    664666}
    665667
  • trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp

    r175845 r175998  
    13591359    LLINT_BEGIN();
    13601360    const Identifier& ident = exec->codeBlock()->identifier(pc[3].u.operand);
    1361     LLINT_RETURN(JSScope::resolve(exec, exec->scope(), ident));
     1361    JSScope* scope = LLINT_OP(2).Register::scope();
     1362    LLINT_RETURN(JSScope::resolve(exec, scope, ident));
    13621363}
    13631364
Note: See TracChangeset for help on using the changeset viewer.