<!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>[160253] branches/jsCStack/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/160253">160253</a></dd>
<dt>Author</dt> <dd>msaboff@apple.com</dd>
<dt>Date</dt> <dd>2013-12-06 14:54:41 -0800 (Fri, 06 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre> Merged from trunk <a href="http://trac.webkit.org/projects/webkit/changeset/160244">r160244</a>: <http://trac.webkit.org/changeset/160244>
Split sizing of VarArgs frames from loading arguments for the frame
https://bugs.webkit.org/show_bug.cgi?id=125331
Reviewed by Filip Pizlo.
Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
preparation for moving onto the C stack. sizeAndAllocFrameForVarargs() will
compute the size of the callee frame and allocate it, while loadVarargs()
actually loads the argument values.
As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
changed to a function that just computes the size. The caller will use that
size to allocate the new frame on the stack before calling loadVargs() and
actually making the call.
* interpreter/Interpreter.cpp:
(JSC::sizeAndAllocFrameForVarargs):
(JSC::loadVarargs):
* interpreter/Interpreter.h:
* jit/JIT.h:
* jit/JITCall.cpp:
(JSC::JIT::compileLoadVarargs):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileLoadVarargs):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/VM.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchesjsCStackSourceJavaScriptCoreChangeLog">branches/jsCStack/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreinterpreterInterpretercpp">branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreinterpreterInterpreterh">branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITh">branches/jsCStack/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITCallcpp">branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITCall32_64cpp">branches/jsCStack/Source/JavaScriptCore/jit/JITCall32_64.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITInlinesh">branches/jsCStack/Source/JavaScriptCore/jit/JITInlines.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITOperationscpp">branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorejitJITOperationsh">branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLLIntSlowPathscpp">branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLLIntSlowPathsh">branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreterasm">branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreter32_64asm">branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreter64asm">branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm</a></li>
<li><a href="#branchesjsCStackSourceJavaScriptCoreruntimeVMh">branches/jsCStack/Source/JavaScriptCore/runtime/VM.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchesjsCStackSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/ChangeLog (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/ChangeLog        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -1,3 +1,81 @@
</span><ins>+2013-12-06 Michael Saboff <msaboff@apple.com>
+
+ Merged from trunk r160244: <http://trac.webkit.org/changeset/160244>
+
+ Split sizing of VarArgs frames from loading arguments for the frame
+ https://bugs.webkit.org/show_bug.cgi?id=125331
+
+ Reviewed by Filip Pizlo.
+
+ Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
+ preparation for moving onto the C stack. sizeAndAllocFrameForVarargs() will
+ compute the size of the callee frame and allocate it, while loadVarargs()
+ actually loads the argument values.
+
+ As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
+ changed to a function that just computes the size. The caller will use that
+ size to allocate the new frame on the stack before calling loadVargs() and
+ actually making the call.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::sizeAndAllocFrameForVarargs):
+ (JSC::loadVarargs):
+ * interpreter/Interpreter.h:
+ * jit/JIT.h:
+ * jit/JITCall.cpp:
+ (JSC::JIT::compileLoadVarargs):
+ * jit/JITCall32_64.cpp:
+ (JSC::JIT::compileLoadVarargs):
+ * jit/JITInlines.h:
+ (JSC::JIT::callOperation):
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LLIntSlowPaths.h:
+ * llint/LowLevelInterpreter.asm:
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/VM.h:
+
+2013-12-06 Michael Saboff <msaboff@apple.com>
+
+ Split sizing of VarArgs frames from loading arguments for the frame
+ https://bugs.webkit.org/show_bug.cgi?id=125331
+
+ Reviewed by Filip Pizlo.
+
+ Split loadVarargs into sizeAndAllocFrameForVarargs() and loadVarargs() in
+ preparation for moving onto the C stack. sizeAndAllocFrameForVarargs() will
+ compute the size of the callee frame and allocate it, while loadVarargs()
+ actually loads the argument values.
+
+ As part of moving onto the C stack, sizeAndAllocFrameForVarargs() will be
+ changed to a function that just computes the size. The caller will use that
+ size to allocate the new frame on the stack before calling loadVargs() and
+ actually making the call.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::sizeAndAllocFrameForVarargs):
+ (JSC::loadVarargs):
+ * interpreter/Interpreter.h:
+ * jit/JIT.h:
+ * jit/JITCall.cpp:
+ (JSC::JIT::compileLoadVarargs):
+ * jit/JITCall32_64.cpp:
+ (JSC::JIT::compileLoadVarargs):
+ * jit/JITInlines.h:
+ (JSC::JIT::callOperation):
+ * jit/JITOperations.cpp:
+ * jit/JITOperations.h:
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * llint/LLIntSlowPaths.h:
+ * llint/LowLevelInterpreter.asm:
+ * llint/LowLevelInterpreter32_64.asm:
+ * llint/LowLevelInterpreter64.asm:
+ * runtime/VM.h:
+
</ins><span class="cx"> 2013-12-06 Laszlo Vidacs <lac@inf.u-szeged.hu>
</span><span class="cx">
</span><span class="cx"> Define SHA1 hash size in SHA1.h and use it at various places.
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.cpp (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.cpp        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.cpp        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> return interpreter->execute(eval, callFrame, thisValue, callerScopeChain);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CallFrame* loadVarargs(CallFrame* callFrame, JSStack* stack, JSValue thisValue, JSValue arguments, int firstFreeRegister)
</del><ins>+CallFrame* sizeAndAllocFrameForVarargs(CallFrame* callFrame, JSStack* stack, JSValue arguments, int firstFreeRegister)
</ins><span class="cx"> {
</span><span class="cx"> if (!arguments) { // f.apply(x, arguments), with arguments unmodified.
</span><span class="cx"> unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
</span><span class="lines">@@ -161,11 +161,6 @@
</span><span class="cx"> callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>-
- newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis);
- newCallFrame->setThisValue(thisValue);
- for (size_t i = 0; i < callFrame->argumentCount(); ++i)
- newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i));
</del><span class="cx"> return newCallFrame;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -175,8 +170,6 @@
</span><span class="cx"> callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>- newCallFrame->setArgumentCountIncludingThis(1);
- newCallFrame->setThisValue(thisValue);
</del><span class="cx"> return newCallFrame;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -193,9 +186,6 @@
</span><span class="cx"> callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>- newCallFrame->setArgumentCountIncludingThis(argCount + 1);
- newCallFrame->setThisValue(thisValue);
- argsObject->copyToArguments(callFrame, newCallFrame, argCount);
</del><span class="cx"> return newCallFrame;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -207,9 +197,6 @@
</span><span class="cx"> callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><del>- newCallFrame->setArgumentCountIncludingThis(argCount + 1);
- newCallFrame->setThisValue(thisValue);
- array->copyToArguments(callFrame, newCallFrame, argCount);
</del><span class="cx"> return newCallFrame;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -220,14 +207,54 @@
</span><span class="cx"> callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame));
</span><span class="cx"> return 0;
</span><span class="cx"> }
</span><ins>+ return newCallFrame;
+}
+
+void loadVarargs(CallFrame* callFrame, CallFrame* newCallFrame, JSValue thisValue, JSValue arguments)
+{
+ if (!arguments) { // f.apply(x, arguments), with arguments unmodified.
+ unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
+
+ newCallFrame->setArgumentCountIncludingThis(argumentCountIncludingThis);
+ newCallFrame->setThisValue(thisValue);
+ for (size_t i = 0; i < callFrame->argumentCount(); ++i)
+ newCallFrame->setArgument(i, callFrame->argumentAfterCapture(i));
+ return;
+ }
+
+ if (arguments.isUndefinedOrNull()) {
+ newCallFrame->setArgumentCountIncludingThis(1);
+ newCallFrame->setThisValue(thisValue);
+ return;
+ }
+
+ if (asObject(arguments)->classInfo() == Arguments::info()) {
+ Arguments* argsObject = asArguments(arguments);
+ unsigned argCount = argsObject->length(callFrame);
+ newCallFrame->setArgumentCountIncludingThis(argCount + 1);
+ newCallFrame->setThisValue(thisValue);
+ argsObject->copyToArguments(callFrame, newCallFrame, argCount);
+ return;
+ }
+
+ if (isJSArray(arguments)) {
+ JSArray* array = asArray(arguments);
+ unsigned argCount = array->length();
+ newCallFrame->setArgumentCountIncludingThis(argCount + 1);
+ newCallFrame->setThisValue(thisValue);
+ array->copyToArguments(callFrame, newCallFrame, argCount);
+ return;
+ }
+
+ JSObject* argObject = asObject(arguments);
+ unsigned argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame);
</ins><span class="cx"> newCallFrame->setArgumentCountIncludingThis(argCount + 1);
</span><span class="cx"> newCallFrame->setThisValue(thisValue);
</span><span class="cx"> for (size_t i = 0; i < argCount; ++i) {
</span><span class="cx"> newCallFrame->setArgument(i, asObject(arguments)->get(callFrame, i));
</span><span class="cx"> if (UNLIKELY(callFrame->vm().exception()))
</span><del>- return 0;
</del><ins>+ return;
</ins><span class="cx"> }
</span><del>- return newCallFrame;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Interpreter::Interpreter(VM& vm)
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreinterpreterInterpreterh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/interpreter/Interpreter.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -286,8 +286,8 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> JSValue eval(CallFrame*);
</span><del>- CallFrame* loadVarargs(CallFrame*, JSStack*, JSValue thisValue, JSValue arguments, int firstFreeRegister);
-
</del><ins>+ CallFrame* sizeAndAllocFrameForVarargs(CallFrame*, JSStack*, JSValue, int);
+ void loadVarargs(CallFrame*, CallFrame*, JSValue, JSValue);
</ins><span class="cx"> } // namespace JSC
</span><span class="cx">
</span><span class="cx"> #endif // Interpreter_h
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JIT.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JIT.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -670,7 +670,7 @@
</span><span class="cx"> MacroAssembler::Call callOperation(C_JITOperation_EO, GPRReg);
</span><span class="cx"> MacroAssembler::Call callOperation(C_JITOperation_ESt, Structure*);
</span><span class="cx"> MacroAssembler::Call callOperation(C_JITOperation_EZ, int32_t);
</span><del>- MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, int32_t);
</del><ins>+ MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, int32_t);
</ins><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_E, int);
</span><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg);
</span><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EAapJcpZ, int, ArrayAllocationProfile*, GPRReg, int32_t);
</span><span class="lines">@@ -711,6 +711,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_EJIdJJ, RegisterID, const Identifier*, RegisterID, RegisterID);
</span><span class="cx"> #if USE(JSVALUE64)
</span><ins>+ MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID);
</ins><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, StringImpl*);
</span><span class="cx"> #else
</span><span class="cx"> MacroAssembler::Call callOperation(V_JITOperation_ESsiJJI, StructureStubInfo*, RegisterID, RegisterID, RegisterID, RegisterID, StringImpl*);
</span><span class="lines">@@ -724,7 +725,8 @@
</span><span class="cx"> MacroAssembler::Call callOperationWithCallFrameRollbackOnException(V_JITOperation_ECb, CodeBlock*);
</span><span class="cx"> MacroAssembler::Call callOperationWithCallFrameRollbackOnException(Z_JITOperation_E);
</span><span class="cx"> #if USE(JSVALUE32_64)
</span><del>- MacroAssembler::Call callOperation(F_JITOperation_EJJZ, GPRReg, GPRReg, GPRReg, GPRReg, int32_t);
</del><ins>+ MacroAssembler::Call callOperation(F_JITOperation_EFJJ, RegisterID, RegisterID, RegisterID, RegisterID, RegisterID);
+ MacroAssembler::Call callOperation(F_JITOperation_EJZ, GPRReg, GPRReg, int32_t);
</ins><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EAapJ, int, ArrayAllocationProfile*, GPRReg, GPRReg);
</span><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EJ, int, GPRReg, GPRReg);
</span><span class="cx"> MacroAssembler::Call callOperation(J_JITOperation_EJIdc, int, GPRReg, GPRReg, const Identifier*);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITCallcpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITCall.cpp        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -104,9 +104,11 @@
</span><span class="cx"> if (canOptimize)
</span><span class="cx"> slowCase.link(this);
</span><span class="cx">
</span><del>- emitGetVirtualRegister(thisValue, regT0);
</del><span class="cx"> emitGetVirtualRegister(arguments, regT1);
</span><del>- callOperation(operationLoadVarargs, regT0, regT1, firstFreeRegister);
</del><ins>+ callOperation(operationSizeAndAllocFrameForVarargs, regT1, firstFreeRegister);
+ emitGetVirtualRegister(thisValue, regT1);
+ emitGetVirtualRegister(arguments, regT2);
+ callOperation(operationLoadVarargs, returnValueGPR, regT1, regT2);
</ins><span class="cx"> move(returnValueGPR, regT1);
</span><span class="cx">
</span><span class="cx"> if (canOptimize)
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITCall32_64cpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITCall32_64.cpp (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITCall32_64.cpp        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITCall32_64.cpp        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -184,9 +184,12 @@
</span><span class="cx"> if (canOptimize)
</span><span class="cx"> slowCase.link(this);
</span><span class="cx">
</span><ins>+ emitLoad(arguments, regT1, regT0);
+ callOperation(operationSizeAndAllocFrameForVarargs, regT1, regT0, firstFreeRegister);
+ move(returnValueGPR, regT5);
</ins><span class="cx"> emitLoad(thisValue, regT1, regT0);
</span><span class="cx"> emitLoad(arguments, regT3, regT2);
</span><del>- callOperation(operationLoadVarargs, regT1, regT0, regT3, regT2, firstFreeRegister);
</del><ins>+ callOperation(operationLoadVarargs, regT5, regT1, regT0, regT3, regT2);
</ins><span class="cx"> move(returnValueGPR, regT3);
</span><span class="cx">
</span><span class="cx"> if (canOptimize)
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITInlinesh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITInlines.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITInlines.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITInlines.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -285,12 +285,18 @@
</span><span class="cx">
</span><span class="cx">
</span><span class="cx"> #if USE(JSVALUE64)
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1, GPRReg arg2, int32_t arg3)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1, int32_t arg3)
</ins><span class="cx"> {
</span><del>- setupArgumentsWithExecState(arg1, arg2, TrustedImm32(arg3));
</del><ins>+ setupArgumentsWithExecState(arg1, TrustedImm32(arg3));
</ins><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2, GPRReg arg3)
+{
+ setupArgumentsWithExecState(arg1, arg2, arg3);
+ return appendCallWithExceptionCheck(operation);
+}
+
</ins><span class="cx"> ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(V_JITOperation_ESsiJJI operation, StructureStubInfo* stubInfo, RegisterID regOp1, RegisterID regOp2, StringImpl* uid)
</span><span class="cx"> {
</span><span class="cx"> setupArgumentsWithExecState(TrustedImmPtr(stubInfo), regOp1, regOp2, TrustedImmPtr(uid));
</span><span class="lines">@@ -420,17 +426,23 @@
</span><span class="cx"> return appendCall(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, GPRReg arg2Tag, GPRReg arg2Payload, int32_t arg3)
</del><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EJZ operation, GPRReg arg1Tag, GPRReg arg1Payload, int32_t arg2)
</ins><span class="cx"> {
</span><span class="cx"> #if CPU(SH4)
</span><span class="cx"> // We have to put arg3 in the 4th argument register (r7) as 64-bit value arg2 will be put on stack for sh4 architecure.
</span><del>- setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg3), arg2Payload, arg2Tag);
</del><ins>+ setupArgumentsWithExecState(arg1Payload, arg1Tag, TrustedImm32(arg2));
</ins><span class="cx"> #else
</span><del>- setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, arg2Payload, arg2Tag, TrustedImm32(arg3));
</del><ins>+ setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG arg1Payload, arg1Tag, TrustedImm32(arg2));
</ins><span class="cx"> #endif
</span><span class="cx"> return appendCallWithExceptionCheck(operation);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(F_JITOperation_EFJJ operation, GPRReg arg1, GPRReg arg2Tag, GPRReg arg2Payload, GPRReg arg3Tag, GPRReg arg3Payload)
+{
+ setupArgumentsWithExecState(arg1, arg2Payload, arg2Tag, arg3Payload, arg3Tag);
+ return appendCallWithExceptionCheck(operation);
+}
+
</ins><span class="cx"> ALWAYS_INLINE MacroAssembler::Call JIT::callOperation(J_JITOperation_EAapJ operation, int dst, ArrayAllocationProfile* arg1, GPRReg arg2Tag, GPRReg arg2Payload)
</span><span class="cx"> {
</span><span class="cx"> setupArgumentsWithExecState(TrustedImmPtr(arg1), arg2Payload, arg2Tag);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.cpp        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -1526,14 +1526,23 @@
</span><span class="cx"> return JSValue::encode(jsBoolean(result));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, EncodedJSValue encodedThis, EncodedJSValue encodedArguments, int32_t firstFreeRegister)
</del><ins>+CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState* exec, EncodedJSValue encodedArguments, int32_t firstFreeRegister)
</ins><span class="cx"> {
</span><span class="cx"> VM& vm = exec->vm();
</span><span class="cx"> NativeCallFrameTracer tracer(&vm, exec);
</span><span class="cx"> JSStack* stack = &exec->interpreter()->stack();
</span><ins>+ JSValue arguments = JSValue::decode(encodedArguments);
+ CallFrame* newCallFrame = sizeAndAllocFrameForVarargs(exec, stack, arguments, firstFreeRegister);
+ return newCallFrame;
+}
+
+CallFrame* JIT_OPERATION operationLoadVarargs(ExecState* exec, CallFrame* newCallFrame, EncodedJSValue encodedThis, EncodedJSValue encodedArguments)
+{
+ VM& vm = exec->vm();
+ NativeCallFrameTracer tracer(&vm, exec);
</ins><span class="cx"> JSValue thisValue = JSValue::decode(encodedThis);
</span><span class="cx"> JSValue arguments = JSValue::decode(encodedArguments);
</span><del>- CallFrame* newCallFrame = loadVarargs(exec, stack, thisValue, arguments, firstFreeRegister);
</del><ins>+ loadVarargs(exec, newCallFrame, thisValue, arguments);
</ins><span class="cx"> return newCallFrame;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/jit/JITOperations.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -79,7 +79,9 @@
</span><span class="cx"> Vws: VariableWatchpointSet*
</span><span class="cx"> Z: int32_t
</span><span class="cx"> */
</span><del>-typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJJZ)(ExecState*, EncodedJSValue, EncodedJSValue, int32_t);
</del><ins>+
+typedef CallFrame* JIT_OPERATION (*F_JITOperation_EFJJ)(ExecState*, CallFrame*, EncodedJSValue, EncodedJSValue);
+typedef CallFrame* JIT_OPERATION (*F_JITOperation_EJZ)(ExecState*, EncodedJSValue, int32_t);
</ins><span class="cx"> typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_E)(ExecState*);
</span><span class="cx"> typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EA)(ExecState*, JSArray*);
</span><span class="cx"> typedef EncodedJSValue JIT_OPERATION (*J_JITOperation_EAZ)(ExecState*, JSArray*, int32_t);
</span><span class="lines">@@ -264,7 +266,8 @@
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationDeleteById(ExecState*, EncodedJSValue base, const Identifier*) WTF_INTERNAL;
</span><span class="cx"> JSCell* JIT_OPERATION operationGetPNames(ExecState*, JSObject*) WTF_INTERNAL;
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationInstanceOf(ExecState*, EncodedJSValue, EncodedJSValue proto) WTF_INTERNAL;
</span><del>-CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, EncodedJSValue thisValue, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL;
</del><ins>+CallFrame* JIT_OPERATION operationSizeAndAllocFrameForVarargs(ExecState*, EncodedJSValue arguments, int32_t firstFreeRegister) WTF_INTERNAL;
+CallFrame* JIT_OPERATION operationLoadVarargs(ExecState*, CallFrame*, EncodedJSValue thisValue, EncodedJSValue arguments) WTF_INTERNAL;
</ins><span class="cx"> EncodedJSValue JIT_OPERATION operationToObject(ExecState*, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx">
</span><span class="cx"> char* JIT_OPERATION operationSwitchCharWithUnknownKeyType(ExecState*, EncodedJSValue key, size_t tableIndex) WTF_INTERNAL;
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -1105,19 +1105,33 @@
</span><span class="cx"> return genericCall(exec, pc, CodeForConstruct);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-LLINT_SLOW_PATH_DECL(slow_path_call_varargs)
</del><ins>+LLINT_SLOW_PATH_DECL(slow_path_size_and_alloc_frame_for_varargs)
</ins><span class="cx"> {
</span><span class="cx"> LLINT_BEGIN();
</span><span class="cx"> // This needs to:
</span><span class="cx"> // - Set up a call frame while respecting the variable arguments.
</span><ins>+
+ ExecState* execCallee = sizeAndAllocFrameForVarargs(exec, &vm.interpreter->stack(),
+ LLINT_OP_C(4).jsValue(), pc[5].u.operand);
+ LLINT_CALL_CHECK_EXCEPTION(exec);
+
+ vm.newCallFrameReturnValue = execCallee;
+
+ LLINT_END();
+}
+
+LLINT_SLOW_PATH_DECL(slow_path_call_varargs)
+{
+ LLINT_BEGIN_NO_SET_PC();
+ // This needs to:
</ins><span class="cx"> // - Figure out what to call and compile it if necessary.
</span><span class="cx"> // - Return a tuple of machine code address to call and the new call frame.
</span><span class="cx">
</span><span class="cx"> JSValue calleeAsValue = LLINT_OP_C(2).jsValue();
</span><span class="cx">
</span><del>- ExecState* execCallee = loadVarargs(
- exec, &vm.interpreter->stack(),
- LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue(), pc[5].u.operand);
</del><ins>+ ExecState* execCallee = vm.newCallFrameReturnValue;
+
+ loadVarargs(exec, execCallee, LLINT_OP_C(3).jsValue(), LLINT_OP_C(4).jsValue());
</ins><span class="cx"> LLINT_CALL_CHECK_EXCEPTION(exec);
</span><span class="cx">
</span><span class="cx"> execCallee->uncheckedR(JSStack::Callee) = calleeAsValue;
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -100,6 +100,7 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_new_func_exp);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_construct);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_size_and_alloc_frame_for_varargs);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_varargs);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_call_eval);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_tear_off_activation);
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -723,6 +723,8 @@
</span><span class="cx">
</span><span class="cx"> _llint_op_call_varargs:
</span><span class="cx"> traceExecution()
</span><ins>+ callSlowPath(_llint_slow_path_size_and_alloc_frame_for_varargs)
+ branchIfException(_llint_throw_from_slow_path_trampoline)
</ins><span class="cx"> slowPathForCall(_llint_slow_path_call_varargs)
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreter32_64asm"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -551,6 +551,14 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx">
</span><ins>+macro branchIfException(label)
+ loadp ScopeChain[cfr], t3
+ andp MarkedBlockMask, t3
+ loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
+ bineq VM::m_exception + TagOffset[t3], EmptyValueTag, label
+end
+
+
</ins><span class="cx"> # Instruction implementations
</span><span class="cx">
</span><span class="cx"> _llint_op_enter:
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCorellintLowLevelInterpreter64asm"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -389,6 +389,14 @@
</span><span class="cx"> end
</span><span class="cx">
</span><span class="cx">
</span><ins>+macro branchIfException(label)
+ loadp ScopeChain[cfr], t3
+ andp MarkedBlockMask, t3
+ loadp MarkedBlock::m_weakSet + WeakSet::m_vm[t3], t3
+ btqnz VM::m_exception[t3], label
+end
+
+
</ins><span class="cx"> # Instruction implementations
</span><span class="cx">
</span><span class="cx"> _llint_op_enter:
</span></span></pre></div>
<a id="branchesjsCStackSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: branches/jsCStack/Source/JavaScriptCore/runtime/VM.h (160252 => 160253)</h4>
<pre class="diff"><span>
<span class="info">--- branches/jsCStack/Source/JavaScriptCore/runtime/VM.h        2013-12-06 22:54:02 UTC (rev 160252)
+++ branches/jsCStack/Source/JavaScriptCore/runtime/VM.h        2013-12-06 22:54:41 UTC (rev 160253)
</span><span class="lines">@@ -383,6 +383,7 @@
</span><span class="cx">
</span><span class="cx"> ReturnAddressPtr exceptionLocation;
</span><span class="cx"> JSValue hostCallReturnValue;
</span><ins>+ ExecState* newCallFrameReturnValue;
</ins><span class="cx"> ExecState* callFrameForThrow;
</span><span class="cx"> void* targetMachinePCForThrow;
</span><span class="cx"> Instruction* targetInterpreterPCForThrow;
</span></span></pre>
</div>
</div>
</body>
</html>