Fixed the Inspector to be able to properly distinguish between scope types.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 15:15:03 +0000 (15:15 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 15:15:03 +0000 (15:15 +0000)
commitbdf6f0e7b2de2bde714f66aff0a7bac6e1566241
tree4752fa62d46fb2c7de2c9e3f48900d9c0304c3aa
parentb15e14432f67dc49e8fd4c946e21398aeb88b5b1
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/BytecodeList.json
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/JavaScriptCore/debugger/DebuggerScope.cpp
Source/JavaScriptCore/debugger/DebuggerScope.h
Source/JavaScriptCore/inspector/InjectedScriptSource.js
Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp
Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h
Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp
Source/JavaScriptCore/inspector/protocol/Debugger.json
Source/JavaScriptCore/jit/CCallHelpers.h
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jit/JITInlines.h
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/JITOperations.h
Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
Source/JavaScriptCore/llint/LowLevelInterpreter.asm
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSNameScope.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js
Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js
Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js