Ignore:
Timestamp:
Oct 2, 2014, 8:15:03 AM (11 years ago)
Author:
[email protected]
Message:

Fixed the Inspector to be able to properly distinguish between scope types.
<https://webkit.org/b/137279>

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

The pre-existing code incorrectly labels Catch Scopes and Function Name Scopes
as With Scopes. This patch will fix this.

  • bytecode/BytecodeList.json:
  • bytecompiler/BytecodeGenerator.cpp:

(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):

  • These now passes stores the desired JSNameScope::Type in a bytecode operand.
  • debugger/DebuggerScope.cpp:

(JSC::DebuggerScope::isCatchScope):
(JSC::DebuggerScope::isFunctionNameScope):

  • Added queries to be able to explicitly test if the scope is a CatchScope or FunctionNameScope. The FunctionNameScope is the case where the NameScope is used to capture the function name of a function expression.
  • debugger/DebuggerScope.h:
  • inspector/InjectedScriptSource.js:
  • inspector/JSJavaScriptCallFrame.cpp:

(Inspector::JSJavaScriptCallFrame::scopeType):

  • inspector/JSJavaScriptCallFrame.h:
  • inspector/JSJavaScriptCallFramePrototype.cpp:

(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
(Inspector::jsJavaScriptCallFrameConstantFUNCTION_NAME_SCOPE):

  • inspector/protocol/Debugger.json:
  • jit/CCallHelpers.h:

(JSC::CCallHelpers::setupArgumentsWithExecState):

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

(JSC::JIT::callOperation):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_push_name_scope):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_push_name_scope):

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

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter.asm:
  • runtime/JSFunction.cpp:

(JSC::JSFunction::addNameScopeIfNeeded):

  • runtime/JSNameScope.h:

(JSC::JSNameScope::create):
(JSC::JSNameScope::isFunctionNameScope):
(JSC::JSNameScope::isCatchScope):
(JSC::JSNameScope::JSNameScope):

  • Now stores the JSNameScope::Type in a field.

Source/WebInspectorUI:

Reviewed by Geoffrey Garen and Joseph Pecoraro.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Controllers/DebuggerManager.js:
  • UserInterface/Models/ScopeChainNode.js:
  • UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
  • Added handling of the FunctionNameScope case.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r173517 r174216  
    720720        MacroAssembler::Call callOperation(V_JITOperation_ECICC, RegisterID, const Identifier*, RegisterID, RegisterID);
    721721        MacroAssembler::Call callOperation(J_JITOperation_EE, RegisterID);
    722         MacroAssembler::Call callOperation(V_JITOperation_EIdJZ, const Identifier*, RegisterID, int32_t);
     722        MacroAssembler::Call callOperation(V_JITOperation_EIdJZZ, const Identifier*, RegisterID, int32_t, int32_t);
    723723        MacroAssembler::Call callOperation(V_JITOperation_EJ, RegisterID);
    724724#if USE(JSVALUE64)
     
    752752        MacroAssembler::Call callOperation(S_JITOperation_EJ, RegisterID, RegisterID);
    753753        MacroAssembler::Call callOperation(S_JITOperation_EJJ, RegisterID, RegisterID, RegisterID, RegisterID);
    754         MacroAssembler::Call callOperation(V_JITOperation_EIdJZ, const Identifier*, RegisterID, RegisterID, int32_t);
     754        MacroAssembler::Call callOperation(V_JITOperation_EIdJZZ, const Identifier*, RegisterID, RegisterID, int32_t, int32_t);
    755755        MacroAssembler::Call callOperation(V_JITOperation_EJ, RegisterID, RegisterID);
    756756        MacroAssembler::Call callOperation(V_JITOperation_EJJJ, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID);
Note: See TracChangeset for help on using the changeset viewer.