<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188136] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188136">188136</a></dd>
<dt>Author</dt> <dd>saambarati1@gmail.com</dd>
<dt>Date</dt> <dd>2015-08-07 10:41:22 -0700 (Fri, 07 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Interpreter::unwind shouldn't be responsible for assigning the correct scope.
https://bugs.webkit.org/show_bug.cgi?id=147666
Reviewed by Geoffrey Garen.
If we make the bytecode generator know about every local scope it
creates, and if we give each local scope a unique register, the
bytecode generator has all the information it needs to assign
the correct scope to a catch handler. Because the bytecode generator
knows this information, it's a better separation of responsibilties
for it to set up the proper scope instead of relying on the exception
handling runtime to find the scope.
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
* bytecode/HandlerInfo.h:
(JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo):
(JSC::HandlerInfo::initialize):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
(JSC::BytecodeGenerator::emitGetScope):
(JSC::BytecodeGenerator::emitPushWithScope):
(JSC::BytecodeGenerator::emitGetParentScope):
(JSC::BytecodeGenerator::emitPopScope):
(JSC::BytecodeGenerator::emitPopWithScope):
(JSC::BytecodeGenerator::allocateAndEmitScope):
(JSC::BytecodeGenerator::emitComplexPopScopes):
(JSC::BytecodeGenerator::pushTry):
(JSC::BytecodeGenerator::popTryAndEmitCatch):
(JSC::BytecodeGenerator::localScopeDepth):
(JSC::BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::WithNode::emitBytecode):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::unwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::compileOpStrictEq):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_push_with_scope):
(JSC::JIT::emit_op_to_number):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/JSScope.cpp:
(JSC::JSScope::objectAtScope):
(JSC::isUnscopable):
(JSC::JSScope::depth): Deleted.
* runtime/JSScope.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeHandlerInfoh">trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodes32_64cpp">trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationsh">trunk/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathsh">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCommonSlowPathsh">trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopecpp">trunk/Source/JavaScriptCore/runtime/JSScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopeh">trunk/Source/JavaScriptCore/runtime/JSScope.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -1,3 +1,67 @@
</span><ins>+2015-08-07 Saam barati <saambarati1@gmail.com>
+
+ Interpreter::unwind shouldn't be responsible for assigning the correct scope.
+ https://bugs.webkit.org/show_bug.cgi?id=147666
+
+ Reviewed by Geoffrey Garen.
+
+ If we make the bytecode generator know about every local scope it
+ creates, and if we give each local scope a unique register, the
+ bytecode generator has all the information it needs to assign
+ the correct scope to a catch handler. Because the bytecode generator
+ knows this information, it's a better separation of responsibilties
+ for it to set up the proper scope instead of relying on the exception
+ handling runtime to find the scope.
+
+ * bytecode/BytecodeList.json:
+ * bytecode/BytecodeUseDef.h:
+ (JSC::computeUsesForBytecodeOffset):
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::dumpBytecode):
+ (JSC::CodeBlock::CodeBlock):
+ * bytecode/HandlerInfo.h:
+ (JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo):
+ (JSC::HandlerInfo::initialize):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::generate):
+ (JSC::BytecodeGenerator::pushLexicalScopeInternal):
+ (JSC::BytecodeGenerator::emitGetScope):
+ (JSC::BytecodeGenerator::emitPushWithScope):
+ (JSC::BytecodeGenerator::emitGetParentScope):
+ (JSC::BytecodeGenerator::emitPopScope):
+ (JSC::BytecodeGenerator::emitPopWithScope):
+ (JSC::BytecodeGenerator::allocateAndEmitScope):
+ (JSC::BytecodeGenerator::emitComplexPopScopes):
+ (JSC::BytecodeGenerator::pushTry):
+ (JSC::BytecodeGenerator::popTryAndEmitCatch):
+ (JSC::BytecodeGenerator::localScopeDepth):
+ (JSC::BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler): Deleted.
+ * bytecompiler/BytecodeGenerator.h:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::WithNode::emitBytecode):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::unwind):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::emit_op_push_with_scope):
+ (JSC::JIT::compileOpStrictEq):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_push_with_scope):
+ (JSC::JIT::emit_op_to_number):
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LLIntSlowPaths.h:
+ * llint/LowLevelInterpreter.asm:
+ * runtime/CommonSlowPaths.cpp:
+ (JSC::SLOW_PATH_DECL):
+ * runtime/CommonSlowPaths.h:
+ * runtime/JSScope.cpp:
+ (JSC::JSScope::objectAtScope):
+ (JSC::isUnscopable):
+ (JSC::JSScope::depth): Deleted.
+ * runtime/JSScope.h:
+
</ins><span class="cx"> 2015-08-07 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> Add MacroAssembler::patchableBranch64 and fix ARM64's patchableBranchPtr
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx"> { "name" : "op_put_to_scope", "length" : 7 },
</span><span class="cx"> { "name" : "op_get_from_arguments", "length" : 5 },
</span><span class="cx"> { "name" : "op_put_to_arguments", "length" : 4 },
</span><del>- { "name" : "op_push_with_scope", "length" : 3 },
</del><ins>+ { "name" : "op_push_with_scope", "length" : 4 },
</ins><span class="cx"> { "name" : "op_create_lexical_environment", "length" : 5 },
</span><span class="cx"> { "name" : "op_get_parent_scope", "length" : 3 },
</span><span class="cx"> { "name" : "op_catch", "length" : 3 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -116,7 +116,6 @@
</span><span class="cx"> case op_get_enumerable_length:
</span><span class="cx"> case op_new_func_exp:
</span><span class="cx"> case op_to_index_string:
</span><del>- case op_push_with_scope:
</del><span class="cx"> case op_create_lexical_environment:
</span><span class="cx"> case op_resolve_scope:
</span><span class="cx"> case op_get_from_scope:
</span><span class="lines">@@ -177,6 +176,7 @@
</span><span class="cx"> case op_stricteq:
</span><span class="cx"> case op_neq:
</span><span class="cx"> case op_eq:
</span><ins>+ case op_push_with_scope:
</ins><span class="cx"> case op_del_by_val: {
</span><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[2].u.operand);
</span><span class="cx"> functor(codeBlock, instruction, opcodeID, instruction[3].u.operand);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -644,8 +644,8 @@
</span><span class="cx"> unsigned i = 0;
</span><span class="cx"> do {
</span><span class="cx"> HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
</span><del>- out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] depth: [%4d] } %s\n",
- i + 1, handler.start, handler.end, handler.target, handler.scopeDepth, handler.typeName());
</del><ins>+ out.printf("\t %d: { start: [%4d] end: [%4d] target: [%4d] } %s\n",
+ i + 1, handler.start, handler.end, handler.target, handler.typeName());
</ins><span class="cx"> ++i;
</span><span class="cx"> } while (i < m_rareData->m_exceptionHandlers.size());
</span><span class="cx"> }
</span><span class="lines">@@ -1429,8 +1429,9 @@
</span><span class="cx"> case op_push_with_scope: {
</span><span class="cx"> int dst = (++it)->u.operand;
</span><span class="cx"> int newScope = (++it)->u.operand;
</span><ins>+ int currentScope = (++it)->u.operand;
</ins><span class="cx"> printLocationAndOp(out, exec, location, it, "push_with_scope");
</span><del>- out.printf("%s, %s", registerName(dst).data(), registerName(newScope).data());
</del><ins>+ out.printf("%s, %s, %s", registerName(dst).data(), registerName(newScope).data(), registerName(currentScope).data());
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx"> case op_get_parent_scope: {
</span><span class="lines">@@ -1789,15 +1790,13 @@
</span><span class="cx"> }
</span><span class="cx"> if (size_t count = unlinkedCodeBlock->numberOfExceptionHandlers()) {
</span><span class="cx"> m_rareData->m_exceptionHandlers.resizeToFit(count);
</span><del>- size_t nonLocalScopeDepth = scope->depth();
</del><span class="cx"> for (size_t i = 0; i < count; i++) {
</span><span class="cx"> const UnlinkedHandlerInfo& unlinkedHandler = unlinkedCodeBlock->exceptionHandler(i);
</span><span class="cx"> HandlerInfo& handler = m_rareData->m_exceptionHandlers[i];
</span><span class="cx"> #if ENABLE(JIT)
</span><del>- handler.initialize(unlinkedHandler, nonLocalScopeDepth,
- CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr(op_catch))));
</del><ins>+ handler.initialize(unlinkedHandler, CodeLocationLabel(MacroAssemblerCodePtr::createFromExecutableAddress(LLInt::getCodePtr(op_catch))));
</ins><span class="cx"> #else
</span><del>- handler.initialize(unlinkedHandler, nonLocalScopeDepth);
</del><ins>+ handler.initialize(unlinkedHandler);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeHandlerInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecode/HandlerInfo.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -61,36 +61,33 @@
</span><span class="cx"> uint32_t start;
</span><span class="cx"> uint32_t end;
</span><span class="cx"> uint32_t target;
</span><del>- uint32_t scopeDepth : 30;
</del><span class="cx"> uint32_t typeBits : 2; // HandlerType
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> struct UnlinkedHandlerInfo : public HandlerInfoBase {
</span><del>- UnlinkedHandlerInfo(uint32_t start, uint32_t end, uint32_t target, uint32_t scopeDepth, HandlerType handlerType)
</del><ins>+ UnlinkedHandlerInfo(uint32_t start, uint32_t end, uint32_t target, HandlerType handlerType)
</ins><span class="cx"> {
</span><span class="cx"> this->start = start;
</span><span class="cx"> this->end = end;
</span><span class="cx"> this->target = target;
</span><del>- this->scopeDepth = scopeDepth;
</del><span class="cx"> setType(handlerType);
</span><span class="cx"> ASSERT(type() == handlerType);
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> struct HandlerInfo : public HandlerInfoBase {
</span><del>- void initialize(const UnlinkedHandlerInfo& unlinkedInfo, size_t nonLocalScopeDepth)
</del><ins>+ void initialize(const UnlinkedHandlerInfo& unlinkedInfo)
</ins><span class="cx"> {
</span><span class="cx"> start = unlinkedInfo.start;
</span><span class="cx"> end = unlinkedInfo.end;
</span><span class="cx"> target = unlinkedInfo.target;
</span><del>- scopeDepth = unlinkedInfo.scopeDepth + nonLocalScopeDepth;
</del><span class="cx"> typeBits = unlinkedInfo.typeBits;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(JIT)
</span><del>- void initialize(const UnlinkedHandlerInfo& unlinkedInfo, size_t nonLocalScopeDepth, CodeLocationLabel label)
</del><ins>+ void initialize(const UnlinkedHandlerInfo& unlinkedInfo, CodeLocationLabel label)
</ins><span class="cx"> {
</span><del>- initialize(unlinkedInfo, nonLocalScopeDepth);
</del><ins>+ initialize(unlinkedInfo);
</ins><span class="cx"> nativeCode = label;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -74,29 +74,16 @@
</span><span class="cx">
</span><span class="cx"> {
</span><span class="cx"> RefPtr<RegisterID> temp = newTemporary();
</span><del>- RefPtr<RegisterID> globalScope;
</del><ins>+ RefPtr<RegisterID> globalScope = m_topMostScope;
</ins><span class="cx"> for (auto functionPair : m_functionsToInitialize) {
</span><span class="cx"> FunctionBodyNode* functionBody = functionPair.first;
</span><span class="cx"> FunctionVariableType functionType = functionPair.second;
</span><span class="cx"> emitNewFunction(temp.get(), functionBody);
</span><span class="cx"> if (functionType == NormalFunctionVariable)
</span><span class="cx"> initializeVariable(variable(functionBody->ident()) , temp.get());
</span><del>- else if (functionType == GlobalFunctionVariable) {
- if (!globalScope) {
- if (m_symbolTableStack.isEmpty() || !m_symbolTableStack.first().m_scope) {
- // We haven't allocated a lexical scope on top of the global object, so scopeRegister() will correspond to the global scope.
- globalScope = scopeRegister();
- } else {
- // We know this will resolve to the global object because our parser doesn't allow
- // "let" variables to have the same names as functions.
- ASSERT(m_scopeNode->lexicalVariables().hasCapturedVariables());
- RefPtr<RegisterID> globalObjectScope = emitResolveScope(nullptr, Variable(functionBody->ident()));
- globalScope = newBlockScopeVariable();
- emitMove(globalScope.get(), globalObjectScope.get());
- }
- }
</del><ins>+ else if (functionType == GlobalFunctionVariable)
</ins><span class="cx"> emitPutToScope(globalScope.get(), Variable(functionBody->ident()), temp.get(), ThrowIfNotFound);
</span><del>- } else
</del><ins>+ else
</ins><span class="cx"> RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -137,11 +124,9 @@
</span><span class="cx"> if (end <= start)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- ASSERT(range.tryData->targetScopeDepth != UINT_MAX);
</del><span class="cx"> ASSERT(range.tryData->handlerType != HandlerType::Illegal);
</span><span class="cx"> UnlinkedHandlerInfo info(static_cast<uint32_t>(start), static_cast<uint32_t>(end),
</span><del>- static_cast<uint32_t>(range.tryData->target->bind()), range.tryData->targetScopeDepth,
- range.tryData->handlerType);
</del><ins>+ static_cast<uint32_t>(range.tryData->target->bind()), range.tryData->handlerType);
</ins><span class="cx"> m_codeBlock->addExceptionHandler(info);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2635,13 +2620,21 @@
</span><span class="cx"> instructions().append(scopeRegister()->index());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* dst, RegisterID* scope)
</del><ins>+RegisterID* BytecodeGenerator::emitPushWithScope(RegisterID* objectScope)
</ins><span class="cx"> {
</span><span class="cx"> pushScopedControlFlowContext();
</span><ins>+ RegisterID* newScope = newBlockScopeVariable();
+ newScope->ref();
</ins><span class="cx">
</span><del>- RegisterID* result = emitUnaryOp(op_push_with_scope, dst, scope);
- m_symbolTableStack.append(SymbolTableStackEntry{ Strong<SymbolTable>(), nullptr, true, 0 });
- return result;
</del><ins>+ emitOpcode(op_push_with_scope);
+ instructions().append(newScope->index());
+ instructions().append(objectScope->index());
+ instructions().append(scopeRegister()->index());
+
+ emitMove(scopeRegister(), newScope);
+ m_symbolTableStack.append(SymbolTableStackEntry{ Strong<SymbolTable>(), newScope, true, 0 });
+
+ return newScope;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RegisterID* BytecodeGenerator::emitGetParentScope(RegisterID* dst, RegisterID* scope)
</span><span class="lines">@@ -2658,11 +2651,12 @@
</span><span class="cx"> emitMove(dst, parentScope.get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BytecodeGenerator::emitPopWithScope(RegisterID* srcDst)
</del><ins>+void BytecodeGenerator::emitPopWithScope()
</ins><span class="cx"> {
</span><del>- emitPopScope(srcDst, srcDst);
</del><ins>+ emitPopScope(scopeRegister(), scopeRegister());
</ins><span class="cx"> popScopedControlFlowContext();
</span><span class="cx"> SymbolTableStackEntry stackEntry = m_symbolTableStack.takeLast();
</span><ins>+ stackEntry.m_scope->deref();
</ins><span class="cx"> RELEASE_ASSERT(stackEntry.m_isWithScope);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2841,6 +2835,8 @@
</span><span class="cx"> m_scopeRegister->ref();
</span><span class="cx"> m_codeBlock->setScopeRegister(scopeRegister()->virtualRegister());
</span><span class="cx"> emitGetScope();
</span><ins>+ m_topMostScope = addVar();
+ emitMove(m_topMostScope, scopeRegister());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void BytecodeGenerator::emitComplexPopScopes(RegisterID* scope, ControlFlowContext* topScope, ControlFlowContext* bottomScope)
</span><span class="lines">@@ -2998,7 +2994,6 @@
</span><span class="cx"> {
</span><span class="cx"> TryData tryData;
</span><span class="cx"> tryData.target = newLabel();
</span><del>- tryData.targetScopeDepth = UINT_MAX;
</del><span class="cx"> tryData.handlerType = HandlerType::Illegal;
</span><span class="cx"> m_tryData.append(tryData);
</span><span class="cx"> TryData* result = &m_tryData.last();
</span><span class="lines">@@ -3026,27 +3021,24 @@
</span><span class="cx"> m_tryContextStack.removeLast();
</span><span class="cx">
</span><span class="cx"> emitLabel(tryRange.tryData->target.get());
</span><del>- tryRange.tryData->targetScopeDepth = calculateTargetScopeDepthForExceptionHandler();
</del><span class="cx"> tryRange.tryData->handlerType = handlerType;
</span><span class="cx">
</span><span class="cx"> emitOpcode(op_catch);
</span><span class="cx"> instructions().append(exceptionRegister->index());
</span><span class="cx"> instructions().append(thrownValueRegister->index());
</span><del>-}
</del><span class="cx">
</span><del>-int BytecodeGenerator::calculateTargetScopeDepthForExceptionHandler() const
-{
- int depth = localScopeDepth();
-
- // Currently, we're maintaing compatibility with how things are done and letting the exception handling
- // code take into consideration the base activation of the function. There is no reason we shouldn't
- // be able to calculate the exact depth here and let the exception handler not worry if there is a base
- // activation or not.
- if (m_lexicalEnvironmentRegister)
- depth--;
-
- ASSERT(depth >= 0);
- return depth;
</del><ins>+ bool foundLocalScope = false;
+ for (unsigned i = m_symbolTableStack.size(); i--; ) {
+ // Note that if we don't find a local scope in the current function/program,
+ // we must grab the outer-most scope of this bytecode generation.
+ if (m_symbolTableStack[i].m_scope) {
+ foundLocalScope = true;
+ emitMove(scopeRegister(), m_symbolTableStack[i].m_scope);
+ break;
+ }
+ }
+ if (!foundLocalScope)
+ emitMove(scopeRegister(), m_topMostScope);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> int BytecodeGenerator::localScopeDepth() const
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -176,7 +176,6 @@
</span><span class="cx">
</span><span class="cx"> struct TryData {
</span><span class="cx"> RefPtr<Label> target;
</span><del>- unsigned targetScopeDepth;
</del><span class="cx"> HandlerType handlerType;
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -593,10 +592,8 @@
</span><span class="cx"> void emitPopCatchScope(VariableEnvironment&);
</span><span class="cx">
</span><span class="cx"> void emitGetScope();
</span><del>- RegisterID* emitPushWithScope(RegisterID* dst, RegisterID* scope);
- void emitPopScope(RegisterID* dst, RegisterID* scope);
- void emitPopWithScope(RegisterID* srcDst);
- RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope);
</del><ins>+ RegisterID* emitPushWithScope(RegisterID* objectScope);
+ void emitPopWithScope();
</ins><span class="cx">
</span><span class="cx"> void emitDebugHook(DebugHookID, unsigned line, unsigned charOffset, unsigned lineStart);
</span><span class="cx">
</span><span class="lines">@@ -636,6 +633,8 @@
</span><span class="cx"> enum class ScopeRegisterType { Var, Block };
</span><span class="cx"> void pushLexicalScopeInternal(VariableEnvironment&, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult, TDZRequirement, ScopeType, ScopeRegisterType);
</span><span class="cx"> void popLexicalScopeInternal(VariableEnvironment&, TDZRequirement);
</span><ins>+ void emitPopScope(RegisterID* dst, RegisterID* scope);
+ RegisterID* emitGetParentScope(RegisterID* dst, RegisterID* scope);
</ins><span class="cx"> public:
</span><span class="cx"> void pushLexicalScope(VariableEnvironmentNode*, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult = nullptr);
</span><span class="cx"> void popLexicalScope(VariableEnvironmentNode*);
</span><span class="lines">@@ -767,6 +766,7 @@
</span><span class="cx"> RegisterID m_thisRegister;
</span><span class="cx"> RegisterID m_calleeRegister;
</span><span class="cx"> RegisterID* m_scopeRegister { nullptr };
</span><ins>+ RegisterID* m_topMostScope { nullptr };
</ins><span class="cx"> RegisterID* m_argumentsRegister { nullptr };
</span><span class="cx"> RegisterID* m_lexicalEnvironmentRegister { nullptr };
</span><span class="cx"> RegisterID* m_emptyValueRegister { nullptr };
</span><span class="lines">@@ -783,7 +783,6 @@
</span><span class="cx"> int m_localScopeDepth { 0 };
</span><span class="cx"> const CodeType m_codeType;
</span><span class="cx">
</span><del>- int calculateTargetScopeDepthForExceptionHandler() const;
</del><span class="cx"> int localScopeDepth() const;
</span><span class="cx"> void pushScopedControlFlowContext();
</span><span class="cx"> void popScopedControlFlowContext();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -2574,9 +2574,9 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<RegisterID> scope = generator.emitNode(m_expr);
</span><span class="cx"> generator.emitExpressionInfo(m_divot, m_divot - m_expressionLength, m_divot);
</span><del>- generator.emitPushWithScope(generator.scopeRegister(), scope.get());
</del><ins>+ generator.emitPushWithScope(scope.get());
</ins><span class="cx"> generator.emitNode(dst, m_statement);
</span><del>- generator.emitPopWithScope(generator.scopeRegister());
</del><ins>+ generator.emitPopWithScope();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // ------------------------------ CaseClauseNode --------------------------------
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -705,21 +705,6 @@
</span><span class="cx"> if (LegacyProfiler* profiler = vm.enabledProfiler())
</span><span class="cx"> profiler->exceptionUnwind(callFrame);
</span><span class="cx">
</span><del>- // Unwind the scope chain within the exception handler's call frame.
- int targetScopeDepth = handler->scopeDepth;
- if (codeBlock->needsActivation() && callFrame->hasActivation())
- ++targetScopeDepth;
-
- int scopeRegisterOffset = codeBlock->scopeRegister().offset();
- JSScope* scope = callFrame->scope(scopeRegisterOffset);
- int scopeDelta = scope->depth() - targetScopeDepth;
- RELEASE_ASSERT(scopeDelta >= 0);
-
- while (scopeDelta--)
- scope = scope->next();
-
- callFrame->setScope(scopeRegisterOffset, scope);
-
</del><span class="cx"> return handler;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -425,9 +425,8 @@
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_push_with_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>- int dst = currentInstruction[1].u.operand;
- emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
- callOperation(operationPushWithScope, dst, regT0);
</del><ins>+ JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_push_with_scope);
+ slowPathCall.call();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::compileOpStrictEq(Instruction* currentInstruction, CompileOpStrictEqType type)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -748,9 +748,8 @@
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_push_with_scope(Instruction* currentInstruction)
</span><span class="cx"> {
</span><del>- int dst = currentInstruction[1].u.operand;
- emitLoad(currentInstruction[2].u.operand, regT1, regT0);
- callOperation(operationPushWithScope, dst, regT1, regT0);
</del><ins>+ JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_push_with_scope);
+ slowPathCall.call();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void JIT::emit_op_to_number(Instruction* currentInstruction)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -1339,21 +1339,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void JIT_OPERATION operationPushWithScope(ExecState* exec, int32_t dst, EncodedJSValue encodedValue)
-{
- VM& vm = exec->vm();
- NativeCallFrameTracer tracer(&vm, exec);
-
- JSObject* o = JSValue::decode(encodedValue).toObject(exec);
- if (vm.exception())
- return;
-
- // FIXME: This won't work if this operation is called from the DFG or FTL.
- // This should be changed to pass in the old scope and return the new scope.
- JSScope* currentScope = exec->uncheckedR(dst).Register::scope();
- exec->uncheckedR(dst) = JSWithScope::create(exec, o, currentScope);
-}
-
</del><span class="cx"> void JIT_OPERATION operationPopScope(ExecState* exec, int32_t scopeReg)
</span><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -308,7 +308,6 @@
</span><span class="cx"> void JIT_OPERATION operationPutGetterSetter(ExecState*, JSCell*, Identifier*, JSCell*, JSCell*) WTF_INTERNAL;
</span><span class="cx"> #endif
</span><span class="cx"> void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
</span><del>-void JIT_OPERATION operationPushWithScope(ExecState*, int32_t, EncodedJSValue) WTF_INTERNAL;
</del><span class="cx"> void JIT_OPERATION operationPopScope(ExecState*, int32_t) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationProfileDidCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationProfileWillCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -1263,20 +1263,6 @@
</span><span class="cx"> LLINT_RETURN(LLINT_OP_C(2).jsValue().toPrimitive(exec));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LLINT_SLOW_PATH_DECL(slow_path_push_with_scope)
-{
- LLINT_BEGIN();
- JSValue v = LLINT_OP_C(2).jsValue();
- JSObject* o = v.toObject(exec);
- LLINT_CHECK_EXCEPTION();
-
- int scopeReg = pc[1].u.operand;
- JSScope* currentScope = exec->uncheckedR(scopeReg).Register::scope();
- exec->uncheckedR(scopeReg) = JSWithScope::create(exec, o, currentScope);
-
- LLINT_END();
-}
-
</del><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_throw)
</span><span class="cx"> {
</span><span class="cx"> LLINT_BEGIN();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -106,7 +106,6 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_arguments);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_strcat);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_to_primitive);
</span><del>-LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_push_with_scope);
</del><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw_static_error);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_watchdog_timer);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -1283,8 +1283,8 @@
</span><span class="cx">
</span><span class="cx"> _llint_op_push_with_scope:
</span><span class="cx"> traceExecution()
</span><del>- callSlowPath(_llint_slow_path_push_with_scope)
- dispatch(3)
</del><ins>+ callSlowPath(_slow_path_push_with_scope)
+ dispatch(4)
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> _llint_op_create_lexical_environment:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -649,4 +649,15 @@
</span><span class="cx"> RETURN(newScope);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SLOW_PATH_DECL(slow_path_push_with_scope)
+{
+ BEGIN();
+ JSObject* newScope = OP_C(2).jsValue().toObject(exec);
+ CHECK_EXCEPTION();
+
+ int scopeReg = pc[3].u.operand;
+ JSScope* currentScope = exec->uncheckedR(scopeReg).Register::scope();
+ RETURN(JSWithScope::create(exec, newScope, currentScope));
+}
+
</ins><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCommonSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -234,6 +234,7 @@
</span><span class="cx"> SLOW_PATH_HIDDEN_DECL(slow_path_to_index_string);
</span><span class="cx"> SLOW_PATH_HIDDEN_DECL(slow_path_profile_type_clear_log);
</span><span class="cx"> SLOW_PATH_HIDDEN_DECL(slow_path_create_lexical_environment);
</span><ins>+SLOW_PATH_HIDDEN_DECL(slow_path_push_with_scope);
</ins><span class="cx">
</span><span class="cx"> } // namespace JSC
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.cpp (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -124,14 +124,6 @@
</span><span class="cx"> return object;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-int JSScope::depth()
-{
- int depth = 0;
- for (JSScope* scope = this; scope; scope = scope->next())
- ++depth;
- return depth;
-}
-
</del><span class="cx"> // When an exception occurs, the result of isUnscopable becomes false.
</span><span class="cx"> static inline bool isUnscopable(ExecState* exec, JSScope* scope, JSObject* object, const Identifier& ident)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.h (188135 => 188136)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.h        2015-08-07 17:31:27 UTC (rev 188135)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.h        2015-08-07 17:41:22 UTC (rev 188136)
</span><span class="lines">@@ -171,7 +171,6 @@
</span><span class="cx"> ScopeChainIterator begin();
</span><span class="cx"> ScopeChainIterator end();
</span><span class="cx"> JSScope* next();
</span><del>- int depth();
</del><span class="cx">
</span><span class="cx"> JSGlobalObject* globalObject();
</span><span class="cx"> VM* vm();
</span></span></pre>
</div>
</div>
</body>
</html>